:root {
    --bg: #1e1e1e;
    --menubar-bg: rgba(33, 33, 33, 0.8);
    --dock-bg: rgba(40, 40, 40, 0.6);
    --window-bg: rgba(50, 50, 50, 0.9);
    --window-header: rgba(60, 60, 60, 0.9);
    --accent: #ff3e3e;
    --text: #ffffff;
    --text-dim: #cccccc;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --window-radius: 10px;
    --dock-size: 60px;
    --menubar-height: 28px;
    --spring-easing: cubic-bezier(0.34, 1.56, 0.64, 1);
    --smooth-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    user-select: none;
}

body {
    background-color: var(--bg);
    color: var(--text);
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    cursor: default;
    background-image: url('images/background.png');
    background-size: cover;
    background-position: center;
}

.menubar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--menubar-height);
    background-color: var(--menubar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 900;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.menubar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.os-logo {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.os-logo-icon {
    width: 20px;
    height: 20px;
    position: relative;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.os-logo-icon::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff3e3e, #ff7676);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 62, 62, 0.3);
}

.menubar-app-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 15px;
    transition: color 0.2s ease;
}

.menubar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menubar-sora {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.menubar-sora:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.sora-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.2s ease;
}

.menubar-sora:hover .sora-icon {
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

.menubar-sora.listening {
    background-color: rgba(255, 62, 62, 0.2);
    animation: pulse-listening 1.5s infinite;
}

@keyframes pulse-listening {
    0%, 100% { 
        background-color: rgba(255, 62, 62, 0.2);
        transform: scale(1);
    }
    50% { 
        background-color: rgba(255, 62, 62, 0.4);
        transform: scale(1.1);
    }
}

.sora-voice-panel {
    position: fixed;
    top: var(--menubar-height);
    right: 15px;
    width: 300px;
    height: 300px;
    background-color: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    transform: scale(0.8) translateY(-20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s var(--spring-easing);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sora-voice-panel.show {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.sora-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 18px;
    opacity: 0.8;
}

.sora-avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.sora-voice-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    transition: all 0.3s ease;
    animation: avatarFloat 3s ease-in-out infinite;
    z-index: 3;
    position: relative;
}

@keyframes avatarFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.sora-voice-avatar.listening {
    animation: avatarFloat 3s ease-in-out infinite, avatarPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(255, 62, 62, 0.5);
}

@keyframes avatarPulse {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

.menubar-battery {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.menubar-battery:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.battery-icon {
    width: 16px;
    height: 16px;
    color: var(--text);
}

.battery-fill {
    fill: #34c759;
    stroke: none;
}

.battery-percentage {
    font-size: 11px;
    color: var(--text);
}

.menubar-time {
    font-size: 12px;
    color: var(--text);
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    cursor: pointer;
    position: relative;
}

.menubar-time:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.calendar-dropdown {
    position: fixed;
    top: var(--menubar-height);
    right: 15px;
    width: 280px;
    background-color: rgba(50, 50, 50, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    padding: 16px;
    z-index: 1000;
    transform: scale(0.9) translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s var(--spring-easing);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.calendar-dropdown.show {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-nav {
    background: none;
    border: none;
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.calendar-nav:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.calendar-month-year {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekdays div {
    text-align: center;
    font-size: 11px;
    color: var(--text-dim);
    padding: 4px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    text-align: center;
    padding: 8px 4px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.calendar-day:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.calendar-day.today {
    background-color: var(--accent);
    color: white;
}

.calendar-day.other-month {
    color: var(--text-dim);
    opacity: 0.5;
}

.dock-container {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    transition: transform 0.4s var(--smooth-easing);
}

.dock-container.hidden {
    transform: translateX(-50%) translateY(120px);
}

.dock-trigger {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    z-index: 999;
}

.dock {
    background-color: var(--dock-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 24px;
    display: flex;
    padding: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s var(--smooth-easing);
    position: relative;
    overflow: visible;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.dock:hover {
    transform: translateY(-5px);
    background-color: rgba(50, 50, 50, 0.8);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.dock::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    border-radius: 24px 24px 0 0;
}

.dock-app {
    width: var(--dock-size);
    height: var(--dock-size);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    transition: all 0.3s var(--spring-easing);
    position: relative;
    overflow: visible;
    cursor: pointer;
    margin: 0 2px;
}

.dock-app:hover {
    background-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-15px) scale(1.2);
    z-index: 10;
}

.dock-app:hover + .dock-app,
.dock-app:has(+ .dock-app:hover) {
    transform: translateY(-8px) scale(1.1);
}

.dock-app:hover + .dock-app + .dock-app,
.dock-app:has(+ .dock-app + .dock-app:hover) {
    transform: translateY(-4px) scale(1.05);
}

.dock-icon {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.4));
    transition: all 0.3s var(--spring-easing);
    border-radius: 12px;
}

.dock-app:hover .dock-icon {
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6));
}

.dock-app:active {
    transform: translateY(-12px) scale(1.15);
}

.dock-app:active .dock-icon {
    transform: scale(0.95);
}

.window {
    position: absolute;
    min-width: 500px;
    min-height: 300px;
    background-color: var(--window-bg);
    border-radius: var(--window-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: center;
    transition: all 0.4s var(--smooth-easing);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: scale(0.8) translateY(50px);
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.window.active {
    z-index: 101;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.window.show {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateY(0);
}

.window.minimized {
    transform: scale(0.05) translateY(800px) translateX(-50vw);
    opacity: 0;
    pointer-events: none;
    transition: all 0.6s var(--smooth-easing);
}

.window.maximized {
    top: var(--menubar-height) !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - var(--menubar-height)) !important;
    border-radius: 0;
    transition: all 0.4s var(--smooth-easing);
}

.window.dragging {
    transition: none;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    opacity: 0.95;
    transform: rotate(0.5deg) scale(1.01);
}

.window-header {
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    background-color: var(--window-header);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: move;
    transition: background-color 0.2s ease;
}

.window-header:hover {
    background-color: rgba(70, 70, 70, 0.9);
}

.window-traffic-lights {
    display: flex;
    gap: 8px;
    margin-right: 12px;
    flex-shrink: 0;
    cursor: default;
}

.window-title {
    flex-grow: 1;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    color: var(--text);
    transition: color 0.2s ease;
}

.window-close, 
.window-minimize, 
.window-maximize {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.25s var(--spring-easing);
    position: relative;
    cursor: pointer;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
}

.window-close {
    background: linear-gradient(135deg, #ff5f56, #ff4943);
}

.window-close:hover {
    background: linear-gradient(135deg, #ff3c30, #ff2d1f);
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(255, 60, 48, 0.4);
}

.window-close:active {
    transform: scale(0.95);
}

.window-minimize {
    background: linear-gradient(135deg, #ffbd2e, #ffaa00);
}

.window-minimize:hover {
    background: linear-gradient(135deg, #f0b528, #e09900);
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(240, 181, 40, 0.4);
}

.window-minimize:active {
    transform: scale(0.95);
}

.window-maximize {
    background: linear-gradient(135deg, #27c93f, #1db933);
}

.window-maximize:hover {
    background: linear-gradient(135deg, #1db933, #159928);
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(29, 185, 51, 0.4);
}

.window-maximize:active {
    transform: scale(0.95);
}

.window-content {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.95);
}

.window-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.context-menu {
    position: fixed;
    min-width: 220px;
    background-color: rgba(50, 50, 50, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    padding: 8px 0;
    z-index: 2000;
    transform-origin: top left;
    transform: scale(0.9) translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s var(--spring-easing);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.context-menu.show {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.context-menu-item {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text);
    display: flex;
    align-items: center;
    transition: all 0.15s ease;
    cursor: pointer;
    border-radius: 8px;
    margin: 0 8px;
}

.context-menu-item:hover {
    background-color: var(--accent);
    color: white;
    transform: translateX(2px);
}

.context-menu-icon {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.context-menu-item:hover .context-menu-icon {
    opacity: 1;
}

@keyframes dockBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    15% { transform: translateY(-25px) scale(1.15); }
    30% { transform: translateY(-10px) scale(1.08); }
    45% { transform: translateY(-18px) scale(1.12); }
    60% { transform: translateY(-6px) scale(1.04); }
    75% { transform: translateY(-12px) scale(1.08); }
    90% { transform: translateY(-3px) scale(1.02); }
}

.dock-bounce {
    animation: dockBounce 0.8s var(--spring-easing);
}

@keyframes windowOpen {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(100px);
    }
    60% {
        opacity: 0.8;
        transform: scale(1.05) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.window.opening {
    animation: windowOpen 0.5s var(--spring-easing) forwards;
}

@keyframes genie {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.8) translateY(50px) skewX(-5deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.1) translateY(500px) translateX(-300px) skewX(-20deg);
    }
}

.window.minimizing {
    animation: genie 0.7s var(--smooth-easing) forwards;
}

::selection {
    background: rgba(255, 62, 62, 0.3);
    color: white;
}

.dock-app:focus,
.window-close:focus,
.window-minimize:focus,
.window-maximize:focus {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .dock-app {
        width: 50px;
        height: 50px;
        margin: 0 1px;
    }

    .dock-icon {
        width: 35px;
        height: 35px;
    }

    .window {
        min-width: 320px;
    }

    .dock:hover {
        transform: translateY(-3px);
    }

    .dock-app:hover {
        transform: translateY(-10px) scale(1.15);
    }

    .dock {
        padding: 8px;
        border-radius: 20px;
    }

    .calendar-dropdown {
        width: 250px;
        right: 10px;
    }

    .menubar-battery {
        display: none;
    }
    
    .menubar-sora {
        display: none;
    }
    
    .sora-voice-panel {
        width: 250px;
        height: 250px;
        right: 10px;
    }
    
    .sora-avatar-container {
        width: 100px;
        height: 100px;
    }
    
    .sora-voice-avatar {
        width: 60px;
        height: 60px;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}