* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* CMYK Color Palette */
    --cyan: #00FFFF;
    --magenta: #FF00FF;
    --yellow: #FFFF00;
    --key: #000000;
    --key-light: #1a1a1a;
    --key-lighter: #333333;
    --white: #FFFFFF;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--key);
    color: var(--white);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Prevent scrolling when dragging on Windows touch */
body.dragging-active {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100vh !important;
}

/* Particle Background */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    animation: float-particle 20s infinite linear;
}

/* AI Processing Indicator */
.ai-processing-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 12px;
    z-index: 100;
}

.ai-processing-indicator .processing-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

.ai-processing-indicator p {
    color: #fff;
    font-size: 16px;
    margin: 0;
    font-family: 'Space Mono', monospace;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.particle:nth-child(3n) {
    background: var(--cyan);
    box-shadow: 0 0 6px var(--cyan);
}

.particle:nth-child(3n+1) {
    background: var(--magenta);
    box-shadow: 0 0 6px var(--magenta);
}

.particle:nth-child(3n+2) {
    background: var(--yellow);
    box-shadow: 0 0 6px var(--yellow);
}

@keyframes float-particle {
    from {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    to {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* CMYK Start Screen */
.cmyk-start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: var(--key);
    overflow: hidden;
    padding: 40px;
    opacity: 1;
    transition: opacity 1s ease-out;
}

.cmyk-logo-top {
    margin-top: 40px;
    opacity: 0.9;
    animation: logoFloat 4s ease-in-out infinite;
}

.cmyk-logo-image {
    width: 300px;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.cmyk-stage-container {
    position: relative;
    width: 1474px;  /* Increased to 125% (1179 * 1.25) */
    height: 3195px; /* Increased to 125% (2556 * 1.25) */
    max-width: 95vw;  /* Slightly increased to accommodate larger size */
    max-height: 90vh; /* Slightly increased to accommodate larger size */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.5);
    aspect-ratio: 1179 / 2556;
    transform: scale(1.1); /* Apply 125% scale transform */
}

.cmyk-color-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.cmyk-color-box[data-color="cyan"] {
    background: var(--cyan);
    animation: cmykCycle 10s infinite;
    animation-delay: 0s;
}

.cmyk-color-box[data-color="magenta"] {
    background: var(--magenta);
    animation: cmykCycle 10s infinite;
    animation-delay: 2s;
}

.cmyk-color-box[data-color="yellow"] {
    background: var(--yellow);
    animation: cmykCycle 10s infinite;
    animation-delay: 4s;
}

.cmyk-color-box[data-color="key"] {
    background: var(--key);
    animation: cmykCycle 10s infinite;
    animation-delay: 6s;
}

.cmyk-color-box[data-color="base-image"] {
    animation: cmykCycle 10s infinite;
    animation-delay: 8s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cmyk-base-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes cmykCycle {
    0%, 100% { opacity: 0; }
    10%, 30% { opacity: 1; }
    40% { opacity: 0; }
}

.cmyk-start-button {
    position: absolute;
    bottom: 45%;
    left: 50%;
    transform: translateX(-50%);
    padding: 30px 80px;
    font-size: 34px;  
    font-weight: 300;
    letter-spacing: 4px;
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.4s ease;
    overflow: hidden;
    text-transform: uppercase;
}

.cmyk-start-button:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.start-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.start-text {
    position: relative;
    z-index: 1;
    animation: textGlow 3s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% { 
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }
    50% { 
        text-shadow: 0 0 20px rgba(0, 255, 255, 0.8),
                     0 0 30px rgba(255, 0, 255, 0.6),
                     0 0 40px rgba(255, 255, 0, 0.4);
    }
}

/* Exhibition Container */
.exhibition-container {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, var(--key) 0%, var(--key-light) 100%);
}

/* Header */
.exhibition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 50px;
    background: var(--key);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 110;
    border-bottom: 4px solid var(--cyan);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 15px 20px;
}

.logo-image {
    width: auto;
    max-width: 50vw;
    max-height: 120px;
    height: auto;
    object-fit: contain;
}

/* Hamburger Menu Styles */
.hamburger-menu {
    position: relative;
    width: 60px;
    z-index: 1000;
}

.header-spacer {
    width: 60px;
}

.hamburger-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1001;
}

.hamburger-btn:hover {
    transform: scale(1.1);
}

.hamburger-line {
    width: 25px;
    height: 2px;
    background-color: var(--cyan);
    transition: all 0.3s ease;
    pointer-events: none;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.hamburger-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: rgba(0, 0, 0, 0.98);
    border: 2px solid var(--cyan);
    border-radius: 8px;
    padding: 15px;
    min-width: 200px;
    display: none;
    z-index: 999;
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.3);
}

.hamburger-nav.active {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hamburger-nav .nav-btn {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.hamburger-nav .nav-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    transform: translateX(5px);
}

.hamburger-nav .nav-btn.active {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--cyan);
}

.logo-text {
    color: var(--cyan);
    text-transform: uppercase;
}

.logo-accent {
    color: var(--magenta);
    font-weight: 300;
    text-transform: uppercase;
}

.exhibition-nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    border: 2px solid var(--yellow);
    color: var(--white);
    padding: 10px 20px;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-weight: 600;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--yellow);
    transition: left 0.4s ease;
    z-index: -1;
}

.nav-btn:hover::before {
    left: 0;
}

.nav-btn:hover {
    color: var(--key);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--key);
}

/* Drop Overlay */
.drop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--key);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.drop-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.drop-content {
    text-align: center;
}

