/* CSS Custom Properties for Panel Widths - Global scope */
:root {
    --left-panel-width: 280px;
    --right-panel-width: 360px;
    --button-width: 22px;
    
    /* Common spacing and sizing constants */
    --border-radius: 4px;
    --border-radius-large: 8px;
    --padding-small: 4px 6px;
    --padding-medium: 8px 12px;
    --padding-large: 12px 16px;
    --transition-duration: 160ms;
    --transition-timing: ease;
    --shadow-light: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 8px rgba(0,0,0,0.15);
    --z-index-toggle: 1100;
    --z-index-header: 1000;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', 'VT323', monospace;
    line-height: 1.6;
    color: #fbbf24;
    background: linear-gradient(135deg, #201818, #0d0c0c);
    min-height: 100vh;
}

/* Legacy container for upload page */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Title Bar */
.title-bar {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(90deg, #dc2626, #fbbf24, #dc2626);
    border: 3px solid #fbbf24;
    border-radius: 12px;
    box-shadow: 
        0 0 20px rgba(220, 38, 38, 0.5),
        inset 0 0 20px rgba(251, 191, 36, 0.2);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

.title-bar h1 {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.5rem;
    color: #0d0c0c;
    text-shadow: 2px 2px 0px #fbbf24;
    margin: 0;
    letter-spacing: 2px;
}

@keyframes titleGlow {
    0% { box-shadow: 0 0 20px rgba(220, 38, 38, 0.5), inset 0 0 20px rgba(251, 191, 36, 0.2); }
    100% { box-shadow: 0 0 30px rgba(220, 38, 38, 0.8), inset 0 0 30px rgba(251, 191, 36, 0.4); }
}

/* Main content layout */
.main-content {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 0px;
    flex: 1;
}

.image-section {
    flex: 0 0 35%;
    animation: slideInLeft 0.8s ease-out;
}

.showdown-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 3px solid #fbbf24;
    box-shadow: 
        0 0 20px rgba(251, 191, 36, 0.4),
        0 0 40px rgba(220, 38, 38, 0.3);
    transition: all 0.3s ease;
    animation: imagePulse 3s ease-in-out infinite;
}

.showdown-image:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 30px rgba(251, 191, 36, 0.6),
        0 0 60px rgba(220, 38, 38, 0.5);
}

@keyframes slideInLeft {
    0% { transform: translateX(-100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes imagePulse {
    0%, 100% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.4), 0 0 40px rgba(220, 38, 38, 0.3); }
    50% { box-shadow: 0 0 25px rgba(251, 191, 36, 0.6), 0 0 50px rgba(220, 38, 38, 0.4); }
}

/* Upload section */
.upload-section {
    flex: 0 0 60%;
    margin-bottom: 0;
    animation: slideInRight 0.8s ease-out 0.2s both;
}

@keyframes slideInRight {
    0% { transform: translateX(100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

.upload-area {
    border: 3px dashed #fbbf24;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(24, 24, 24, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 20px rgba(251, 191, 36, 0.3),
        inset 0 0 20px rgba(220, 38, 38, 0.1);
}

.upload-area:hover {
    border-color: #f59e0b;
    background: rgba(24, 24, 24, 0.9);
    box-shadow: 
        0 0 30px rgba(255, 200, 100, 0.5),
        0 0 40px rgba(220, 38, 38, 0.3),
        inset 0 0 30px rgba(220, 38, 38, 0.2);
    transform: scale(1.02);
}

.upload-area.dragover {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    box-shadow: 
        0 0 40px rgba(220, 38, 38, 0.6),
        inset 0 0 40px rgba(220, 38, 38, 0.3);
}

/* Shared heading styles for upload and arena sections */
.upload-content h3,
.samples h3 {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    color: #fbbf24;
    margin-bottom: 20px;
    font-weight: normal;
    text-shadow: 2px 2px 0px #dc2626;
    line-height: 1.4;
}

.upload-icon-container {
    margin-bottom: 20px;
    animation: coinSlotPulse 2s ease-in-out infinite;
}

.coin-slot {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: coinSpin 3s linear infinite;
}

.insert-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7rem;
    color: #fbbf24;
    text-shadow: 1px 1px 0px #dc2626;
    letter-spacing: 1px;
}

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

@keyframes coinSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.upload-content p {
    color: #fbbf24;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0px #dc2626;
}

.file-size {
    color: #f59e0b !important;
    font-size: 1rem !important;
    margin-bottom: 20px !important;
}

/* Shared button styles for analyze and arena buttons */
.analyze-btn,
.sample-btn {
    background: linear-gradient(to bottom, #fbbf24, #d97706);
    border: 2px solid #fbbf24;
    border-radius: 8px;
    padding: 12px 20px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    color: #0d0c0c;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 0px #fbbf24;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0px rgba(255, 255, 255, 0.2);
    animation: buttonGlow 2s ease-in-out infinite alternate;
}

.analyze-btn:hover,
.sample-btn:hover {
    background: linear-gradient(to bottom, #f59e0b, #b45309);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(251, 191, 36, 0.5),
        inset 0 1px 0px rgba(255, 255, 255, 0.3);
}

@keyframes buttonGlow {
    0% { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0px rgba(255, 255, 255, 0.2); }
    100% { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 15px rgba(251, 191, 36, 0.3), inset 0 1px 0px rgba(255, 255, 255, 0.2); }
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title-bar h1 {
        font-size: 1rem;
        letter-spacing: 1px;
    }
    
    .main-content {
        flex-direction: column;
        gap: 30px;
        align-items: center;
    }
    
    .image-section {
        flex: 0 0 auto;
        width: 100%;
        max-width: 300px;
    }
    
    .right-column {
        width: 100%;
    }
    
    .upload-section {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .upload-area {
        padding: 30px 15px;
        min-height: 250px;
        background: rgba(24, 24, 24, 0.9);
    }
    
    .upload-content h3,
    .samples h3 {
        font-size: 0.7rem;
        line-height: 1.3;
    }
    
    .coin-slot {
        font-size: 2.5rem;
    }
    
    .insert-text {
        font-size: 0.6rem;
    }
    
    .upload-content p {
        font-size: 1rem;
    }
    
    .analyze-btn,
    .sample-btn {
        font-size: 0.5rem;
        padding: 10px 16px;
    }
}

/* ===== ARENA SELECTION STYLES ===== */

/* Arena section reuses upload section styling */
.samples {
    margin-top: 2rem;
    border: 2px dashed #f59e0b;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(24, 24, 24, 0.8);
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 20px rgba(251, 191, 36, 0.3),
        inset 0 0 20px rgba(220, 38, 38, 0.1);
    animation: slideInRight 0.8s ease-out 0.4s both;
    transition: all 0.3s ease;
}

.samples:hover {
    border-color: #f59e0b;
    background: rgba(24, 24, 24, 0.9);
    box-shadow: 
        0 0 30px rgba(255, 200, 100, 0.5),
        0 0 40px rgba(220, 38, 38, 0.3),
        inset 0 0 30px rgba(220, 38, 38, 0.2);
    transform: scale(1.02);
}

.arena-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.sample-btn {
    min-width: 140px;
}

.sample-btn .emoji {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.3rem;
}

.sample-btn .title {
    font-weight: bold;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.sample-btn .description {
    font-size: 0.5rem;
    opacity: 0.8;
    font-style: italic;
}

/* Arena loading animation */
.arena-loading {
    position: relative;
    pointer-events: none;
}

.arena-loading::after {
    content: '⚔ LOADING ARENA...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fcd34d;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.6rem;
    z-index: 1000;
    animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Footer text styling */
.footer-text {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    color: #f59e0b;
    opacity: 0.8;
    line-height: 1.6;
    text-shadow: 1px 1px 0px rgba(220, 38, 38, 0.5);
    background: rgba(24, 24, 24, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Version footer styling */
.version-footer {
    text-align: center;
    margin-top: 20px;
    padding: 12px 20px;
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    color: #f59e0b;
    opacity: 0.7;
    line-height: 1.6;
    text-shadow: 1px 1px 0px rgba(220, 38, 38, 0.5);
    background: rgba(24, 24, 24, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.version-text {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.version-text span:not(:last-child) {
    display: inline-flex;
    align-items: center;
}

