/* ============================================
   SahinOS — Taskbar Styles
   ============================================ */

.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--taskbar-height);
    background: rgba(20, 20, 35, 0.82);
    backdrop-filter: var(--blur-xl);
    -webkit-backdrop-filter: var(--blur-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    z-index: var(--z-taskbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.taskbar-left {
    flex: 1;
    display: flex;
    align-items: center;
}

.taskbar-center {
    display: flex;
    align-items: center;
    gap: 2px;
}

.taskbar-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Start Button */
.start-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
}

.start-btn svg {
    width: 18px;
    height: 18px;
}

.start-btn.active {
    background: var(--bg-active);
}

/* Taskbar Buttons */
.taskbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.taskbar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.taskbar-btn:active {
    background: var(--bg-active);
}

.taskbar-btn svg {
    width: 20px;
    height: 20px;
}

/* Pinned Apps */
.taskbar-pinned {
    display: flex;
    align-items: center;
    gap: 2px;
}

.taskbar-separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
    display: none;
}

.taskbar-separator.visible {
    display: block;
}

/* Taskbar App Items */
.taskbar-apps {
    display: flex;
    align-items: center;
    gap: 2px;
}

.taskbar-app {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.taskbar-app:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.taskbar-app.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.taskbar-app::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    border-radius: 2px;
    background: var(--accent-blue);
    transition: width var(--transition-fast);
}

.taskbar-app.open::after {
    width: 6px;
}

.taskbar-app.active::after {
    width: 16px;
}

.taskbar-app svg {
    width: 20px;
    height: 20px;
}

/* System Tray */
.system-tray {
    display: flex;
    align-items: center;
    gap: 2px;
}

.tray-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.tray-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tray-btn svg {
    width: 16px;
    height: 16px;
}

/* Language Selector */
.tray-lang {
    position: relative;
}

.lang-current {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.lang-current:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.lang-popup {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: var(--bg-glass);
    backdrop-filter: var(--blur-xl);
    -webkit-backdrop-filter: var(--blur-xl);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: calc(var(--z-taskbar) + 10);
}

.lang-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-sans);
    cursor: pointer;
    border-radius: var(--radius-sm);
    text-align: left;
    transition: all var(--transition-fast);
}

.lang-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.lang-option.active {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

/* DateTime */
.tray-datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.tray-datetime:hover {
    background: var(--bg-hover);
}

.tray-time {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.tray-date {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* Quick Settings Panel */
.quick-settings-panel {
    position: fixed;
    bottom: calc(var(--taskbar-height) + 12px);
    right: 12px;
    width: 360px;
    background: var(--bg-glass);
    backdrop-filter: var(--blur-xl);
    -webkit-backdrop-filter: var(--blur-xl);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: calc(var(--z-taskbar) + 5);
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-settings-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.qs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.qs-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.qs-tile:hover {
    background: rgba(255, 255, 255, 0.08);
}

.qs-tile.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

.qs-tile svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.qs-tile.active svg {
    color: var(--accent-blue);
}

.qs-tile span {
    font-size: 11px;
    color: var(--text-secondary);
}

.qs-tile.active span {
    color: var(--accent-blue);
}

.qs-slider-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qs-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qs-slider-row svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.qs-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.qs-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.qs-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}


/* ── Weather Widget ── */
.tray-weather {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tray-weather:hover {
    background: var(--bg-hover);
}

.weather-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.tray-weather:hover .weather-label {
    color: var(--text-primary);
}

.weather-popup {
    position: fixed;
    bottom: calc(var(--taskbar-height) + 8px);
    right: 120px;
    width: 260px;
    background: rgba(32, 32, 48, 0.92);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 20px;
    z-index: calc(var(--z-taskbar) + 5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
}

.weather-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.weather-popup-loading {
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
    padding: 10px 0;
}

.weather-detail-main {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.weather-detail-temp {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
}

.weather-detail-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.weather-detail-row {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 3px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Calendar Popup ── */
.calendar-popup {
    position: fixed;
    bottom: calc(var(--taskbar-height) + 8px);
    right: 12px;
    width: 280px;
    background: rgba(32, 32, 48, 0.92);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 16px;
    z-index: calc(var(--z-taskbar) + 5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
}

.calendar-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mini-cal-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 12px;
    text-transform: capitalize;
}

.mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.mini-cal-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    padding: 4px 0;
}

.mini-cal-day {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    padding: 6px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mini-cal-day:not(.empty):hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mini-cal-day.today {
    background: var(--accent-blue);
    color: #fff;
    font-weight: 600;
    border-radius: 50%;
}

.mini-cal-day.today:hover {
    background: #3b82f6;
    color: #fff;
}

.mini-cal-day.empty {
    cursor: default;
}

/* ── WiFi Off Overlay ── */
.wifi-off-blur {
    filter: blur(6px) !important;
    pointer-events: none !important;
    transition: filter 0.5s ease !important;
}

#wifi-off-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--taskbar-height);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 999;
    animation: fadeIn 0.5s ease;
    pointer-events: none;
}

#wifi-off-overlay svg {
    color: rgba(255, 255, 255, 0.7);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

#wifi-off-overlay span {
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] #wifi-off-overlay {
    background: rgba(255, 255, 255, 0.4);
}

[data-theme="light"] #wifi-off-overlay svg {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] #wifi-off-overlay span {
    color: rgba(0, 0, 0, 0.6);
    text-shadow: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Nightlight Overlay ── */
#nightlight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--taskbar-height);
    background: rgba(255, 140, 0, 0.12);
    pointer-events: none;
    z-index: 998;
    transition: opacity 0.5s ease;
}

/* ── Focus Moon Icon ── */
#focus-moon-icon {
    display: flex;
    align-items: center;
    padding: 0 4px;
    color: #fbbf24;
}

#focus-moon-icon svg {
    width: 14px;
    height: 14px;
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
    .taskbar {
        padding: 0 4px;
    }

    .taskbar-btn {
        min-width: 40px;
        min-height: 40px;
    }

    .taskbar-pinned {
        display: none;
    }

    .taskbar-separator {
        display: none;
    }

    .tray-datetime .tray-date {
        display: none;
    }

    .tray-datetime .tray-time {
        font-size: 12px;
    }

    .tray-btn {
        padding: 6px;
    }

    .tray-lang {
        font-size: 11px;
    }

    .system-tray {
        gap: 2px;
    }
}
