:root {
    --accent-color: #007AFF;
    --apple-red: #FF5F56;
    --apple-yellow: #FFBD2E;
    --apple-green: #27C93F;
    --glass-light: rgba(255, 255, 255, 0.15);
    --bg-window: rgba(28, 28, 30, 0.85);
    --text-main: #ffffff;
}

.dark-mode {
    --bg-window: rgba(20, 20, 22, 0.95);
}

#boot-screen {
    position: fixed;
    inset: 0;
    background: black;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease;
}

.boot-logo {
    font-size: 80px;
    color: white;
    margin-bottom: 40px;
}

.boot-progress-bar {
    width: 200px;
    height: 6px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
}

.boot-progress-fill {
    width: 0%;
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width 2.5s ease-in-out;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    background-color: #000;
}

.desktop {
    background-image: url('../image/wallpaper/princiapl.png');
    background-size: cover;
    background-position: center;
    height: 100vh;
    width: 100vw;
    position: relative;
    transition: filter 0.5s ease, background-image 0.5s ease;
    z-index: 1;
}

#brightness-overlay {
    position: fixed;
    inset: 0;
    background: black;
    pointer-events: none;
    z-index: 99999;
    opacity: 0;
}

@keyframes closeGenie {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: blur(0);
    }

    100% {
        transform: scale(0.1) translateY(500px);
        opacity: 0;
        filter: blur(20px);
    }
}

.window-closing {
    animation: closeGenie 0.4s cubic-bezier(0.55, 0, 0.1, 1) forwards;
    pointer-events: none;
}

/* Barra Superior */
.top-bar {
    height: 32px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(30px);
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    justify-content: space-between;
    z-index: 20000;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}

/* Estilos Ventana */
.window {
    position: absolute;
    background: var(--bg-window);
    backdrop-filter: blur(50px);
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: none;
    flex-direction: column;
    border: 0.5px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    transform-origin: bottom center;
    z-index: 100;
}

.window-header {
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    padding: 0 16px;
    cursor: default;
}

.traffic-lights {
    display: flex;
    gap: 8px;
    width: 70px;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    color: rgba(0, 0, 0, 0.4);
}

.light i {
    opacity: 0;
    transition: opacity 0.2s;
}

.light:hover i {
    opacity: 1;
}

.light-close {
    background: var(--apple-red);
}

.light-min {
    background: var(--apple-yellow);
}

.light-max {
    background: var(--apple-green);
}

/* Spotlight Search */
#spotlight {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    background: rgba(40, 40, 42, 0.8);
    backdrop-filter: blur(50px);
    border-radius: 15px;
    border: 0.5px solid rgba(255, 255, 255, 0.2);
    z-index: 40000;
    display: none;
    flex-direction: column;
    padding: 15px;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8);
}

/* Control Center */
#control-center {
    position: absolute;
    top: 40px;
    right: 10px;
    width: 320px;
    background: rgba(40, 40, 42, 0.8);
    backdrop-filter: blur(50px);
    border-radius: 18px;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 35000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.cc-tile {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px;
}

.cc-slider {
    width: 100%;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.cc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: white;
    border-radius: 50%;
    box-shadow: -400px 0 0 400px var(--accent-color);
}

/* Widgets */
.widgets-area {
    position: absolute;
    right: 20px;
    top: 50px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 160px;
    z-index: 50;
}

.widget {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Launchpad */
#launchpad {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(50px);
    z-index: 30000;
    display: none;
    flex-direction: column;
    align-items: center;
    padding-top: 80px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.launchpad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 40px;
    width: 80%;
    max-width: 900px;
    margin-top: 40px;
}

.launchpad-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.launchpad-item:hover {
    transform: scale(1.1);
}

.launchpad-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Dock */
.dock-container {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(35px);
    border-radius: 24px;
    border: 0.5px solid rgba(255, 255, 255, 0.2);
    z-index: 25000;
}

.dock-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.dock-icon {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-size: 24px;
    overflow: hidden;
}

.dock-item:hover .dock-icon {
    transform: scale(1.3) translateY(-12px);
}

.dock-tooltip {
    position: absolute;
    top: -45px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.dock-item:hover .dock-tooltip {
    opacity: 1;
}

.indicator {
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    margin-top: 4px;
    opacity: 0;
}

.indicator.active {
    opacity: 1;
}

/* Lock Screen */
#lock-screen {
    position: fixed;
    inset: 0;
    z-index: 50000;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(60px);
}

.shaking {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }
}

#context-menu {
    position: absolute;
    display: none;
    background: rgba(30, 30, 32, 0.95);
    backdrop-filter: blur(25px);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 5px;
    width: 190px;
    z-index: 50000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.menu-item {
    padding: 8px 12px;
    color: white;
    font-size: 12px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-item:hover {
    background: var(--accent-color);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Notifications */
#notification-container {
    position: fixed;
    top: 50px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 60000;
    pointer-events: none;
    /* Let clicks pass through */
}

.notification-toast {
    width: 280px;
    background: rgba(40, 40, 42, 0.7);
    backdrop-filter: blur(20px);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}

.notification-toast.show {
    transform: translateX(0);
}

/* Mobile Responsive Logic */
@media (min-width: 768px) {
    #mobile-profile {
        display: none !important;
    }
}

@media (max-width: 768px) {

    /* Hide specific elements explicitly just in case */
    .desktop,
    .dock-container,
    #launchpad,
    #spotlight,
    #control-center,
    #boot-screen,
    #lock-screen,
    .window,
    #brightness-overlay,
    #matrix-canvas {
        display: none !important;
    }

    /* Target specific IDs that might override */
    #desktop {
        display: none !important;
    }

    /* Show Mobile Profile */
    #mobile-profile {
        display: flex !important;
    }

    /* Reset body overflow for mobile scrolling if needed */
    body,
    html {
        overflow: auto;
    }
}