
/* Core OS Styles */
body {
    background-color: #000;
    overflow: hidden;
    /* Custom Cursor for Desktop */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2300f3ff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="3"/></svg>') 12 12, auto;
    touch-action: none; /* Prevent browser zooming/scrolling on mobile */
}

/* Scanline Overlay */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.3;
}

/* CRT Flicker */
.crt::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* Window Styling */
.os-window {
    position: absolute;
    background: rgba(5, 10, 20, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 243, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    border-radius: 6px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.2s;
    transform: scale(0.95);
    opacity: 0;
}

.os-window.active {
    display: flex;
    opacity: 1;
    transform: scale(1);
    z-index: 50;
}

/* Mobile Specifics */
@media (max-width: 768px) {
    .os-window.active {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100% - 3rem) !important; /* Leave space for taskbar */
        border: none;
        border-radius: 0;
        transform: none;
        z-index: 60; /* Higher than desktop windows */
    }
    .desktop-icon-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 cols on mobile for better spacing */
        gap: 1.5rem;
        padding: 1.5rem;
        justify-items: center;
    }
    .drag-handle {
        cursor: default !important;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    /* Start Menu Mobile */
    #start-menu {
        width: 90% !important;
        left: 5% !important;
        bottom: 3.5rem !important;
    }

    /* Larger text for inputs on mobile to prevent zoom */
    input[type="text"] {
        font-size: 16px !important;
    }

    /* Better touch targets for window controls */
    .window-controls button {
        padding: 0.5rem !important;
    }
}

/* Custom Scrollbar inside windows */
.window-content {
    touch-action: pan-y; /* Enable vertical scrolling on touch devices */
}
.window-content::-webkit-scrollbar {
    width: 4px;
}
.window-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.5);
}
.window-content::-webkit-scrollbar-thumb {
    background: #00f3ff;
    border-radius: 2px;
}

/* Start Menu Animation */
#start-menu {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom left;
}
#start-menu.hidden-menu {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    pointer-events: none;
}
#start-menu.visible-menu {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Tooltip behavior for funny quotes */
.skill-item:hover .skill-quote {
    opacity: 1;
    transform: translateY(0);
}

/* Hex Grid Overlay */
.hex-grid {
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%2300f3ff' fill-opacity='0.1' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    animation: pulse-grid 10s ease-in-out infinite;
}

@keyframes pulse-grid {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.2; }
}

/* Active Window Glow */
.os-window.active {
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.4), inset 0 0 20px rgba(0, 243, 255, 0.1);
}

/* Theme Classes (applied to body) */
body.theme-amber .text-cyan { color: #f59e0b !important; }
body.theme-amber .border-cyan { border-color: #f59e0b !important; }
body.theme-amber .bg-cyan { background-color: #f59e0b !important; }
body.theme-amber .shadow-\[0_0_15px_\#00f3ff\] { box-shadow: 0 0 15px #f59e0b !important; }
body.theme-amber .os-window.active { box-shadow: 0 0 40px rgba(245, 158, 11, 0.4), inset 0 0 20px rgba(245, 158, 11, 0.1); }
body.theme-amber .selection\:bg-cyan::selection { background-color: #f59e0b; }

body.theme-green .text-cyan { color: #22c55e !important; }
body.theme-green .border-cyan { border-color: #22c55e !important; }
body.theme-green .bg-cyan { background-color: #22c55e !important; }
body.theme-green .shadow-\[0_0_15px_\#00f3ff\] { box-shadow: 0 0 15px #22c55e !important; }
body.theme-green .os-window.active { box-shadow: 0 0 40px rgba(34, 197, 94, 0.4), inset 0 0 20px rgba(34, 197, 94, 0.1); }
body.theme-green .selection\:bg-cyan::selection { background-color: #22c55e; }

/* Calculator Button Active State */
#calc-window button:active {
    transform: scale(0.95);
    background-color: rgba(255, 255, 255, 0.2);
}
