@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: hsl(245, 85%, 66%);
    --primary-hover: hsl(245, 85%, 60%);
    --primary-light: hsla(245, 85%, 66%, 0.15);
    --primary-glow: hsla(245, 85%, 66%, 0.3);
    --bg: #030712;
    --card-bg: rgba(15, 23, 42, 0.65);
    --glass-bg: rgba(15, 23, 42, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-light: rgba(255, 255, 255, 0.04);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #f43f5e;
    --warning: #f59e0b;
    --radius-xl: 1.5rem;
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    padding: 2rem 1rem;
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 0% 0%, hsla(245, 85%, 66%, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 100% 100%, hsla(160, 85%, 50%, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, #030712 0%, #020617 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Outfit', sans-serif; letter-spacing: -0.02em; }

.container { max-width: 1200px; margin: 0 auto; width: 100%; }

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn {
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    box-shadow: 0 10px 20px -5px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.btn-delete:hover {
    color: var(--danger);
    background: rgba(244, 63, 94, 0.1);
}

.runner-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    background: rgba(244, 63, 94, 0.05);
    border: 1px solid rgba(244, 63, 94, 0.15);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--danger);
    text-transform: uppercase;
}

.runner-status.online {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.online .status-dot {
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

section { margin-bottom: 3rem; padding: 2rem; }

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

h2 { font-size: 1.5rem; font-weight: 700; }

.table-container { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }

th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border-light);
    vertical-align: middle;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

tr:hover td { background: rgba(255, 255, 255, 0.02); }

.text-highlight {
    font-weight: 600;
    color: var(--text-main);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-subtle {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-active { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-inactive { background: rgba(244, 63, 94, 0.1); color: var(--danger); }

.search-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
    font-size: 0.85rem;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    gap: 1rem;
}

.page-btn {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    cursor: pointer;
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal-content {
    background: #0f172a;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    padding: 2.5rem;
    box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.8);
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
}

input, select {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

input:focus, select:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
}

svg.lucide {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Mobile Optimizations */
@media (max-width: 900px) {
    body { padding: 1rem 0.5rem; }
    header { flex-direction: column; align-items: stretch; margin-bottom: 2rem; }
    h1 { font-size: 2rem; text-align: center; }
    .brand-section p { text-align: center; }
    .runner-status { justify-content: center; }
    
    section { padding: 1.25rem; margin-bottom: 2rem; border-radius: var(--radius-lg); }
    .logs-header { flex-direction: column; align-items: stretch; gap: 1rem; }
    
    /* Table Transformation to Cards for Mobile */
    .table-container { overflow: visible !important; }
    table, thead, tbody, th, td, tr { 
        display: block !important; 
        width: 100% !important; 
        table-layout: auto !important;
    }
    
    thead tr { 
        position: absolute !important; 
        top: -9999px !important; 
        left: -9999px !important; 
        display: none !important;
    }
    
    tr {
        margin-bottom: 2rem !important;
        border: 1px solid var(--glass-border) !important;
        border-radius: var(--radius-md) !important;
        background: rgba(255, 255, 255, 0.02) !important;
        padding: 1rem !important;
    }
    
    td {
        border: none !important;
        border-bottom: 1px solid var(--glass-border-light) !important;
        position: relative !important;
        padding: 1rem 0 1rem 45% !important;
        white-space: normal !important;
        text-align: right !important;
        min-height: 3.5rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        overflow: visible !important;
    }
    
    td:last-child { border-bottom: none !important; }
    
    td:before {
        content: attr(data-label);
        position: absolute !important;
        left: 0 !important;
        width: 40% !important;
        text-align: left !important;
        font-weight: 800 !important;
        font-size: 0.7rem !important;
        text-transform: uppercase !important;
        color: var(--text-muted) !important;
        pointer-events: none;
    }
    
    .text-highlight, .text-subtle { text-align: right; width: 100%; word-break: break-all; }
    
    .pagination { flex-direction: column; gap: 1rem; }
    .modal-content { padding: 1.5rem; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }
}