.drop-icon {
    width: 150px;
    height: 150px;
    margin: 0 auto 30px;
    color: var(--magenta);
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

.drop-title {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: var(--white);
    text-transform: uppercase;
}

.drop-subtitle {
    color: var(--cyan);
    font-size: 14px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Carousel Section */
.carousel-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start; /* Left align instead of center */
    padding: 120px 0 200px 15%; /* Bottom padding to account for collection box space */
    background: var(--key);
    z-index: 1;
}

.carousel-container {
    width: 60vw;  /* Match interactive mode */
    max-width: 900px;
    height: calc(85vh - 200px);  /* Match interactive image area (minus collection boxes) */
    position: relative;
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0; /* Left align instead of center */
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-item {
    position: absolute;
    width: 100%;  /* Full container width to match interactive */
    height: 100%;  /* Full container height */
    left: 0;  /* No offset needed */
    top: 50%;
    transform-origin: left center;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 3px solid var(--key);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: block;
}

.carousel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 255, 255, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.carousel-item:hover::before {
    opacity: 1;
}

.carousel-item.active {
    z-index: 10;
    transform: translate(0, -50%) scale(1);  /* Left aligned, vertically centered */
    opacity: 1;
}

.carousel-item.active img {
    border-color: var(--key);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
}

.carousel-item.prev {
    transform: translate(-65%, -50%) rotateY(25deg) scale(0.8);  /* Adjusted positioning */
    opacity: 0.7;
    filter: saturate(0.5);
}

.carousel-item.next {
    transform: translate(65%, -50%) rotateY(-25deg) scale(0.8);  /* Adjusted positioning */
    opacity: 0.7;
    filter: saturate(0.5);
}

.carousel-item:not(.active):not(.prev):not(.next) {
    display: none;  /* Hide non-visible items */
}

.carousel-item.far-prev {
    transform: translate(-130%, -50%) rotateY(50deg) scale(0.6);
    opacity: 0.4;
    filter: saturate(0.3);
}

.carousel-item.far-next {
    transform: translate(130%, -50%) rotateY(-50deg) scale(0.6);
    opacity: 0.4;
    filter: saturate(0.3);
}

.carousel-item.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Carousel Controls - Positioned to match image width */
.carousel-controls {
    position: absolute;
    top: calc(50% - 100px); /* Adjust for collection box space offset */
    left: calc(15% + 30vw); /* Position relative to left-aligned carousel */
    transform: translate(-50%, -50%);
    width: calc(60vw + 100px); /* Match new carousel width */
    max-width: calc(900px + 100px);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 105;
}

.carousel-btn {
    position: relative;
    width: 50px;
    height: 80px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    opacity: 0.7;
    backdrop-filter: blur(5px);
}

.carousel-btn:hover {
    background: rgba(0, 255, 255, 0.8);
    opacity: 1;
    transform: scale(1.05);
}

.carousel-btn.prev {
    border-radius: 0 8px 8px 0;
}

.carousel-btn.next {
    border-radius: 8px 0 0 8px;
}

.carousel-btn svg {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Progress Bar */
.progress-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 6px;
    background: var(--key-lighter);
    border: 2px solid var(--key);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan) 0%, var(--magenta) 50%, var(--yellow) 100%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

/* Classification Display */
.classification-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: var(--key-light);
    border: 4px solid var(--cyan);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    box-shadow: 0 0 0 8px var(--cyan), 0 0 0 12px var(--magenta), 0 0 0 16px var(--yellow);
}

.classification-display.active {
    display: flex;
    animation: scan-in 0.5s ease;
}

@keyframes scan-in {
    from {
        transform: translate(-50%, -50%) scale(0.8) rotate(-5deg);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

.classification-content {
    text-align: center;
    position: relative;
}

.scanning-animation {
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--magenta), transparent);
    animation: scan 2s infinite;
}

@keyframes scan {
    0%, 100% {
        top: 0;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
    }
}

.scan-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(0deg, var(--cyan) 1px, transparent 1px),
        linear-gradient(90deg, var(--cyan) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.2;
    animation: grid-move 10s infinite linear;
}

@keyframes grid-move {
    from {
        transform: translate(0, 0);
    }
    to {
        transform: translate(20px, 20px);
    }
}

.classification-title {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 30px;
    color: var(--white);
}

.classification-result {
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    animation: fadeInUp 0.5s ease 2s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-type {
    font-size: 36px;
    font-weight: 900;
    color: var(--magenta);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.result-confidence {
    font-size: 14px;
    color: var(--cyan);
    letter-spacing: 2px;
    font-weight: 600;
}

/* Info Panel */
.info-panel {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 250px;
    z-index: 10;
}

.info-card {
    background: var(--key);
    border: 3px solid var(--yellow);
    padding: 30px;
    margin-bottom: 20px;
}

.info-title {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: var(--yellow);
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-size: 11px;
    color: var(--cyan);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
}

.info-value {
    font-size: 18px;
    font-weight: 900;
    color: var(--magenta);
}

/* Collection Stats */
.collection-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--key-light);
    padding: 20px;
    border: 3px solid var(--cyan);
}

.stat-item {
    position: relative;
}

.stat-bar {
    width: 100%;
    height: 8px;
    background: var(--key-lighter);
    margin-bottom: 8px;
    overflow: hidden;
    border: 2px solid var(--cyan);
}

.stat-fill {
    height: 100%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-item[data-collection="TYPE1"] .stat-fill {
    background: var(--cyan);
}

.stat-item[data-collection="TYPE2"] .stat-fill {
    background: var(--magenta);
}

.stat-item[data-collection="TYPE3"] .stat-fill {
    background: var(--yellow);
}

.stat-label {
    font-size: 10px;
    color: var(--white);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 900;
}

.stat-count {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 12px;
    color: var(--white);
    font-weight: 900;
}

/* Fullscreen Viewer */
.fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--key);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.fullscreen-viewer.active {
    display: flex;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.viewer-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--magenta);
    border: 3px solid var(--key);
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.viewer-close:hover {
    background: var(--cyan);
    transform: rotate(90deg);
}

.viewer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 90%;
}

.viewer-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border: 4px solid var(--key);
    box-shadow: 0 0 0 8px var(--cyan), 0 0 0 12px var(--magenta), 0 0 0 16px var(--yellow);
}

.viewer-info {
    margin-top: 30px;
    text-align: center;
}

.viewer-title {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: var(--white);
    text-transform: uppercase;
}

.viewer-collection {
    font-size: 14px;
    color: var(--magenta);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Upload FAB */
.upload-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--yellow);
    border: 4px solid var(--key);
    color: var(--key);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 50;
    font-weight: bold;
}

.upload-fab:hover {
    background: var(--cyan);
    transform: scale(1.1) rotate(90deg);
}

.upload-fab svg {
    width: 24px;
    height: 24px;
    stroke-width: 3;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .info-panel {
        display: none;
    }
    
    /* Remove fixed size constraints for carousel */
}

@media (max-width: 768px) {
    .exhibition-header {
        padding: 20px;
    }
    
    .logo {
        padding: 10px 15px;
    }
    
    .logo-image {
        max-width: 60vw;
        max-height: 80px;
    }
    
    .hamburger-menu {
        width: 40px;
    }
    
    .header-spacer {
        width: 40px;
    }
    
    .exhibition-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Keep carousel responsive, no fixed sizes */
    
    .carousel-controls {
        padding: 0 20px;
    }

    .carousel-container {
        height: calc(85vh - 200px);  /* Match interactive image area */
    }
}

/* Portrait/Vertical Screen Optimization */
@media (orientation: portrait) {
    .carousel-container {
        height: calc(85vh - 200px);  /* Match interactive image area */
        max-width: 100%;
        width: 60vw;  /* Match interactive mode width */
    }
    
    .carousel-item {
        width: 60vw;  /* Match interactive mode */
        height: calc(85vh - 200px);  /* Match interactive image area */
        /* Removed max-width and max-height constraints */
    }
    
    .carousel-item.active {
        transform: translate(0, -50%) scale(1);
    }
    
    .carousel-item.prev,
    .carousel-item.next {
        opacity: 0.5;
        transform: translate(0, -50%) scale(0.7);
    }
    
    .carousel-item.prev {
        transform: translate(-65%, -50%) scale(0.8);
    }
    
    .carousel-item.next {
        transform: translate(65%, -50%) scale(0.8);
    }
    
    .carousel-item.far-prev,
    .carousel-item.far-next {
        display: none;
    }
    
    .exhibition-header {
        padding: 15px 20px;
    }
    
    .info-panel {
        display: none;
    }
}

/* Mode-specific styling */
body.screensaver-mode .carousel-section {
    opacity: 1;
    transition: opacity 0.5s ease;
}

body.interactive-mode .carousel-section {
    display: none;  /* Completely hide carousel in interactive mode */
}

/* Hide info panel in interactive mode */
body.interactive-mode .info-panel {
    display: none;
}

