body {
    font-family: 'Be Vietnam Pro', sans-serif;
    background: linear-gradient(135deg, #772953 0%, #E95420 100%);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Glassmorphic Shells */
.glass-panel {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.glass-topbar {
    background: rgba(17, 17, 17, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-dock {
    background: rgba(17, 17, 17, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-menu {
    background: rgba(26, 28, 28, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Music Widget & Animations */
@keyframes rotate-vinyl {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.animate-vinyl {
    animation: rotate-vinyl 4s linear infinite;
}
@keyframes bounce-bar {
    0%, 100% { height: 4px; }
    50% { height: 24px; }
}
.music-bar {
    width: 3px;
    height: 4px;
    background: #E95420;
    border-radius: 9999px;
    transition: height 0.15s ease;
}
.music-bar.active {
    animation: bounce-bar 1.2s infinite ease-in-out;
}
.music-bar:nth-child(2).active { animation-delay: 0.15s; }
.music-bar:nth-child(3).active { animation-delay: 0.3s; }
.music-bar:nth-child(4).active { animation-delay: 0.45s; }
.music-bar:nth-child(5).active { animation-delay: 0.6s; }

/* Calendar Dropdown UI */
.calendar-day-header {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 4px 0;
    text-transform: uppercase;
}
.calendar-day {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    padding: 6px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.calendar-day:hover {
    background: rgba(255, 255, 255, 0.1);
}
.calendar-day.today {
    background: #E95420;
    color: white;
    font-weight: 700;
    box-shadow: 0 0 8px rgba(233, 84, 32, 0.5);
}
.calendar-day.empty {
    cursor: default;
    pointer-events: none;
}
.calendar-day.other-month {
    color: rgba(255, 255, 255, 0.25);
}

#windows-container {
    pointer-events: none;
}

/* Floating Window Styles (Desktop default) */
.app-window {
    position: absolute;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    background: #F7F7F7;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    pointer-events: auto;
}

.app-window.minimized {
    transform: scale(0.8) translateY(100px);
    opacity: 0;
    pointer-events: none;
}

.app-window.maximized {
    top: 48px !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 48px) !important;
    border-radius: 0 !important;
    border: none !important;
}

.window-header {
    cursor: move;
    user-select: none;
}

.desktop-icon-text {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Loading Dot Pulse */
@keyframes pulse-dot {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}
.dot {
    animation: pulse-dot 1.5s infinite ease-in-out both;
}
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.terminal-container {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Active window indicator in dock */
.dock-indicator {
    width: 4px;
    height: 4px;
    background: #E95420;
    border-radius: 50%;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 4px #E95420;
}

/* Z-Index Hierarchy and Layer management */
#lock-screen {
    z-index: 200 !important;
}
.glass-topbar {
    z-index: 100 !important;
}
#system-dropdown {
    z-index: 120 !important;
}
.dock-mobile {
    z-index: 110 !important;
}

/* ==================== PHONE / MOBILE RESPONSIVE OVERRIDES ==================== */
@media (max-width: 767px) {
    body.window-open .dock-mobile {
        display: none !important;
    }

    .app-window:not(#calculator-window) {
        top: 48px !important;
        left: 0 !important;
        width: 100vw !important;
        height: calc(100vh - 48px) !important; /* Full screen height below topbar */
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Calculator styled as a centered card on mobile */
    #calculator-window {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90vw !important;
        max-width: 320px !important;
        height: 480px !important;
        border-radius: 1rem !important;
        box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3) !important;
    }

    #file-details-popup {
        bottom: 0 !important;
        border-top-left-radius: 1.5rem !important;
        border-top-right-radius: 1.5rem !important;
        padding-bottom: 1.5rem !important;
        z-index: 130 !important;
    }

    .app-window.minimized {
        display: none !important;
    }

    .window-header {
        cursor: default !important;
    }

    /* Hide desktop controls, show back button on mobile */
    .window-controls-desktop {
        display: none !important;
    }
    .window-controls-mobile {
        display: flex !important;
    }

    /* Hiding settings sidebar on mobile, switching tab navigation to a floating bottom bar */
    .window-sidebar-desktop {
        display: none !important;
    }
    .window-sidebar-mobile {
        display: flex !important;
    }

    /* Hiding file manager details sidebar panel on mobile */
    .window-detail-desktop {
        display: none !important;
    }

    /* Hide left dock on mobile */
    .dock-desktop {
        display: none !important;
    }
    
    /* Desktop grid shortcuts flow nicely */
    main.desktop-shortcuts {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        width: 100vw !important;
        justify-items: center !important;
    }
}
