/* ============================================
   JULIETTE DAVIS PORTFOLIO
   Minimal Archive Interface Style
   ============================================ */

/* CSS Variables */
:root {
    --bg-color: #ffffff;
    --text-color: #111111;
}

/* ============================================
   CSS RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #ffffff;
}

body {
    font-family: "cofo-sans-variable", sans-serif;
    font-variation-settings: "wght" 300;
    font-weight: 300;
    background-color: #ffffff;
    color: #111111;
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
}

main {
    background-color: #ffffff;
    transition: background-color 0.4s ease;
}

/* ============================================
   TYPOGRAPHY - INCREASED SIZES
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
    font-variation-settings: "wght" 300;
}

a {
    color: #111111;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.6;
}

p {
    font-size: 0.95rem;
    line-height: 1.6;
}

em {
    font-style: italic;
}

/* ============================================
   HORIZONTAL RULES
   ============================================ */
.rule {
    display: none;
}

/* ============================================
   MAIN CONTAINER - TWO COLUMN LAYOUT
   ============================================ */
.main-container {
    display: grid;
    grid-template-columns: 42% 58%;
    min-height: 100vh;
}

/* ============================================
   LEFT COLUMN - INDEX / NAVIGATION
   ============================================ */
.left-column {
    padding: 1.5rem 2rem;
    border-right: 1px solid var(--text-color, #111111);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

/* Header Row - Identity + Nav */
.header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Identity Block */
.identity-block {
    min-width: fit-content;
}

.name {
    font-size: 0.95rem;
    font-weight: 300;
    margin-bottom: 0.2rem;
    letter-spacing: 0.01em;
}

.email {
    font-size: 0.85rem;
    color: #111111;
    opacity: 0.7;
}

/* Navigation Links - Equally Spaced */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav-link {
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    opacity: 0.8;
}

.nav-link:focus {
    outline: none;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.nav-link.active {
    opacity: 1;
}

.nav-link:hover {
    opacity: 0.6;
}

/* Social Link (Instagram) */
.nav-link.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link.social-link svg {
    width: 15px;
    height: 15px;
}

/* Practice Description */
.practice-description {
    font-size: 0.9rem;
    line-height: 1.65;
    opacity: 0.7;
    max-width: 100%;
    margin-bottom: 2.5rem;
    padding-left: 0;
}

/* ============================================
   PROJECT LIST TABLE
   ============================================ */
.project-list {
    flex: 1;
    overflow: hidden;
}

.project-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.9rem;
    background-color: transparent;
}

/* Header row */
.project-table thead th {
    font-weight: 300;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    opacity: 0.6;
    border-bottom: none;
    background-color: transparent;
}

/* Column 1: Index - left aligned */
.project-table th:nth-child(1),
.project-table td:nth-child(1) {
    text-align: left;
}

/* Column 2: Project name - left aligned */
.project-table th:nth-child(2),
.project-table td:nth-child(2) {
    text-align: left;
}

/* Column 3: Year - left aligned */
.project-table th:nth-child(3),
.project-table td:nth-child(3) {
    text-align: left;
}

/* Body rows */
.project-table tbody tr {
    border-bottom: 1px solid var(--text-color, #111111);
    cursor: pointer;
    background-color: transparent;
}

/* First row gets top border */
.project-table tbody tr:first-child {
    border-top: 1px solid var(--text-color, #111111);
}

/* All cells */
.project-table td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    vertical-align: middle;
    background-color: transparent;
}

/* Index numbers */
.project-table td:nth-child(1) {
    font-size: 0.9rem;
    opacity: 0.7;
    letter-spacing: 0.02em;
}

/* Project names */
.project-table td:nth-child(2) {
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

/* Year dates */
.project-table td:nth-child(3) {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Archive Table Specific */
.archive-table {
    margin-top: 0;
}

.archive-table td.index {
    font-size: 0.75rem;
    text-transform: uppercase;
}

.archive-table td.project-name {
    font-size: 0.85rem;
    opacity: 0.5;
}

.archive-table .sub-index {
    font-size: 0.6rem;
    opacity: 0.4;
}

/* ============================================
   FOOTER - LEFT COLUMN
   ============================================ */
.footer-left {
    margin-top: auto;
    padding-top: 2rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.timestamp {
    font-size: 0.8rem;
    opacity: 0.4;
    font-variant-numeric: tabular-nums;
}

.email-footer {
    font-size: 0.85rem;
    opacity: 0.5;
}

/* Color Picker */
.color-picker-wrapper {
    position: relative;
    z-index: 1000;
}

.color-picker-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--text-color, #111111);
    background: var(--bg-color, #ffffff);
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-picker-btn:hover {
    transform: scale(1.15);
}

.color-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* Custom Color Picker Modal */
.custom-color-picker {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 220px;
    background: var(--bg-color, #ffffff);
    border: 1px solid var(--text-color, #111111);
    padding: 12px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.custom-color-picker.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.color-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.6;
}

.color-picker-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color, #111111);
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

.color-picker-close:hover {
    opacity: 1;
}

.color-gradient {
    width: 100%;
    height: 120px;
    position: relative;
    cursor: crosshair;
    margin-bottom: 10px;
    border: 1px solid var(--text-color, #111111);
    opacity: 0.9;
}

.gradient-cursor {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
}

.hue-slider-wrapper {
    margin-bottom: 10px;
}

.hue-slider {
    width: 100%;
    height: 12px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, 
        #ff0000 0%, #ffff00 17%, #00ff00 33%, 
        #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%
    );
    border: 1px solid var(--text-color, #111111);
    cursor: pointer;
    border-radius: 0;
}

.hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 4px;
    height: 16px;
    background: var(--text-color, #111111);
    cursor: pointer;
    border: none;
}

.hue-slider::-moz-range-thumb {
    width: 4px;
    height: 16px;
    background: var(--text-color, #111111);
    cursor: pointer;
    border: none;
    border-radius: 0;
}

.color-picker-footer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-color-display {
    width: 24px;
    height: 24px;
    border: 1px solid var(--text-color, #111111);
    background: #ffffff;
}

.current-color-hex {
    font-size: 0.75rem;
    font-family: monospace;
    letter-spacing: 0.02em;
    opacity: 0.7;
}

/* ============================================
   RIGHT COLUMN - PREVIEW AREA
   ============================================ */
.right-column {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    height: 100vh;
}

/* ============================================
   PREVIEW PANEL
   ============================================ */
.preview-panel {
    margin-bottom: 3.5rem;
    padding-bottom: 2rem;
}

/* Preview Header Bar */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    opacity: 0.7;
    border-bottom: 1px solid var(--text-color, #111111);
    margin-bottom: 0;
}

.header-left,
.header-center,
.header-right {
    flex: 1;
}

.header-left {
    text-align: left;
    font-weight: 400;
}

.header-center {
    text-align: center;
}

.header-right {
    text-align: right;
}

/* ============================================
   IMAGE FRAME
   ============================================ */
.image-frame {
    position: relative;
    background-color: #2a2a2a;
    margin: 0;
    overflow: hidden;
}

.image-frame.large {
    aspect-ratio: 16 / 9;
    min-height: 400px;
}

.image-frame.small {
    aspect-ratio: 1 / 1;
    min-height: 220px;
}

/* Project Images */
.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Corner Crop Marks */
.crop-mark {
    position: absolute;
    font-size: 1.5rem;
    color: #888888;
    font-weight: 200;
    line-height: 1;
    user-select: none;
    z-index: 10;
}

.crop-mark.top-left {
    top: 20px;
    left: 20px;
}

.crop-mark.top-right {
    top: 20px;
    right: 20px;
}

.crop-mark.bottom-left {
    bottom: 20px;
    left: 20px;
}

.crop-mark.bottom-right {
    bottom: 20px;
    right: 20px;
}

/* Expand Button Styling */
.expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    font-weight: 200;
    padding: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.expand-btn:hover {
    color: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

.expandable {
    cursor: pointer;
}

/* Expanded state - rotate + to x */
.image-frame[data-expanded="true"] .expand-btn {
    transform: rotate(45deg);
    color: rgba(255, 255, 255, 0.9);
}

/* Placeholder Content (when no image) */
.placeholder-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666666;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.placeholder-content span {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    line-height: 1.5;
    opacity: 0.7;
}

.placeholder-icon {
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

.placeholder-icon svg {
    stroke: #888888;
}

.placeholder-icon.small svg {
    width: 24px;
    height: 24px;
}

/* Image Caption */
.image-caption {
    font-size: 0.85rem;
    opacity: 0.5;
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
}

/* ============================================
   EXPANDED GALLERY
   ============================================ */
.expanded-gallery {
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

/* Full-width gallery images */
.expanded-gallery .image-frame.gallery-image {
    margin-bottom: 1rem;
}

.expanded-gallery .image-frame.gallery-image:last-child {
    margin-bottom: 0;
}

/* Lemur Loom - Show full images without cropping */
.lemur-image {
    aspect-ratio: auto !important;
    min-height: unset !important;
}

.lemur-image .project-image {
    object-fit: contain;
    width: 100%;
    height: auto;
}

/* Fit-full - Show full images without cropping, auto height */
.fit-full {
    aspect-ratio: auto !important;
    min-height: unset !important;
    height: auto !important;
}

.fit-full .project-image {
    object-fit: contain;
    width: 100%;
    height: auto;
}

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

/* ============================================
   TWO COLUMN IMAGE GRID
   ============================================ */
.image-grid.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0 0 1rem 0;
}

.image-frame-wrapper {
    display: flex;
    flex-direction: column;
}

.frame-caption {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0.5;
}

/* ============================================
   LOWER CONTENT REGION
   ============================================ */
.lower-content {
    display: flex;
    gap: 0;
    margin-top: 1.5rem;
    padding-top: 0;
    align-items: stretch;
}

.metadata {
    font-size: 0.85rem;
    line-height: 1.9;
    flex: 0 0 auto;
    padding-right: 1.5rem;
}

.metadata p {
    font-size: 0.85rem;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.metadata .check {
    font-size: 0.7rem;
    opacity: 0.6;
}

.metadata em {
    font-style: italic;
    opacity: 0.8;
}

/* Vertical divider between metadata and description */
.lower-content::after {
    content: '';
    display: none; /* Using border on description instead */
}

.description {
    font-size: 0.95rem;
    line-height: 1.7;
    flex: 1;
    padding-left: 1.5rem;
    border-left: 1px solid var(--text-color, #111111);
}

.description p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.description p:last-child {
    margin-bottom: 0;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media screen and (max-width: 1024px) {
    .main-container {
        grid-template-columns: 38% 62%;
    }
    
    .left-column,
    .right-column {
        padding: 1.5rem;
    }
    
    .header-row {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1.25rem;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media screen and (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .left-column {
        border-right: none;
        border-bottom: 1px solid var(--text-color, #111111);
        position: relative;
        height: auto;
        max-height: none;
    }

    .right-column {
        height: auto;
        padding-top: 2rem;
    }

    .header-row {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        margin-left: 0;
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    /* Center images on mobile */
    .preview-panel {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .preview-header {
        width: 100%;
    }

    .image-frame {
        width: 100%;
        max-width: 100%;
    }

    .image-frame.large {
        min-height: 250px;
        aspect-ratio: 4 / 3;
    }

    .image-frame.small {
        min-height: 200px;
    }

    .lower-content {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .expanded-gallery {
        width: 100%;
    }

    .image-grid.two-column {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .image-frame-wrapper {
        width: 100%;
    }

    .description {
        border-left: none;
        border-top: 1px solid var(--text-color, #111111);
        padding-left: 0;
        padding-top: 1rem;
    }

    .metadata {
        padding-right: 0;
    }

    .footer-left {
        flex-direction: row;
        justify-content: space-between;
    }

    /* Hide elements not needed on mobile */
    .preview-thumbnail,
    .tracking-box,
    .pixel-coords {
        display: none !important;
    }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE
   ============================================ */
@media screen and (max-width: 480px) {
    .left-column,
    .right-column {
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.8rem;
    }

    .project-table td.project-name,
    .archive-table td.project-name {
        font-size: 0.85rem;
    }

    .image-frame.large {
        min-height: 220px;
    }

    .image-frame.small {
        min-height: 180px;
    }

    .crop-mark,
    .expand-btn {
        font-size: 1.25rem;
    }

    .crop-mark.top-left,
    .crop-mark.bottom-left,
    .expand-btn.top-left,
    .expand-btn.bottom-left {
        left: 12px;
    }

    .crop-mark.top-right,
    .crop-mark.bottom-right,
    .expand-btn.top-right,
    .expand-btn.bottom-right {
        right: 12px;
    }

    .crop-mark.top-left,
    .crop-mark.top-right,
    .expand-btn.top-left,
    .expand-btn.top-right {
        top: 12px;
    }

    .crop-mark.bottom-left,
    .crop-mark.bottom-right,
    .expand-btn.bottom-left,
    .expand-btn.bottom-right {
        bottom: 12px;
    }

    .preview-header {
        font-size: 0.8rem;
    }

    .metadata p,
    .description p {
        font-size: 0.85rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Selection highlight */
::selection {
    background-color: #111111;
    color: #ffffff;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
tr:focus {
    outline: 1px solid #111111;
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Scrollbar styling for columns */
.right-column::-webkit-scrollbar,
.left-column::-webkit-scrollbar {
    width: 6px;
}

.right-column::-webkit-scrollbar-track,
.left-column::-webkit-scrollbar-track {
    background: transparent;
}

.right-column::-webkit-scrollbar-thumb,
.left-column::-webkit-scrollbar-thumb {
    background: #cccccc;
}

.right-column::-webkit-scrollbar-thumb:hover,
.left-column::-webkit-scrollbar-thumb:hover {
    background: #999999;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--text-color, #111111);
    width: 0%;
    z-index: 1000;
    transition: width 0.1s ease-out;
}

/* ============================================
   PAGE LOAD ANIMATION
   ============================================ */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-h,
.loader-v {
    position: absolute;
    background: #111111;
}

.loader-h {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    transform: scaleX(1);
    animation: shrinkH 0.8s cubic-bezier(0.76, 0, 0.24, 1) 0.3s forwards;
}

.loader-v {
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    transform: scaleY(1);
    animation: shrinkV 0.8s cubic-bezier(0.76, 0, 0.24, 1) 0.3s forwards;
}

@keyframes shrinkH {
    from { transform: scaleX(1); opacity: 1; }
    to { transform: scaleX(0); opacity: 0; }
}

@keyframes shrinkV {
    from { transform: scaleY(1); opacity: 1; }
    to { transform: scaleY(0); opacity: 0; }
}

/* Hide loader completely after animation */
.loader-h,
.loader-v {
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Content reveal animation */
body {
    opacity: 0;
    animation: fadeInBody 0.5s ease 0.6s forwards;
}

@keyframes fadeInBody {
    to { opacity: 1; }
}

/* ============================================
   PIXEL COORDINATES
   ============================================ */
.pixel-coords {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-family: monospace;
    opacity: 0.4;
    letter-spacing: 0.05em;
}

.coord-label {
    opacity: 0.6;
}

.coord-x,
.coord-y {
    font-variant-numeric: tabular-nums;
}

/* ============================================
   HOVER TRACKING BOX
   ============================================ */
.tracking-box {
    display: none;
}

.tracking-box.active {
    opacity: 1;
}

.tracking-data {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.data-line {
    font-size: 0.6rem;
    font-family: monospace;
    letter-spacing: 0.05em;
    opacity: 0.7;
    animation: dataFlicker 0.1s infinite;
}

.data-line:nth-child(2) {
    animation-delay: 0.05s;
}

.data-line:nth-child(3) {
    animation-delay: 0.1s;
}

@keyframes dataFlicker {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.4; }
}

/* ============================================
   PROJECT PREVIEW THUMBNAIL
   ============================================ */
.preview-thumbnail {
    position: fixed;
    width: 180px;
    height: 120px;
    pointer-events: none;
    opacity: 0;
    z-index: 501;
    transition: opacity 0.25s ease;
    overflow: hidden;
    border: 1px solid var(--text-color, #111111);
    background-color: var(--bg-color, #ffffff);
}

.preview-thumbnail.active {
    opacity: 1;
}

.preview-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   ABOUT POPUP
   ============================================ */
.about-popup {
    position: fixed;
    left: 34px;
    top: 560px;
    width: 640px;
    max-width: calc(100vw - 80px);
    background: var(--bg-color, #ffffff);
    color: var(--text-color, #111111);
    padding: 1.5rem;
    z-index: 800;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    font-size: 0.9rem;
    line-height: 1.7;
    border: 1px solid var(--text-color, #111111);
}

.about-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.about-popup p {
    margin-bottom: 1rem;
}

.about-popup p:last-child {
    margin-bottom: 0;
}

/* About popup mobile positioning */
@media screen and (max-width: 768px) {
    .about-popup {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) scale(0.95);
        width: calc(100vw - 2rem);
        max-width: 400px;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }

    .about-popup.active {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ============================================
   DARK MODE TOGGLE
   ============================================ */
.dark-mode-toggle {
    width: 28px;
    height: 28px;
    border: 1px solid var(--text-color, #111111);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    margin-left: 0.5rem;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    background: #111111;
    color: #ffffff;
}

.dark-mode-toggle:hover svg {
    stroke: #ffffff;
}

.dark-mode-toggle .icon-moon {
    display: none;
}

.dark-mode-toggle .icon-sun {
    display: block;
}

/* ============================================
   ACTIVE PROJECT INDICATOR
   ============================================ */
/* Removed dot indicator for cleaner table */

/* ============================================
   IMAGE TRANSITION EFFECTS (Stagger on expand)
   ============================================ */
.expanded-gallery .image-frame,
.expanded-gallery .image-frame-wrapper {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerFadeIn 0.4s ease forwards;
}

.expanded-gallery .image-frame:nth-child(1),
.expanded-gallery .image-grid:nth-child(1) .image-frame-wrapper:nth-child(1) { animation-delay: 0s; }
.expanded-gallery .image-frame:nth-child(2),
.expanded-gallery .image-grid:nth-child(1) .image-frame-wrapper:nth-child(2) { animation-delay: 0.08s; }
.expanded-gallery .image-frame:nth-child(3),
.expanded-gallery .image-grid:nth-child(2) .image-frame-wrapper:nth-child(1) { animation-delay: 0.16s; }
.expanded-gallery .image-frame:nth-child(4),
.expanded-gallery .image-grid:nth-child(2) .image-frame-wrapper:nth-child(2) { animation-delay: 0.24s; }
.expanded-gallery .image-frame:nth-child(5),
.expanded-gallery .image-grid:nth-child(3) .image-frame-wrapper:nth-child(1) { animation-delay: 0.32s; }
.expanded-gallery .image-frame:nth-child(6),
.expanded-gallery .image-grid:nth-child(3) .image-frame-wrapper:nth-child(2) { animation-delay: 0.4s; }
.expanded-gallery .image-frame:nth-child(7) { animation-delay: 0.48s; }
.expanded-gallery .image-frame:nth-child(8) { animation-delay: 0.56s; }

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

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox.active .lightbox-image {
    opacity: 1;
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding: 1rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 0.85rem;
    opacity: 0.7;
    letter-spacing: 0.1em;
}

/* ============================================
   DARK MODE
   ============================================ */
body.dark-mode {
    background-color: #111111;
    color: #ffffff;
}

body.dark-mode .left-column {
    border-right-color: #333333;
}

body.dark-mode a {
    color: #ffffff;
}

body.dark-mode .rule {
    border-top-color: #333333;
}

body.dark-mode .project-table thead th {
    border-bottom-color: #333333;
}

body.dark-mode .project-table tbody tr,
body.dark-mode .archive-table tbody tr {
    border-bottom-color: #333333;
}

body.dark-mode .project-table tbody tr:hover,
body.dark-mode .archive-table tbody tr:hover {
    background-color: #1a1a1a;
}

body.dark-mode .project-table tbody tr.active {
    background-color: #222222;
}

body.dark-mode .preview-header {
    border-bottom-color: #333333;
}

body.dark-mode .image-frame {
    background-color: #2a2a2a;
}

body.dark-mode .lower-content {
    border-color: #333333;
}

body.dark-mode .dark-mode-toggle {
    border-color: #ffffff;
}

body.dark-mode .dark-mode-toggle:hover {
    background: #ffffff;
}

body.dark-mode .dark-mode-toggle:hover svg {
    stroke: #111111;
}

body.dark-mode .dark-mode-toggle .icon-sun {
    display: none;
}

body.dark-mode .dark-mode-toggle .icon-moon {
    display: block;
}

body.dark-mode .progress-bar {
    background: #ffffff;
}

body.dark-mode ::selection {
    background-color: #ffffff;
    color: #111111;
}

body.dark-mode .right-column::-webkit-scrollbar-thumb,
body.dark-mode .left-column::-webkit-scrollbar-thumb {
    background: #444444;
}

body.dark-mode .right-column::-webkit-scrollbar-thumb:hover,
body.dark-mode .left-column::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

/* Dark mode - page loader */
body.dark-mode .loader-h,
body.dark-mode .loader-v {
    background: #ffffff;
}

/* Dark mode - tracking box */
body.dark-mode .tracking-box {
    background: #111111;
    border-color: #ffffff;
}

/* Dark mode - preview thumbnail */
body.dark-mode .preview-thumbnail {
    border-color: #ffffff;
}

/* Dark mode - about popup */
body.dark-mode .about-popup {
    background: #111111;
}

/* ============================================
   KEYBOARD NAVIGATION FOCUS STYLES
   ============================================ */
.project-row:focus {
    outline: none;
    background-color: transparent;
}

body.dark-mode .project-row:focus {
    background-color: transparent;
}

/* Project images - cursor styles */
.expandable .project-image {
    cursor: pointer;
}

.expanded-gallery .project-image {
    cursor: zoom-in;
}