/* Touch to Interact Prompt */
.touch-prompt {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.touch-prompt.visible {
    opacity: 1;
    visibility: visible;
}

.touch-prompt-content {
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid var(--cyan);
    border-radius: 50px;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.touch-icon {
    width: 30px;
    height: 30px;
    color: var(--cyan);
}

.touch-text {
    color: var(--cyan);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Interactive Classification Panel */
.interactive-panel {
    position: fixed;
    top: 50%;  /* Center vertically like carousel */
    left: calc(10% + 30vw); /* Moved left for better access to next button */
    transform: translate(-50%, -50%);
    width: calc(60vw + 100px); /* Match carousel width */
    max-width: calc(900px + 100px);
    height: 85vh;  /* Match carousel height */
    display: none;
    z-index: 200;
    margin-top: 0;  /* Remove any top margin */
}

.interactive-panel.active {
    display: grid !important;
    grid-template-rows: 1fr auto;  /* Flexible image area, auto-sized zones wrapper */
    gap: 10px;
    padding: 5px;
    padding-left: 0;  /* Remove left padding for alignment */
}

/* Ensure panel is hidden in screensaver mode */
.screensaver-mode .interactive-panel {
    display: none !important;
    visibility: hidden;
}

/* Classification Stage */
.classification-stage {
    display: flex;
    justify-content: space-between; /* Space between for nav buttons */
    align-items: center;
    height: 100%;  /* Use full available height */
    overflow: hidden;
    position: relative;
    width: calc(60vw + 100px); /* Match new carousel width */
    max-width: calc(900px + 100px);
    padding: 0;  /* Remove any padding */
    margin: 0;  /* Left align instead of center */
}

/* Drag Indicator Animation - Exhibition-quality for 4K display */
.drag-indicator {
    position: absolute;
    left: 50%;  /* Start at center */
    top: 58%;  /* Start lower, near bottom of stage image */
    transform: translateX(-50%);
    z-index: 250;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    opacity: 1;
    animation: dragSequence 54s ease-in-out infinite;
}

.drag-indicator.hidden {
    opacity: 0;
}

.drag-hand {
    font-size: 96px;  /* Extra large for 4K display */
    filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.8)) 
            drop-shadow(0 0 20px rgba(255, 215, 0, 0.6))
            drop-shadow(0 0 60px rgba(255, 215, 0, 0.4));
    transform-origin: center;
    position: relative;
    z-index: 2;
    animation: handGrab 54s ease-in-out infinite;
}

/* Add a glowing orb effect */
.drag-hand::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulseGlow 3s ease-in-out infinite;
    z-index: -1;
}

/* Add a trailing effect */
.drag-hand::after {
    content: '👆';
    position: absolute;
    top: 0;
    left: 0;
    font-size: 96px;
    opacity: 0.2;
    animation: dragHandTrail 18s ease-in-out infinite;
    animation-delay: 0.15s;
}

/* Main drag sequence - cycles through all three zones */
@keyframes dragSequence {
    /* Zone 1 (Left - Dream Psychologist) - 0-33% */
    0% {
        left: 50%;
        top: 58%;
        opacity: 0;
    }
    2% {
        opacity: 1;
    }
    5% {
        left: 50%;
        top: 56%; /* Lift up slightly */
    }
    25% {
        left: 25%;
        top: 78%; /* Arc down to left zone - deeper into drop zones */
    }
    28% {
        left: 25%;
        top: 80%; /* Drop motion */
        opacity: 1;
    }
    31% {
        opacity: 0;
    }
    
    /* Zone 2 (Middle - Found Photo) - 33-66% */
    33% {
        left: 50%;
        top: 58%;
        opacity: 0;
    }
    35% {
        opacity: 1;
    }
    38% {
        left: 50%;
        top: 56%; /* Lift up slightly */
    }
    58% {
        left: 50%;
        top: 78%; /* Straight down to middle - deeper into drop zones */
    }
    61% {
        left: 50%;
        top: 80%; /* Drop motion */
        opacity: 1;
    }
    64% {
        opacity: 0;
    }
    
    /* Zone 3 (Right - GenAI Expert) - 66-100% */
    66% {
        left: 50%;
        top: 58%;
        opacity: 0;
    }
    68% {
        opacity: 1;
    }
    71% {
        left: 50%;
        top: 56%; /* Lift up slightly */
    }
    91% {
        left: 75%;
        top: 78%; /* Arc down to right zone - deeper into drop zones */
    }
    94% {
        left: 75%;
        top: 80%; /* Drop motion */
        opacity: 1;
    }
    97% {
        opacity: 0;
    }
    100% {
        left: 50%;
        top: 58%;
        opacity: 0;
    }
}

@keyframes dragHandTrail {
    0%, 100% {
        transform: translateY(0);
        opacity: 0;
    }
    20% {
        transform: translateY(-15px);
        opacity: 0.15;
    }
    60% {
        transform: translateY(40px);
        opacity: 0.1;
    }
    95% {
        transform: translateY(150px);
        opacity: 0;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.8;
    }
}

.drag-arrow {
    position: absolute;
    top: 100px;
    opacity: 0.6;
    animation: arrowFollow 54s ease-in-out infinite;
}

.drag-arrow svg {
    width: 50px;  /* Larger arrow for 4K */
    height: 180px;  /* Longer arrow to reach boxes */
    color: #FFD700;  /* Golden color */
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.7))
            drop-shadow(0 0 15px rgba(255, 215, 0, 0.5));
}

@keyframes arrowPulse {
    0%, 100% {
        opacity: 0.4;
        transform: scaleY(0.9);
    }
    50% {
        opacity: 0.9;
        transform: scaleY(1.05);
    }
}

/* Hand grabbing animation synchronized with drag sequence */
@keyframes handGrab {
    /* Zone 1 cycle */
    0%, 31% {
        transform: scale(1) rotate(0deg);
    }
    5%, 8% {
        transform: scale(1.1) rotate(-5deg); /* Grab motion */
    }
    25%, 28% {
        transform: scale(0.95) rotate(0deg); /* Release */
    }
    
    /* Zone 2 cycle */
    33%, 64% {
        transform: scale(1) rotate(0deg);
    }
    38%, 41% {
        transform: scale(1.1) rotate(-5deg); /* Grab motion */
    }
    58%, 61% {
        transform: scale(0.95) rotate(0deg); /* Release */
    }
    
    /* Zone 3 cycle */
    66%, 100% {
        transform: scale(1) rotate(0deg);
    }
    71%, 74% {
        transform: scale(1.1) rotate(-5deg); /* Grab motion */
    }
    91%, 94% {
        transform: scale(0.95) rotate(0deg); /* Release */
    }
}

/* Arrow following the drag path */
@keyframes arrowFollow {
    /* Zone 1 */
    0%, 2% {
        opacity: 0;
        transform: rotate(0deg) scaleY(0.5);
    }
    5% {
        opacity: 0.6;
        transform: rotate(-25deg) scaleY(0.8);
    }
    25% {
        opacity: 0.8;
        transform: rotate(-25deg) scaleY(1);
    }
    31% {
        opacity: 0;
    }
    
    /* Zone 2 */
    33%, 35% {
        opacity: 0;
        transform: rotate(0deg) scaleY(0.5);
    }
    38% {
        opacity: 0.6;
        transform: rotate(0deg) scaleY(0.8);
    }
    58% {
        opacity: 0.8;
        transform: rotate(0deg) scaleY(1);
    }
    64% {
        opacity: 0;
    }
    
    /* Zone 3 */
    66%, 68% {
        opacity: 0;
        transform: rotate(0deg) scaleY(0.5);
    }
    71% {
        opacity: 0.6;
        transform: rotate(25deg) scaleY(0.8);
    }
    91% {
        opacity: 0.8;
        transform: rotate(25deg) scaleY(1);
    }
    97%, 100% {
        opacity: 0;
    }
}

/* Text appearing at the start of each drag */
@keyframes textShow {
    /* Zone 1 */
    0%, 2% {
        opacity: 0;
    }
    3%, 10% {
        opacity: 1;
    }
    15%, 31% {
        opacity: 0;
    }
    
    /* Zone 2 */
    33%, 35% {
        opacity: 0;
    }
    36%, 43% {
        opacity: 1;
    }
    48%, 64% {
        opacity: 0;
    }
    
    /* Zone 3 */
    66%, 68% {
        opacity: 0;
    }
    69%, 76% {
        opacity: 1;
    }
    81%, 100% {
        opacity: 0;
    }
}

.drag-text {
    position: absolute;
    top: -50px;  /* Position above hand */
    font-size: 20px;  /* Larger for 4K */
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #FFD700;  /* Golden color */
    opacity: 0;
    animation: textShow 54s ease-in-out infinite;
    white-space: nowrap;
    font-weight: 800;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.9), 
                 0 0 20px rgba(255, 215, 0, 0.7),
                 0 0 10px rgba(255, 215, 0, 0.5);
}


