/* ==========================================
   WILL HALL PORTFOLIO - MAIN STYLES
   Modern, performant, FAANG-quality code
   ========================================== */

/* CSS Variables */
:root {
    /* Colors */
    --color-bg: #050505;
    --color-desktop-bg: #2e5e68;
    --color-wallpaper-overlay: rgba(0, 0, 0, 0.3);
    --color-text-primary: #ffffff;
    --color-text-secondary: #cccccc;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 600ms cubic-bezier(0.16, 1, 0.3, 1);

    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.25);
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.5;
}

/* ==========================================
   MONITOR WRAPPER & RESPONSIVE LAYOUT
   ========================================== */

#monitor-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#monitor-frame {
    display: none;
}

#screen {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: var(--color-desktop-bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Tablet/Fullscreen Layout - Full viewport, no monitor frame */
@media (min-width: 768px) and (max-width: 1023px) {
    #monitor-wrapper {
        width: 100vw;
        height: 100vh;
    }

    #monitor-frame {
        display: none;
    }

    #screen {
        width: 100%;
        height: 100%;
    }
}

/* Desktop Layout - Monitor Frame */
@media (min-width: 1024px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #monitor-wrapper {
        width: auto;
        height: 90vh;
        aspect-ratio: 5/4;
    }

    #monitor-frame {
        display: block;
        height: 100%;
        width: 100%;
        object-fit: contain;
        pointer-events: none;
        position: absolute;
        inset: 0;
        z-index: 20;
    }

    #screen {
        position: absolute;
        top: 15.1%;
        left: 16.6%;
        width: 68.5%;
        height: 63.6%;
        border-radius: 8px;
        box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
        z-index: 10;
    }
}

/* ==========================================
   WALLPAPER LAYER
   ========================================== */

#wallpaper-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(135deg, #2e5e68 0%, #1a3a45 100%);
    background-image: url('https://cdn.shopify.com/s/files/1/0782/5355/5942/files/RDT_20251228_0304446167279745945899905_1.jpg');
    background-size: cover;
    background-position: center;
}

#wallpaper-overlay {
    position: absolute;
    inset: 0;
    background-color: var(--color-wallpaper-overlay);
    z-index: 1;
}

/* ==========================================
   DESKTOP CONTAINER
   ========================================== */

#desktop-container {
    position: relative;
    z-index: 10;
    flex: 1;
    overflow: hidden;
    padding: var(--spacing-lg);
}

/* Desktop Icons Grid */
.desktop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    grid-auto-flow: column;
    grid-template-rows: repeat(4, min-content);
    gap: var(--spacing-lg) var(--spacing-xl);
    max-height: calc(100% - 64px);
    overflow: hidden;
    padding: var(--spacing-md);
}

@media (max-width: 767px) {
    .desktop-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-flow: row;
        grid-template-rows: auto;
        gap: var(--spacing-md);
        padding: var(--spacing-sm);
    }
}

/* Desktop Icon */
.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    text-decoration: none;
    color: var(--color-text-primary);
    border-radius: 4px;
    transition: background-color var(--transition-fast);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.desktop-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.desktop-icon:active {
    background-color: rgba(255, 255, 255, 0.15);
}

.icon-image {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.icon-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.icon-label {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1.3;
}

@media (max-width: 767px) {
    .icon-image {
        width: 40px;
        height: 40px;
    }

    .icon-label {
        font-size: 10px;
        max-width: 70px;
    }
}

/* ==========================================
   PAGE TRANSITIONS
   ========================================== */

.page-transition-container {
    position: absolute;
    inset: 0;
    z-index: 15;
    transition: all var(--transition-slow);
    transform-origin: var(--origin-x, 50%) var(--origin-y, 50%);
}

.page-enter {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    filter: blur(4px);
}

.page-enter-active {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
}

.page-exit {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

.page-exit-active {
    opacity: 0;
    transform: scale(0.98);
    filter: blur(2px);
}

/* Respect user preferences */
@media (prefers-reduced-motion: reduce) {
    .page-transition-container,
    .page-enter,
    .page-enter-active,
    .page-exit,
    .page-exit-active {
        transition: none !important;
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
        filter: none !important;
    }
}

/* ==========================================
   WINDOW FRAME (For Pages)
   ========================================== */

.window-frame {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: flex;
    flex-direction: column;
    background: #000000;
    box-shadow: var(--shadow-xl);
}

@media (min-width: 768px) {
    .window-frame {
        border-radius: 0;
        border: none;
    }
}

/* Window Title Bar */
.window-titlebar {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: linear-gradient(to bottom, #0997ff 0%, #0053ee 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    user-select: none;
}

.window-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-text-primary);
}

.window-title-icon {
    width: 16px;
    height: 16px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.window-title-text {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.window-controls {
    display: flex;
    gap: var(--spacing-xs);
}

.window-close-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #c0c0c0;
    color: #000000;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid #ffffff;
    border-bottom-color: #000000;
    border-right-color: #000000;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    text-decoration: none;
}

.window-close-btn:hover {
    background-color: #d0d0d0;
}

.window-close-btn:active {
    background-color: #a0a0a0;
    border-top-color: #000000;
    border-left-color: #000000;
    border-bottom-color: #ffffff;
    border-right-color: #ffffff;
}

/* Window Body */
.window-body {
    flex: 1;
    background-color: #ffffff;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================
   SCROLLBAR STYLES
   ========================================== */

.os-scroll::-webkit-scrollbar,
.window-body::-webkit-scrollbar {
    width: 12px;
}

.os-scroll::-webkit-scrollbar-track,
.window-body::-webkit-scrollbar-track {
    background: #dfdfdf;
}

.os-scroll::-webkit-scrollbar-thumb,
.window-body::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 2px solid #dfdfdf;
    box-shadow: inset 1px 1px #ffffff, inset -1px -1px #000000;
}

.os-scroll::-webkit-scrollbar-thumb:hover,
.window-body::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
}
