/* ==========================================
   OS THEME - TASKBAR & CRT EFFECTS
   Windows XP-inspired interface elements
   ========================================== */

/* ==========================================
   TASKBAR
   ========================================== */

.taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    z-index: 50;
    display: flex;
    align-items: stretch;
    user-select: none;
    background: linear-gradient(to bottom,
        #245edb 0%,
        #3f8cf3 9%,
        #245edb 18%,
        #245edb 92%,
        #1941a5 100%);
    border-top: 1px solid #1a3a8a;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

/* Start Button */
.start-button {
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
    height: 100%;
    background: linear-gradient(to bottom,
        #388e3c 0%,
        #4caf50 15%,
        #388e3c 85%,
        #1b5e20 100%);
    border-radius: 0 10px 10px 0;
    border-right: 1px solid #1b5e20;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.4);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-style: italic;
    font-size: 14px;
    letter-spacing: -0.02em;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    transition: filter 150ms ease;
    cursor: pointer;
}

.start-button:hover {
    filter: brightness(1.1);
}

.start-button:active {
    filter: brightness(0.9);
}

/* Task Buttons Area */
.task-buttons {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 4px;
    overflow: hidden;
}

.task-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 24px;
    min-width: 100px;
    max-width: 160px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: #3c81f3;
    color: #ffffff;
    font-size: 11px;
    text-decoration: none;
    transition: all 150ms ease;
    cursor: pointer;
    box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.3);
}

.task-button:hover {
    background: #5291f5;
}

.task-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-button.active {
    background: #1e41a3;
    border-color: #0a1a4a;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

/* System Tray */
.system-tray {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-left: 1px solid #0a1a4a;
    background: linear-gradient(to bottom, #0997ff 0%, #0053ee 100%);
}

#tray-clock {
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* Mobile Taskbar Adjustments */
@media (max-width: 767px) {
    .taskbar {
        height: 40px;
    }

    .start-button {
        padding: 0 12px;
        font-size: 12px;
    }

    .task-buttons {
        gap: 2px;
        padding: 0 4px;
    }

    .task-button {
        min-width: 80px;
        max-width: 120px;
        padding: 0 8px;
        font-size: 10px;
    }

    .system-tray {
        padding: 0 8px;
    }

    #tray-clock {
        font-size: 10px;
    }
}

/* ==========================================
   CRT EFFECTS
   ========================================== */

.crt-fx-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

/* Scanlines */
.crt-scanlines {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    background-size: 100% 4px;
    position: absolute;
    top: 0;
    left: 0;
}

/* CRT Noise */
.crt-noise {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    mix-blend-mode: overlay;
}

/* Vignette */
.crt-vignette {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle,
        rgba(0, 0, 0, 0) 50%,
        rgba(0, 0, 0, 0.2) 90%,
        rgba(0, 0, 0, 0.4) 100%
    );
}

/* CRT Shimmer Animation */
@keyframes crt-shimmer {
    0% {
        transform: translate3d(0, 0, 0);
        opacity: 0.98;
    }
    5% {
        transform: translate3d(0, 1px, 0);
        opacity: 1;
    }
    10% {
        transform: translate3d(0, 0, 0);
        opacity: 0.98;
    }
    100% {
        transform: translate3d(0, 0, 0);
        opacity: 0.98;
    }
}

.crt-active .crt-fx-container {
    animation: crt-shimmer 4s infinite;
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .crt-active .crt-fx-container {
        animation: none;
    }
}

/* Z-Index Layering */
#wallpaper-layer {
    z-index: 0;
}

#wallpaper-overlay {
    z-index: 1;
}

#desktop-container,
.page-transition-container,
.window-frame {
    z-index: 10;
}

.taskbar {
    z-index: 50;
}

.crt-fx-container {
    z-index: 999;
}

/* ==========================================
   WINDOW THEMES (Different colors for different pages)
   ========================================== */

.window-titlebar.theme-default {
    background: linear-gradient(to bottom, #0997ff 0%, #0053ee 100%);
}

.window-titlebar.theme-powerpoint {
    background: linear-gradient(to bottom, #f97316 0%, #ea580c 100%);
}

.window-titlebar.theme-games {
    background: linear-gradient(to bottom, #333333 0%, #111111 100%);
}

.window-titlebar.theme-shop {
    background: linear-gradient(to bottom, #fbbf24 0%, #eab308 100%);
}

.window-titlebar.theme-success {
    background: linear-gradient(to bottom, #4caf50 0%, #388e3c 100%);
}

/* ==========================================
   LOADING & PERFORMANCE
   ========================================== */

/* Skeleton loading for icons */
.icon-image.loading {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 25%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* GPU acceleration hints */
.taskbar,
.desktop-icon,
.task-button,
.window-frame {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}