/* Special handling for generated (small) images - match carousel */
.stage-image-container.generated-image #stageImage {
    width: auto;  /* Natural width */
    height: auto;  /* Natural height */
    max-width: 100%;  /* Don't exceed container */
    max-height: 100%;  /* Don't exceed container */
    object-fit: contain;
    background: transparent;  /* Remove background */
    padding: 0;
    box-sizing: border-box;
}

/* Stage navigation buttons */
.stage-nav-btn {
    position: relative;
    flex-shrink: 0;
    width: 50px;
    height: 80px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0.7;
    backdrop-filter: blur(5px);
}

.stage-nav-btn:hover {
    background: rgba(0, 255, 255, 0.8);
    opacity: 1;
    transform: scale(1.05);
}

.stage-nav-btn.stage-prev {
    border-radius: 0 8px 8px 0;
}

.stage-nav-btn.stage-next {
    border-radius: 8px 0 0 8px;
}

.stage-nav-btn svg {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.stage-image-container {
    position: relative;
    width: 60vw; /* Match new carousel width */
    max-width: 900px;
    height: calc(100% - 20px);  /* Use nearly full height, small buffer */
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 10px 0;  /* Small vertical padding */
    flex-shrink: 1;
    touch-action: none; /* Prevent Windows touch gestures */
    user-select: none; /* Prevent text selection during drag */
}

.stage-image-container.loading .stage-loading {
    display: flex;
}

.stage-image-container.loading #stageImage {
    opacity: 0;
}

#stageImage {
    width: 100%;  /* Fill container width */
    height: 100%;  /* Fill container height */
    object-fit: contain;
    cursor: grab;
    transition: all 0.3s ease;
    border: 3px solid var(--key);
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: block;
    background: transparent;  /* No background */
    touch-action: none; /* Prevent Windows touch gestures */
    user-select: none; /* Prevent selection */
    -ms-touch-action: none; /* IE/Edge specific */
    position: relative;
}

#stageImage:hover {
    cursor: grab;
    transform: scale(1.02);
    box-shadow: 0 25px 70px rgba(0, 255, 255, 0.2), 0 0 40px rgba(255, 0, 255, 0.1);
}

#stageImage:active {
    cursor: grabbing;
}

#stageImage.dragging {
    opacity: 0.8;
    transform: scale(0.95) rotate(5deg);
    filter: brightness(1.2) contrast(1.1);
    cursor: grabbing !important;
    box-shadow: 0 30px 80px rgba(0, 255, 255, 0.4), 0 0 60px rgba(255, 0, 255, 0.3);
    animation: float-drag 0.3s ease-in-out;
}

@keyframes float-drag {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(0.98) rotate(3deg) translateY(-10px);
    }
    100% {
        transform: scale(0.95) rotate(5deg);
    }
}

/* Add a glowing trail effect */
#stageImage.dragging::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(0, 255, 255, 0.2), 
        transparent, 
        rgba(255, 0, 255, 0.2), 
        transparent);
    pointer-events: none;
    animation: shimmer 0.5s ease infinite;
}

@keyframes shimmer {
    0% { opacity: 0.5; }
    50% { opacity: 0.8; }
    100% { opacity: 0.5; }
}

/* Auto-archiving tint animations - Much more dramatic */
.stage-image-container.auto-archiving-cyan::after,
.stage-image-container.auto-archiving-yellow::after,
.stage-image-container.auto-archiving-magenta::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: multiply;
    animation: dramaticTint 12s ease-in-out forwards;
}

.stage-image-container.auto-archiving-cyan::after {
    background: linear-gradient(135deg, 
        rgba(0, 255, 255, 0.9) 0%, 
        rgba(0, 200, 200, 0.85) 50%,
        rgba(0, 255, 255, 0.95) 100%);
    box-shadow: inset 0 0 200px rgba(0, 255, 255, 0.8),
                inset 0 0 100px rgba(0, 255, 255, 0.6),
                inset 0 0 50px rgba(0, 255, 255, 0.4);
}

.stage-image-container.auto-archiving-yellow::after {
    background: linear-gradient(135deg, 
        rgba(255, 255, 0, 0.9) 0%, 
        rgba(200, 200, 0, 0.85) 50%,
        rgba(255, 255, 0, 0.95) 100%);
    box-shadow: inset 0 0 200px rgba(255, 255, 0, 0.8),
                inset 0 0 100px rgba(255, 255, 0, 0.6),
                inset 0 0 50px rgba(255, 255, 0, 0.4);
}

.stage-image-container.auto-archiving-magenta::after {
    background: linear-gradient(135deg, 
        rgba(255, 0, 255, 0.9) 0%, 
        rgba(200, 0, 200, 0.85) 50%,
        rgba(255, 0, 255, 0.95) 100%);
    box-shadow: inset 0 0 200px rgba(255, 0, 255, 0.8),
                inset 0 0 100px rgba(255, 0, 255, 0.6),
                inset 0 0 50px rgba(255, 0, 255, 0.4);
}

/* Add filter effects to the image itself during auto-archiving */
.stage-image-container.auto-archiving-cyan #stageImage,
.stage-image-container.auto-archiving-yellow #stageImage,
.stage-image-container.auto-archiving-magenta #stageImage {
    animation: imageArchivingEffect 12s ease-in-out forwards;
}

@keyframes dramaticTint {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 0.2;
    }
    30% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.7;
    }
    75% {
        opacity: 0.85;
    }
    85% {
        opacity: 0.9;
    }
    90%, 100% {
        opacity: 0.95;
    }
}

@keyframes imageArchivingEffect {
    0% {
        filter: brightness(1) saturate(1);
        transform: scale(1);
    }
    10% {
        filter: brightness(1.05) saturate(1.1);
        transform: scale(1.01);
    }
    30% {
        filter: brightness(1.1) saturate(1.2);
        transform: scale(1.02);
    }
    50% {
        filter: brightness(1.2) saturate(1.5);
        transform: scale(1.01);
    }
    70% {
        filter: brightness(1.3) saturate(2) contrast(1.1);
        transform: scale(0.99);
    }
    85% {
        filter: brightness(1.4) saturate(2.5) contrast(1.2);
        transform: scale(0.98);
    }
    95% {
        filter: brightness(1.5) saturate(3) contrast(1.3);
        transform: scale(0.95) rotate(1deg);
    }
    95% {
        filter: brightness(1.5) saturate(3) contrast(1.3) blur(1px);
        transform: scale(0.9) rotate(5deg);
    }
    100% {
        filter: brightness(1.6) saturate(3) contrast(1.4) blur(2px);
        transform: scale(0.85) rotate(10deg);
        opacity: 0.8;
    }
}

.stage-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    color: var(--cyan);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 255, 255, 0.3);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Classification Zones */
.classification-zones {
    display: flex;
    justify-content: flex-start;  /* Left align */
    gap: 30px;
    padding: 20px;
    padding-left: 20px;  /* Add left padding for better spacing */
    background: rgba(0, 0, 0, 0.7);  /* Background for visibility */
    border-radius: 15px;
    min-height: 200px;  /* Ensure minimum height */
    flex: 1;  /* Take available space */
    align-items: center;
}

.drop-zone {
    flex: 1;
    max-width: 250px;
    text-align: center;
    position: relative;
}

/* Add padding to the first drop zone */
.drop-zone:first-child {
    margin-left: 5px;
}

/* CMY colors for each collection */
.drop-zone[data-type="TYPE1"] h3 {
    color: var(--cyan);
    text-shadow: 0 0 20px var(--cyan), 0 0 40px var(--cyan);
}

