/* Reset & Variables */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');
/* macOS font clone */

:root {
    --bg-color: #000000;
    --window-bg: #1e1e1e;
    /* Fallback */
    --window-bg-blur: rgba(30, 30, 30, 0.7);
    --sidebar-bg: rgba(25, 25, 25, 0.6);
    --content-bg: rgba(0, 0, 0, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-blue: #0A84FF;
    /* macOS Blue */
    --folder-color: #0A84FF;
    --selection: rgba(10, 132, 255, 0.3);

    --font-system: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    /* Desktop feel */
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-system);
    overflow: hidden;
    /* No scroll on desktop */
    height: 100vh;
    width: 100vw;
}

/* Helper Classes */
.hidden {
    display: none !important;
}

/* Scene 1: Desktop */
.desktop-scene {
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000000;
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('assets/img/Mojave.webp');
    background-size: cover;
    background-position: center;
    gap: 80px;
    /* Space between icons */
    /* Deep Black */
}

.desktop-folder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 15px;
    border-radius: 5px;
    transition: background 0.2s;
}

.desktop-folder:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.desktop-folder:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.folder-icon {
    width: 80px;
    height: 80px;
}

.folder-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Scene 2: Finder Window */
.finder-scene {
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000000;
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('assets/img/Mojave.webp');
    background-size: cover;
    background-position: center;
}

.finder-window {
    position: relative;
    width: 1200px;
    height: auto;
    aspect-ratio: 733/442;
    /* Matches SVG dimensions */
    background-image: url('assets/svg/hudapple.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    /* SVG handles background */
    border: none;
    box-shadow: none;
    /* SVG might have shadow or we add a subtle one around the image shape if needed, but keeping clean */
    display: flex;
    overflow: hidden;
    padding: 0;
    /* SVG has its own internal padding/margins visually */
    filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.5));
    animation: openWindow 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes openWindow {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Sidebar */
.finder-sidebar {
    width: 23%;
    /* Adjusted to match SVG sidebar proportion (~168px/733px) */
    height: 100%;
    background: transparent;
    border: none;
    padding: 60px 10px 20px 25px;
    /* Push content down below traffic lights */
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    /* Enable vertical scrolling but hide bar if not needed */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* Custom Scrollbar for Webkit */
.finder-sidebar::-webkit-scrollbar {
    width: 6px;
}

.finder-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.finder-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* HTML controls positioned over SVG */
.window-controls {
    display: flex;
    position: absolute;
    top: 35px;
    /* Adjusted to match typical macOS spacing */
    left: 38px;
    gap: 8px;
    z-index: 20;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: transparent;
    cursor: default;
}

.control.close {
    cursor: pointer;
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-title {
    font-size: 0.75rem;
    color: #888;
    font-weight: 600;
    padding-left: 10px;
    margin-bottom: 5px;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    border-radius: 5px;
}

.sidebar-list li.active {
    background-color: rgba(255, 255, 255, 0.15);
}

.sidebar-list li a,
.sidebar-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    margin-right: 15px;
    /* Prevent overlap with scrollbar/separator */
    color: #ddd;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.1s;
    cursor: pointer;
}

.sidebar-list li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.sidebar-list img {
    width: 16px;
    height: 16px;
    opacity: 0.9;
}

/* Main Content */
.finder-content {
    flex: 1;
    background: transparent;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    /* Align with top bar */
    padding-right: 15px;
    /* Avoid overlaying right edge */
}

/* Toolbar */
.finder-toolbar {
    height: 40px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 20px 0 10px;
    margin-top: 5px;
    position: relative;
    /* Context for absolute positioning */
}

/* ... nav-controls ... */

.path-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #e0e0e0;
    position: absolute;
    /* Force position regardless of flex */
    left: 90px;
    /* 70px nav + 10px padding + 10px gap */
    text-align: left;
}

.nav-controls {
    display: flex;
    gap: 0;
    background-image: url('assets/svg/fondback.svg');
    background-size: 100% 100%;
    /* Force fill */
    background-repeat: no-repeat;
    background-position: center;
    width: 70px;
    /* Larger container */
    height: 36px;
    /* Larger container */
    align-items: center;
    justify-content: center;
    /* Center buttons relative to container */
    padding: 0;
    margin-left: 0;
    /* Removing extra margin to get as close as possible */
}

.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    /* opacity: 1; Remove opacity as SVGs have distinct colors */
    transition: opacity 0.2s;
    width: 34px;
    /* Half of container roughly */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.nav-btn:hover {
    opacity: 0.8;
}

.nav-btn.disabled {
    opacity: 1;
    /* SVG is already gray */
    cursor: default;
}

.nav-btn img {
    width: 16px;
    /* significantly larger icons */
    height: auto;
    display: block;
    margin-top: 1px;
    /* Optical center adjustment */
}

/* .path-title is now handled in the previous block or needs to be cleaned here if separate */
/* Redundant block removal or adjustment if needed */

/* Hide HTML view controls since SVG has them */
.view-controls {
    opacity: 0;
    pointer-events: none;
    width: 80px;
    margin-left: auto;
    /* Push to right if needed, though invisible */
}

.view-controls .hud-icon {
    width: 20px;
    opacity: 0.7;
}

/* Grid */
/* Grid */
.finder-grid {
    padding: 20px 40px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    /* Center vertically */
    gap: 40px;
    overflow-y: auto;
    height: 100%;
    margin-top: 0;
    max-width: 650px;
    /* Limit width to ensure 3 per row (3 * ~160px + gaps) */
    margin-left: auto;
    margin-right: auto;
}

.finder-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    text-align: center;
    padding: 15px;
    border-radius: 5px;
    transition: background 0.2s;
    height: auto;
    width: 160px;
    /* Fixed width for better alignment */
    max-height: max-content;
}

