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

:root {
    /* Glassmorphism Theme */
    --bg-dark: #070914;
    --glass-bg: rgba(20, 25, 45, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 16px 32px 0 rgba(0, 0, 0, 0.3);
    
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    /* Vibrant liquid accents for progress bars */
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --error: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    /* Deep animated mesh gradient background */
    background: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 40%),
                radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 40%),
                radial-gradient(circle at 50% 80%, rgba(236, 72, 153, 0.1), transparent 50%),
                var(--bg-dark);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem;
}

/* LAYOUT */
.app-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* HEADER */
.app-header {
    text-align: center;
    padding: 1rem 0;
}
.app-header h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    background: linear-gradient(to right, #fff, rgba(255,255,255,0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}
.app-header .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.1em;
}

/* WIDGETS (GLASS PANELS) */
.widget {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.widget:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.75rem;
}

.widget-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* TOP WIDGETS GRID */
.top-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

/* METRICS (CPU, RAM, DSK, TMP, GPU) */
.metrics {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.metric {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metric .label {
    width: 80px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.metric .value {
    width: 60px;
    text-align: right;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.02);
}

.progress {
    height: 100%;
    border-radius: 8px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Metric Gradients */
#cpu-bar { background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan)); box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }
#ram-bar { background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink)); box-shadow: 0 0 10px rgba(139, 92, 246, 0.5); }
#disk-bar { background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan)); box-shadow: 0 0 10px rgba(16, 185, 129, 0.5); }
#temp-bar { background: linear-gradient(90deg, var(--accent-orange), var(--error)); box-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }
#gpu-bar { background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue)); box-shadow: 0 0 10px rgba(6, 182, 212, 0.5); }

/* MTA TRANSIT WIDGET */
.mta-arrivals {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.direction {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid rgba(255,255,255,0.03);
}

.direction h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.direction-times {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mta-time-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mta-time-val {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
}
.mta-time-val.arriving {
    color: var(--accent-green);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.mta-bullet, .mta-bullet-small {
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.mta-bullet { width: 40px; height: 40px; font-size: 1.2rem; }
.mta-bullet-small { width: 28px; height: 28px; font-size: 0.9rem; }

/* MTA Colors */
.mta-l { background-color: #A7A9AC; }
.mta-g { background-color: #6CBE45; }
.mta-1, .mta-2, .mta-3 { background-color: #EE352E; }
.mta-4, .mta-5, .mta-6 { background-color: #00933C; }
.mta-7 { background-color: #B933AD; }
.mta-a, .mta-c, .mta-e { background-color: #0039A6; }
.mta-b, .mta-d, .mta-f, .mta-m { background-color: #FF6319; }
.mta-n, .mta-q, .mta-r, .mta-w { background-color: #FCCC0A; color: #000; }
.mta-j, .mta-z { background-color: #996633; }

/* BUTTONS */
.btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(10px);
}
.btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}

/* SMART HOME - HUE */
.hue-rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    list-style: none;
}
.hue-room-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
}

.hue-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0,0,0,0.15);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.03);
}

.hue-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hue-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* TOGGLE SWITCH (GLASS) */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .4s;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-primary);
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider {
    background-color: var(--accent-blue);
    border-color: transparent;
}
input:checked + .slider:before {
    transform: translateX(20px);
}

/* RANGE INPUT (GLASS) */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
}
input[type=range]::-webkit-slider-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* FILES & STORAGE */
.file-upload-zone {
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    background: rgba(0,0,0,0.1);
    transition: all 0.2s;
}
.file-upload-zone:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}
.file-label {
    cursor: pointer;
    color: var(--accent-blue);
    font-weight: 500;
}

#file-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.02);
}
.file-info {
    display: flex;
    flex-direction: column;
}
.file-name {
    font-size: 0.9rem;
    font-weight: 500;
}
.file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.download-link {
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    cursor: pointer;
}
.delete-btn {
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* STATUS WIDGET */
#service-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
#service-list li {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.15);
    padding: 0.75rem 1rem;
    border-radius: 8px;
}
.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.status-dot.online { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.status-dot.offline { background: var(--error); box-shadow: 0 0 8px var(--error); }

.hidden { display: none !important; }

/* MTA WIDGET SPECIFIC OVERRIDES */
.widget.mta-widget {
    background: #111 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 4px solid #000 !important;
    border-radius: 0 !important;
    box-shadow: inset 0 0 0 2px #fff !important;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    color: #fff !important;
}

.mta-widget .widget-header {
    border-bottom: 2px solid #fff;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.mta-widget .widget-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: uppercase;
}

.mta-widget .direction {
    background: transparent;
    border: none;
    padding: 0.5rem 0;
    border-bottom: 1px solid #333;
    border-radius: 0;
}
.mta-widget .direction:last-child {
    border-bottom: none;
}

.mta-widget .direction h3 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #ccc;
    margin-bottom: 0.5rem;
    letter-spacing: normal;
}

/* STATION PICKER & SELECT STYLES */
.station-picker {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.station-picker select {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 8px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 0.9rem;
    outline: none;
}

.station-picker select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.station-picker select option {
    background: #111;
    color: #fff;
}

/* FOOTER */
.app-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding-bottom: 2rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .top-widgets-grid {
        grid-template-columns: 1fr;
    }
    .widget {
        padding: 1.25rem;
    }
    body {
        padding: 1rem;
    }
}

.transfer-status {
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.transfer-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}