.drop-zone[data-type="TYPE2"] h3 {
    color: var(--yellow);
    text-shadow: 0 0 20px var(--yellow), 0 0 40px var(--yellow);
}

.drop-zone[data-type="TYPE3"] h3 {
    color: var(--magenta);
    text-shadow: 0 0 20px var(--magenta), 0 0 40px var(--magenta);
}

.drop-zone h3 {
    margin-bottom: 15px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    min-height: 48px;  /* Ensure consistent height for all titles */
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-area {
    height: 150px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* CMY border colors for each collection */
.drop-zone[data-type="TYPE1"] .drop-area {
    border-color: rgba(0, 255, 255, 0.3);
}

.drop-zone[data-type="TYPE2"] .drop-area {
    border-color: rgba(255, 255, 0, 0.3);
}

.drop-zone[data-type="TYPE3"] .drop-area {
    border-color: rgba(255, 0, 255, 0.3);
}

/* Ready state with CMY colors */
.drop-zone[data-type="TYPE1"].ready .drop-area {
    border-color: var(--cyan);
    background: rgba(0, 255, 255, 0.05);
    box-shadow: inset 0 0 30px rgba(0, 255, 255, 0.2);
}

.drop-zone[data-type="TYPE2"].ready .drop-area {
    border-color: var(--yellow);
    background: rgba(255, 255, 0, 0.05);
    box-shadow: inset 0 0 30px rgba(255, 255, 0, 0.2);
}

.drop-zone[data-type="TYPE3"].ready .drop-area {
    border-color: var(--magenta);
    background: rgba(255, 0, 255, 0.05);
    box-shadow: inset 0 0 30px rgba(255, 0, 255, 0.2);
}

/* Hover state with whimsical animation */
.drop-zone[data-type="TYPE1"].hover .drop-area {
    border-color: var(--cyan);
    background: rgba(0, 255, 255, 0.15);
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.5), inset 0 0 40px rgba(0, 255, 255, 0.3);
    animation: pulse-cyan 0.5s ease infinite;
}

.drop-zone[data-type="TYPE2"].hover .drop-area {
    border-color: var(--yellow);
    background: rgba(255, 255, 0, 0.15);
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(255, 255, 0, 0.5), inset 0 0 40px rgba(255, 255, 0, 0.3);
    animation: pulse-yellow 0.5s ease infinite;
}

.drop-zone[data-type="TYPE3"].hover .drop-area {
    border-color: var(--magenta);
    background: rgba(255, 0, 255, 0.15);
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(255, 0, 255, 0.5), inset 0 0 40px rgba(255, 0, 255, 0.3);
    animation: pulse-magenta 0.5s ease infinite;
}

@keyframes pulse-cyan {
    0%, 100% { transform: scale(1.08); }
    50% { transform: scale(1.12); }
}

@keyframes pulse-magenta {
    0%, 100% { transform: scale(1.08); }
    50% { transform: scale(1.12); }
}

@keyframes pulse-yellow {
    0%, 100% { transform: scale(1.08); }
    50% { transform: scale(1.12); }
}

/* CMY colors for drop area icons */
.drop-zone[data-type="TYPE1"] .drop-area svg {
    width: 50px;
    height: 50px;
    color: var(--cyan);
    filter: drop-shadow(0 0 10px var(--cyan));
}

.drop-zone[data-type="TYPE2"] .drop-area svg {
    width: 50px;
    height: 50px;
    color: var(--yellow);
    filter: drop-shadow(0 0 10px var(--yellow));
}

.drop-zone[data-type="TYPE3"] .drop-area svg {
    width: 50px;
    height: 50px;
    color: var(--magenta);
    filter: drop-shadow(0 0 10px var(--magenta));
}

.drop-area p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* Drop success animation */
@keyframes dropRipple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Archive animation for image */
@keyframes archiveImage {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.8) rotate(180deg) translateY(-50px);
        filter: brightness(1.5) hue-rotate(90deg);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(360deg) translateY(-100px);
        filter: brightness(2) hue-rotate(180deg);
    }
}

#stageImage.archiving {
    animation: archiveImage 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

/* Archived text overlay */
.archived-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 8px;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    text-shadow: 0 0 20px currentColor;
}

.archived-overlay.show {
    animation: showArchived 1.5s ease forwards;
}

.archived-overlay.cyan {
    color: var(--cyan);
}

.archived-overlay.magenta {
    color: var(--magenta);
}

.archived-overlay.yellow {
    color: var(--yellow);
}

@keyframes showArchived {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

.drop-zone.success .drop-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: dropRipple 0.6s ease-out;
}

.drop-zone[data-type="TYPE1"].success .drop-area::before {
    background: var(--cyan);
}

.drop-zone[data-type="TYPE2"].success .drop-area::before {
    background: var(--yellow);
}

.drop-zone[data-type="TYPE3"].success .drop-area::before {
    background: var(--magenta);
}

/* Classification Success Message */
.classification-success {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 255, 255, 0.9);
    color: var(--black);
    padding: 20px 40px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 18px;
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    from {
        transform: translate(-50%, -50%) scale(0);
    }
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* AI Chat Dialogue - Repositioned for better space usage */
.chat-dialogue {
    position: fixed;
    top: 25vh;  /* Start at 1/4 from top */
    bottom: 25vh;  /* End at 1/4 from bottom */
    right: 5%;
    width: 25vw;
    min-width: 350px;
    max-width: 500px;
    height: auto;  /* Auto height to fill space */
    background: transparent;  /* No background box */
    backdrop-filter: none;  /* Remove blur */
    border: none;  /* Remove box border */
    border-radius: 0;  /* No rounded corners */
    display: none;
    flex-direction: column;
    z-index: 300;
    box-shadow: none;  /* Remove shadow */
    overflow: visible;  /* Show overflow initially */
    transition: all 0.3s ease;
}

.chat-dialogue::before {
    display: none;  /* Remove top border decoration */
}

.chat-dialogue.active {
    display: flex;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 15px 0;  /* Remove side padding, only bottom */
    border: none;  /* Remove border */
    background: transparent;  /* Transparent background */
    margin-bottom: 20px;
}

.chat-header h3 {
    color: var(--cyan);
    font-size: 14px; /* Smaller, subtle */
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    font-weight: 600;
    opacity: 0.7;
}

.chat-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.chat-controls:hover {
    opacity: 1;
}