/* ... existing hover/active styles ... */
.finder-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.finder-item:active {
    background-color: #0A60FF;
}

.folder-icon-blue {
    width: 90px;
    height: 90px;
}

.item-name {
    font-size: 1rem;
    color: white;
    font-weight: 500;
    max-width: 100%;
    /* Use full width of container */
    word-wrap: break-word;
    line-height: 1.3;
}

/* Responsive */
@media (max-width: 768px) {
    .finder-window {
        width: 100%;
        height: 100%;
        border-radius: 0;
        background-image: none;
        background-color: #1e1e1e;
        aspect-ratio: auto;
    }

    .finder-sidebar {
        display: none;
    }

    .finder-grid {
        padding: 20px;
    }

    .window-controls {
        display: none;
    }
}

/* Project Viewer Styles */
.project-viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 20px 40px;
    animation: fadeIn 0.3s ease;
    min-width: 0;
    /* Important for nested flex scroll */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#project-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

#project-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

.project-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    /* Space for scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    min-width: 0;
    /* Important for nested flex scroll */
}

.project-body::-webkit-scrollbar {
    width: 6px;
}

.project-body::-webkit-scrollbar-track {
    background: transparent;
}

.project-body::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.project-section {
    margin-bottom: 30px;
}

.project-section h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--accent-blue);
}

.project-section p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #e0e0e0;
}

.project-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
}

.meta-item h4 {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 3px;
}

.meta-item p {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
    /* Removed black background */
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease-in-out;
    width: 100%;
}

.carousel-slide {
    min-width: 100%;
    display: flex;
    gap: 40px;
    /* Increased gap */
    padding: 20px 60px;
    /* Reduced vertical padding */
    align-items: center;
}

.slide-video {
    flex: 1.2;
    min-width: 0;
    /* Reduced flex to make video smaller */
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    order: 1;
    /* Video back to left */
}

.slide-video iframe,
.slide-video img {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
    display: block;
}

.slide-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    order: 2;
    /* Info back to right */
    text-align: left;
    /* Text back to left */
}

.slide-info h4 {
    color: var(--accent-blue);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.slide-info p {
    font-size: 0.95rem;
    color: #e0e0e0;
    line-height: 1.5;
}


.project-section {
    margin-bottom: 40px;
    min-width: 0;
    /* Important for nested flex scroll */
}

/* Horizontal Gallery */
/* Separator Style */
.section-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    /* Increased opacity */
    margin: 40px auto;
    width: 100%;
    display: block;
    /* Ensure it takes up space */
}

/* Artwork Grid (Spotify Style) */
.artwork-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    padding-bottom: 20px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 10px;
    transition: transform 0.2s ease, background 0.2s ease;
    /* Removed fixed width */
}

.gallery-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 1/1;
    /* Square images */
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.gallery-info h4 {
    font-size: 1rem;
    color: var(--accent-blue);
    margin-bottom: 4px;
}

.gallery-info p {
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.4;
}

.slide-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    justify-content: flex-start;
    /* Tags back to left */
}

.slide-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #fff;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.9);
}

.carousel-prev {
    left: 10px;
}



.carousel-next {
    right: 10px;
}

/* Image Modal aka Lightbox */
.modal {
    position: fixed;
    z-index: 2000;
    /* High z-index to overlay Finder */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0
    }

    to {
        transform: scale(1);
        opacity: 1
    }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Make images clickable */
.gallery-item img {
    cursor: pointer;
}

/* About Window Styles */
.about-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    background-color: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 1500;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

.about-header {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    /* Context for absolute controls */
    height: 40px;
}

/* Explicit colors for About Window controls (since no SVG background) */
.about-window .control.close {
    background-color: #ff5f56;
}

.about-window .control.minimize {
    background-color: #ffbd2e;
}

.about-window .control.maximize {
    background-color: #27c93f;
}

/* Override positioning for About Window */
.about-window .window-controls {
    top: 14px;
    /* Center partially in 40px header */
    left: 15px;
}

.about-title {
    margin-left: auto;
    margin-right: auto;
    font-size: 0.9rem;
    color: #ccc;
    font-weight: 500;
}

.about-content {
    padding: 30px;
    text-align: left;
    color: white;
}

.about-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    object-fit: cover;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.about-content h2 {
    font-size: 1.4rem;
    margin-bottom: 5px;
    text-align: center;
}

.about-role {
    color: var(--accent-blue);
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 500;
    text-align: center;
}

.about-desc {
    font-size: 0.9rem;
    color: #bbb;
    line-height: 1.5;
    margin-bottom: 25px;
}

.about-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.about-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.about-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}