.chat-close {
    background: transparent;
    border: none;
    color: var(--cyan);
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.chat-close:hover {
    transform: rotate(90deg);
    opacity: 1;
}

/* Chat minimize button */
.chat-minimize {
    background: transparent;
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: var(--cyan);
    font-size: 14px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.chat-minimize:hover {
    background: rgba(0, 255, 255, 0.1);
    transform: scale(1.1);
    opacity: 1;
}

.chat-dialogue.minimized .chat-minimize {
    transform: rotate(180deg);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: visible;
    padding: 0;  /* Remove padding */
    display: flex;
    flex-direction: column;
    gap: 25px; /* More spacing between messages */
    scroll-behavior: smooth;  /* Smooth scrolling animation */
    background: transparent; /* Transparent background */
    scrollbar-width: none;  /* Hide scrollbar Firefox */
    -ms-overflow-style: none;  /* Hide scrollbar IE/Edge */
}

/* Hide scrollbar but keep functionality */
.chat-messages::-webkit-scrollbar {
    width: 0;
    display: none;
}

/* Show scrollbar only when hovering and there's overflow */
.chat-messages:hover::-webkit-scrollbar {
    width: 6px;
    display: block;
}

.chat-messages:hover::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.chat-messages:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 3px;
}

.chat-message {
    background: rgba(0, 0, 0, 0.7); /* Semi-transparent dark */
    backdrop-filter: blur(8px);
    border: none; /* Remove border */
    border-radius: 20px;
    padding: 20px 25px;
    animation: floatIn 0.6s ease;
    position: relative;
    margin-bottom: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform-origin: center center;
    width: 100%;  /* Full width */
    word-wrap: break-word;  /* Wrap long words */
    word-break: break-word;  /* Break words if needed */
}

@keyframes floatIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    50% {
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chat-message::after {
    display: none; /* Remove separator line for cleaner floating look */
}

/* Animation moved to chat-message section above */

.chat-message-header {
    font-weight: 700;
    font-size: 16px; /* Larger font */
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px currentColor;
}

/* CMYK colors for different message types */
.chat-message[data-type="curator"] .chat-message-header {
    color: var(--cyan);
}

.chat-message[data-type="analyst"] .chat-message-header {
    color: var(--magenta);
}

.chat-message[data-type="archivist"] .chat-message-header {
    color: var(--yellow);
}

.chat-message-content {
    color: rgba(255, 255, 255, 0.95);
    font-size: 18px; /* Much larger font */
    line-height: 1.8; /* Better line spacing */
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* CMYK text colors for different message types with glow */
.chat-message[data-type="curator"] .chat-message-content {
    color: var(--cyan);
    text-shadow: 0 0 15px var(--cyan), 0 1px 4px rgba(0, 0, 0, 0.5);
}

.chat-message[data-type="analyst"] .chat-message-content {
    color: var(--magenta);
    text-shadow: 0 0 15px var(--magenta), 0 1px 4px rgba(0, 0, 0, 0.5);
}

.chat-message[data-type="archivist"] .chat-message-content {
    color: var(--yellow);
    text-shadow: 0 0 15px var(--yellow), 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Add subtle animation to messages as they appear */
.chat-message[data-type="curator"] {
    animation: floatIn 0.6s ease, pulseGlow 2s ease infinite;
}

.chat-message[data-type="analyst"] {
    animation: floatIn 0.6s ease 0.2s, pulseGlow 2s ease 0.7s infinite;
}

.chat-message[data-type="archivist"] {
    animation: floatIn 0.6s ease 0.4s, pulseGlow 2s ease 1.4s infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.1);
    }
}

/* Scrollbar styles moved to chat-messages section above */

/* Bottom Zones Container - Flex layout for collections and upload */
.bottom-zones-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 80px;  /* Large gap for visual separation */
    width: 100%;
}

/* User Upload Zone - Separate styling from collections */
.user-upload-zone {
    flex-shrink: 0;
    text-align: center;
    position: relative;
    width: 250px;
    margin-right: 20px;  /* Space from right edge */
}

.user-upload-zone h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Upload area with distinct white/grey styling */
.upload-area {
    height: 150px;  /* Same height as drop-area */
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    background: rgba(50, 50, 50, 0.5);  /* Grey background instead of black */
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.upload-area:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(100, 100, 100, 0.5);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.upload-area svg {
    width: 50px;
    height: 50px;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0.5;
}

.upload-area p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.upload-area.dragover {
    border-color: var(--cyan);
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.4);
}

.upload-area.uploading {
    pointer-events: none;
}

.upload-area.uploading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.3), transparent);
    animation: upload-progress 1.5s linear infinite;
}

@keyframes upload-progress {
    to {
        left: 100%;
    }
}

/* QR Code FAB Button */
.qr-code-fab {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--magenta), var(--yellow));
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 0, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

.qr-code-fab.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.qr-code-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 0, 255, 0.5);
}

.qr-code-fab svg {
    width: 28px;
    height: 28px;
}

/* QR Code Modal */
.qr-code-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.qr-code-modal.active {
    opacity: 1;
    pointer-events: all;
}

.qr-code-content {
    background: var(--key-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.qr-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.qr-close-btn:hover {
    opacity: 1;
}

.qr-code-content h2 {
    color: var(--cyan);
    font-size: 24px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.qr-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 30px;
}

.qr-code-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 0 auto 20px;
    display: inline-block;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code-container img {
    max-width: 100%;
    height: auto;
}

.qr-loading {
    color: #333;
    font-size: 14px;
}

.qr-info {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Empty Image Box Styles */
.empty-image-box {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    overflow: hidden;
}

.empty-image-box svg {
    width: 60px;
    height: 60px;
    color: rgba(255, 255, 255, 0.4);
}

.empty-image-box.awaiting {
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.15);
        background: rgba(255, 255, 255, 0.02);
    }
    50% {
        border-color: rgba(0, 255, 255, 0.3);
        background: rgba(0, 255, 255, 0.05);
    }
}

.upload-prompt {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin: 0;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-prompt {
    color: rgba(255, 255, 255, 0.9);
}

.qr-code-display {
    position: relative;
}

.qr-code-display .empty-image-box {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
}

.qr-instruction {
    color: rgba(0, 255, 255, 0.8);
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    animation: pulse-text 2s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* Chat Toggle Button - Floating Action Button */
.chat-toggle-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--magenta) 100%);
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 299;
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0);
}

.chat-toggle-fab.visible {
    opacity: 1;
    transform: scale(1);
}

.chat-toggle-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 255, 255, 0.6);
}

.chat-toggle-fab svg {
    width: 28px;
    height: 28px;
}

.chat-toggle-fab.active {
    background: linear-gradient(135deg, var(--magenta) 0%, var(--yellow) 100%);
}

/* Responsive adjustments for new features */
@media (max-width: 768px) {
    .interactive-panel {
        width: 100%;
        height: 100vh;
        max-width: none;
    }
    
    .classification-zones {
        flex-direction: column;
        gap: 20px;
    }
    
    /* Hide drag indicator on mobile */
    .drag-indicator {
        display: none;
    }
    
    .drop-zone {
        max-width: none;
    }
    
    .chat-dialogue {
        width: calc(100% - 40px);
        top: 25vh;
        bottom: 25vh;
        height: auto;
        right: 20px;
        transform: none;
        background: transparent;
    }
    
    .touch-prompt-content {
        padding: 10px 20px;
    }
    
    .touch-text {
        font-size: 14px;
    }
}

/* Vertical 4K Display Optimization (55" TV Portrait Mode) */
/* Vertical 4K Display Optimization (55" TV Portrait Mode) */
@media (orientation: portrait) and (min-width: 2000px) {
    /* Interactive Panel - Full height with proper spacing */
    .interactive-panel {
        width: calc(60vw + 120px);  /* Match 4K carousel width */
        height: 85vh;  /* Match carousel height */
        max-width: calc(1000px + 120px);
        display: none;  /* Hidden by default */
        grid-template-rows: calc(100% - 250px) 250px;  /* Maximize image space */
        gap: 20px;
        padding: 15px;
        padding-left: 0;
        top: 50%;  /* Center vertically like carousel */
        left: calc(10% + 30vw);  /* Moved left for better access to next button */
        transform: translate(-50%, -50%);
    }
    
    .interactive-panel.active {
        display: grid !important;  /* Show when active */
    }
    
    /* Image area - proper constraints */
    .classification-stage {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 100%;  /* Use full available height */
        padding: 0;  /* Remove padding */
        width: calc(60vw + 120px); /* Adjusted for left-aligned layout */
        max-width: calc(1000px + 120px);
        margin: 0;
    }
    
    /* Larger navigation buttons for 4K */
    .stage-nav-btn {
        width: 60px;
        height: 100px;
    }
    
    .stage-nav-btn svg {
        width: 36px;
        height: 36px;
    }
    
    .carousel-btn {
        width: 60px;
        height: 100px;
    }
    
    .carousel-btn svg {
        width: 36px;
        height: 36px;
    }
    
    /* Adjust carousel controls width for 4K */
    .carousel-controls {
        width: calc(60vw + 120px); /* Adjusted for left-aligned layout */
        max-width: calc(1000px + 120px);
        left: calc(15% + 30vw); /* Position for left-aligned carousel */
    }
    
    .stage-image-container {
        width: 60vw; /* Adjusted for left-aligned layout */
        max-width: 1000px;
        height: calc(100% - 20px);  /* Use full height with small buffer */
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0;
        padding: 10px 0;
        flex-shrink: 1;
    }
    
    #stageImage {
        width: 100%;  /* Fill container */
        height: 100%;
        object-fit: contain;
        background: transparent;  /* No background */
        border: 3px solid var(--key);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }
    
    /* Force generated images to fill the space properly */
    .stage-image-container.generated-image #stageImage {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    /* Classification zones - raised and more visible */
    .classification-zones {
        flex-direction: row;
        justify-content: flex-start;  /* Left align to match carousel */
        align-items: center;
        padding: 30px;
        padding-left: 0;  /* No left padding */
        gap: 50px;
        background: rgba(0, 0, 0, 0.9);  /* Darker background */
        border: 2px solid var(--cyan);
        border-radius: 20px;
        height: 350px;  /* Fixed height */
        margin-bottom: 20px;  /* Space from bottom */
        width: calc(60vw + 120px);  /* Match 4K carousel width */
        max-width: calc(1000px + 120px);
        margin-left: 0;
    }
    
    .drop-zone {
        max-width: 500px;
    }
    
    .drop-area {
        height: 200px;  /* Reduced height */
        font-size: 24px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .drop-area svg {
        width: 80px;
        height: 80px;
    }
    
    .drop-area p {
        font-size: 24px;
    }
    
    .drop-zone h3 {
        font-size: 28px;
        margin-bottom: 25px;
        font-weight: 800;
    }
    
    /* Enhanced drop area animations for 4K */
    .drop-zone.hover .drop-area {
        animation-duration: 0.4s;
    }
    
    /* Upload zone for 4K displays */
    .user-upload-zone {
        width: 400px;
        margin-right: 50px;
    }
    
    .user-upload-zone h3 {
        font-size: 28px;
        margin-bottom: 25px;
        font-weight: 800;
    }
    
    .upload-area {
        height: 200px;
        font-size: 24px;
    }
    
    .upload-area svg {
        width: 80px;
        height: 80px;
    }
    
    .upload-area p {
        font-size: 24px;
    }
    
    .bottom-zones-container {
        gap: 100px;  /* Larger gap for 4K displays */
    }
    
    /* Reposition chat for 4K display */
    .chat-dialogue {
        position: fixed;
        top: 25vh;  /* 1/4 from top */
        bottom: 25vh;  /* 1/4 from bottom */
        right: 3%;
        left: auto;
        width: 600px;
        min-width: 600px;
        height: auto;
        font-size: 20px;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }
    
    /* Minimized state for chat */
    .chat-dialogue.minimized {
        height: 70px;
        overflow: hidden;
    }
    
    .chat-dialogue.minimized .chat-messages {
        display: none;
    }
    
    /* Larger UI elements for 4K */
    .touch-prompt {
        bottom: 80px;
    }
    
    .touch-prompt-content {
        padding: 25px 50px;
    }
    
    .touch-icon {
        width: 50px;
        height: 50px;
    }
    
    .touch-text {
        font-size: 36px;
    }
    
    /* Chat text sizing for 4K */
    .chat-header h3 {
        font-size: 28px;
        letter-spacing: 3px;
    }
    
    .chat-message-header {
        font-size: 20px;
        letter-spacing: 2.5px;
    }
    
    .chat-message-content {
        font-size: 24px;
        line-height: 1.9;
        font-weight: 500;
    }
    
    .chat-messages {
        padding: 35px;
        gap: 25px;
    }
    
    .chat-message {
        padding: 25px 30px;
        border-radius: 20px;
    }
    
    /* Success message for 4K */
    .classification-success {
        font-size: 32px;
        padding: 30px 60px;
    }
    
    /* Logo scaling for 4K */
    .logo-image {
        max-width: 70vw;
        max-height: 180px;
    }
    
    /* Carousel for vertical 4K - proper sizing */
    .carousel-section {
        height: 90vh;  /* Leave room for header */
        margin-top: 10vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .carousel-container {
        height: calc(85vh - 270px);  /* Match interactive image area for 4K (larger collection boxes) */
        width: 60vw;  /* Match interactive mode */
        max-width: 1000px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        margin: 0;
    }
    
    .carousel-track {
        height: 100%;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    
    /* Carousel items - Match interactive mode size */
    .carousel-item {
        position: absolute;
        width: 60vw !important;  /* Match interactive mode */
        height: calc(85vh - 270px) !important;  /* Match interactive image area for 4K */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .carousel-item img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .carousel-item.active {
        width: 60vw !important;  /* Match interactive mode */
        height: calc(85vh - 270px) !important;  /* Match interactive image area for 4K */
        transform: translate(0, -50%) scale(1) !important;
        z-index: 5;
        opacity: 1;
    }
    
    .carousel-item.prev {
        transform: translate(-65%, -50%) scale(0.85);
        opacity: 0.6;
    }
    
    .carousel-item.next {
        transform: translate(65%, -50%) scale(0.85);
        opacity: 0.6;
    }
    
    .carousel-item.far-prev {
        transform: translate(-140%, -50%) scale(0.6);
        opacity: 0.3;
    }
    
    .carousel-item.far-next {
        transform: translate(140%, -50%) scale(0.6);
        opacity: 0.3;
    }
    
    .carousel-item.hidden {
        display: none;
    }
    
    /* Hide hamburger in interactive mode on vertical */
    body.interactive-mode .hamburger-menu {
        opacity: 0;
        pointer-events: none;
    }
}

/* CMYK Start Screen */
#cmyk-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--key);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.cmyk-logo {
    margin-bottom: 2rem;
}

.cmyk-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 80vw;
    height: 60vh;
    max-width: 400px;
    max-height: 600px;
}

.cmyk-box {
    width: 100%;
    height: 100%;
}

#start-button {
    margin-top: 2rem;
    padding: 1rem 2rem;
    font-size: 4.5rem;
    background-color: var(--cyan);
    color: var(--key);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#start-button:hover {
    background-color: var(--magenta);
}

/* General portrait orientation improvements */
@media (orientation: portrait) {
    /* Carousel section properly positioned */
    .carousel-section {
        height: 85vh;
        margin-top: 10vh;  /* Space for header */
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding-left: 10%; /* Left align for portrait mode */
    }
    
    /* Adjust carousel controls for portrait mode */
    .carousel-controls {
        width: calc(60vw + 100px); /* Adjusted for left-aligned layout */
        max-width: calc(900px + 100px);
        left: calc(10% + 30vw); /* Position for left-aligned carousel */
    }
    
    /* Adjust carousel for vertical viewing */
    .carousel-container {
        height: calc(85vh - 200px);  /* Match interactive image area */
        width: 60vw; /* Narrower for left alignment */
        max-width: 900px;
        margin: 0;
    }
    
    /* Vertical-optimized carousel items - Match interactive mode */
    .carousel-item {
        position: absolute;
        width: 60vw !important;
        height: calc(85vh - 200px) !important;  /* Match interactive image area */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .carousel-item img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .carousel-item.active {
        width: 80vw !important;
        height: 85vh !important;
        transform: translate(-50%, -50%) scale(1) !important;
        z-index: 5;
        opacity: 1;
    }
    
    .carousel-item.prev,
    .carousel-item.next {
        transform: translate(-50%, -50%) scale(0.85);
        opacity: 0.6;
    }
    
    .carousel-item.hidden {
        display: none;
    }
    
    /* Stack classification zones vertically on smaller portrait screens */
    @media (max-width: 1999px) {
        .classification-zones {
            flex-direction: column;
            align-items: center;
        }
        
        .drop-zone {
            width: 80%;
            max-width: 600px;
        }
    }
    
    /* Chat positioning for non-4K portrait */
    @media (max-width: 1999px) {
        .chat-dialogue {
            top: 200px;  /* Moved down to avoid logo */
            right: 20px;
            left: auto;
            width: calc(100% - 40px);
            max-width: 400px;
            height: 400px;
        }
    }
}

/* ==================== CMYK DISSOLVE ANIMATIONS ==================== */

/* Dissolve effect classes for each CMYK color */
.dissolve-cyan {
    animation: dissolve-cmyk 1.5s ease-out forwards;
    --dissolve-color: var(--cyan);
    --dissolve-rgb: 0, 255, 255;
}

.dissolve-magenta {
    animation: dissolve-cmyk 1.5s ease-out forwards;
    --dissolve-color: var(--magenta);
    --dissolve-rgb: 255, 0, 255;
}

.dissolve-yellow {
    animation: dissolve-cmyk 1.5s ease-out forwards;
    --dissolve-color: var(--yellow);
    --dissolve-rgb: 255, 255, 0;
}

/* Main dissolve animation */
@keyframes dissolve-cmyk {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: none;
    }
    
    30% {
        opacity: 0.9;
        filter: drop-shadow(0 0 10px var(--dissolve-color));
    }
    
    50% {
        opacity: 0.7;
        transform: scale(0.98);
        filter: drop-shadow(0 0 20px var(--dissolve-color)) 
                saturate(1.5);
        background: linear-gradient(
            to bottom,
            transparent 0%,
            rgba(var(--dissolve-rgb), 0.1) 50%,
            rgba(var(--dissolve-rgb), 0.2) 100%
        );
    }
    
    70% {
        opacity: 0.4;
        transform: scale(0.96);
        filter: drop-shadow(0 0 30px var(--dissolve-color)) 
                blur(0.5px)
                saturate(2);
    }
    
    100% {
        opacity: 0;
        transform: scale(0.94);
        filter: drop-shadow(0 0 40px var(--dissolve-color)) 
                blur(2px);
    }
}

/* Alternative dissolve for image containers */
.image-dissolve-wrapper {
    position: relative;
    display: inline-block;
}

.image-dissolve-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.image-dissolve-wrapper.dissolving-cyan::after {
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(0, 255, 255, 0.3) 50%,
        rgba(0, 255, 255, 0.6) 100%
    );
    opacity: 1;
}

.image-dissolve-wrapper.dissolving-magenta::after {
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(255, 0, 255, 0.3) 50%,
        rgba(255, 0, 255, 0.6) 100%
    );
    opacity: 1;
}

.image-dissolve-wrapper.dissolving-yellow::after {
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(255, 255, 0, 0.3) 50%,
        rgba(255, 255, 0, 0.6) 100%
    );
    opacity: 1;
}

/* Particle effect for dissolve */
@keyframes particle-burst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

.dissolve-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    animation: particle-burst 1s ease-out forwards;
}

.dissolve-particle.cyan {
    background: var(--cyan);
    box-shadow: 0 0 6px var(--cyan);
}

.dissolve-particle.magenta {
    background: var(--magenta);
    box-shadow: 0 0 6px var(--magenta);
}

.dissolve-particle.yellow {
    background: var(--yellow);
    box-shadow: 0 0 6px var(--yellow);
}

/* AI Persona Messages - Transparent Side Layout */
.persona-messages-container {
    position: fixed;
    top: 20vh;  /* Start at 1/5 from top */
    right: 5%;
    width: 28vw;
    min-width: 380px;
    max-width: 550px;
    height: 60vh;  /* Take up middle 60% of screen */
    display: flex;
    flex-direction: column;
    gap: 40px;  /* Space between personas */
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.persona-messages-container.active {
    opacity: 1;
    pointer-events: all;
}

.persona-message-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    flex: 1;  /* Each persona gets equal space */
    max-height: 33%;  /* Limit each to roughly 1/3 of container */
}

.persona-label {
    font-size: 24px;  /* Much larger label */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

/* Color coding for each persona */
.persona-message-wrapper[data-persona="curator"] .persona-label {
    color: var(--cyan);
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}

.persona-message-wrapper[data-persona="analyst"] .persona-label {
    color: var(--magenta);
    text-shadow: 0 0 15px rgba(255, 0, 255, 0.6);
}

.persona-message-wrapper[data-persona="archivist"] .persona-label {
    color: var(--yellow);
    text-shadow: 0 0 15px rgba(255, 255, 0, 0.6);
}

.persona-text {
    font-size: 32px;  /* Much larger text */
    line-height: 1.8;
    font-weight: 400;
    background: transparent;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    word-break: break-word;
    flex: 1;
    min-height: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Color-coded text for each persona */
.persona-message-wrapper[data-persona="curator"] .persona-text {
    color: var(--cyan);
    opacity: 0.95;
    text-shadow: 0 2px 12px rgba(0, 255, 255, 0.3);
}

.persona-message-wrapper[data-persona="analyst"] .persona-text {
    color: var(--magenta);
    opacity: 0.95;
    text-shadow: 0 2px 12px rgba(255, 0, 255, 0.3);
}

.persona-message-wrapper[data-persona="archivist"] .persona-text {
    color: var(--yellow);
    opacity: 0.95;
    text-shadow: 0 2px 12px rgba(255, 255, 0, 0.3);
}

.persona-text::-webkit-scrollbar {
    display: none;
}

/* Typing animation indicator */
.persona-message-wrapper.typing .persona-label {
    opacity: 1;
}

.persona-message-wrapper.typing .persona-label::after {
    content: '...';
    display: inline-block;
    animation: typingDots 1.5s infinite;
}

@keyframes typingDots {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
    100% { content: '.'; }
}

/* Simple close button */
.persona-close-btn {
    position: absolute;
    top: -10px;
    right: 0;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.persona-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transform: rotate(90deg);
}

/* Fade in animation for messages */
@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.persona-text.animating {
    animation: fadeInMessage 0.5s ease;
}


/* Responsive adjustments */
@media (max-width: 1400px) {
    .persona-messages-container {
        width: 35vw;
        min-width: 350px;
    }
}

@media (max-width: 1200px) {
    .persona-messages-container {
        top: 15vh;
        right: 3%;
        width: 40vw;
        min-width: 320px;
        height: 70vh;
        gap: 30px;
    }
    
    .persona-text {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .persona-messages-container {
        top: 10vh;
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
        min-width: unset;
        max-width: unset;
        height: 80vh;
        gap: 25px;
    }
    
    .persona-label {
        font-size: 12px;
    }
    
    .persona-text {
        font-size: 15px;
        line-height: 1.7;
    }
}

/* QR Code Display in Upload Area */
.upload-default {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.qr-code-display {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.qr-code-image {
    background: white;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code-image img {
    width: 130px;
    height: 130px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.qr-instruction {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Restart Button at Bottom Center */
.restart-button-bottom {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 20px 30px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.restart-button-bottom svg {
    width: 35px;
    height: 35px;
    stroke: white;
    transition: transform 0.5s ease;
}

.restart-button-bottom:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7);
}

.restart-button-bottom:hover svg {
    transform: rotate(360deg);
}

.restart-button-bottom span {
    font-family: "Space Mono", monospace;
}

/* Hide restart button in CMYK mode */
body:not(.interactive-mode):not(.screensaver-mode) .restart-button-bottom {
    display: none;
}

/* Pulse animation for restart button */
@keyframes pulse-restart {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 0 10px 50px rgba(255, 255, 255, 0.2);
    }
}

.restart-button-bottom:not(:hover) {
    animation: pulse-restart 3s ease-in-out infinite;
}
