:root {
    --noir-dark: #0a0e14;
    --noir-mid: #151b23;
    --noir-light: #1e2530;
    --banana-yellow: #FFD93D;
    --banana-glow: #FFE566;
    --accent-blue: #4A90D9;
    --rain-color: rgba(174, 194, 224, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--noir-dark);
    font-family: 'Source Sans 3', sans-serif;
    overflow-x: hidden;
}

.bg-noir-dark {
    background: var(--noir-dark);
}

/* Rain animation */
#rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

#rain-container::before,
#rain-container::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(180deg, var(--rain-color) 0%, transparent 50%),
        linear-gradient(180deg, var(--rain-color) 0%, transparent 50%);
    background-size: 2px 20px, 3px 30px;
    animation: rain 0.5s linear infinite;
    opacity: 0.3;
}

#rain-container::after {
    animation-delay: 0.25s;
    background-size: 1px 15px, 2px 25px;
}

@keyframes rain {
    0% { background-position: 0 0, 100px 0; }
    100% { background-position: 0 100px, 100px 150px; }
}

/* Header */
.header-noir {
    background: linear-gradient(180deg, var(--noir-mid) 0%, var(--noir-dark) 100%);
    border-bottom: 2px solid var(--banana-yellow);
    position: relative;
    z-index: 10;
}

.title-text {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    color: var(--banana-yellow);
    text-shadow: 
        0 0 20px rgba(255, 217, 61, 0.5),
        0 0 40px rgba(255, 217, 61, 0.3);
    letter-spacing: 2px;
}

.tagline {
    font-family: 'JetBrains Mono', monospace;
    color: #8899aa;
    font-style: italic;
}

/* Upload zone */
.upload-zone {
    border: 3px dashed rgba(255, 217, 61, 0.4);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--noir-light);
    min-height: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 217, 61, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.upload-zone:hover {
    border-color: var(--banana-yellow);
    background: rgba(255, 217, 61, 0.05);
}

.detective-ai-silhouette {
    margin-bottom: 2rem;
    opacity: 0.9;
    filter: drop-shadow(0 0 30px rgba(255, 217, 61, 0.4));
    animation: float 3s ease-in-out infinite;
}

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

.upload-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--banana-yellow) 0%, #f0c419 100%);
    color: #1a1a2e;
    border-radius: 10px;
    font-weight: bold;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.upload-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 217, 61, 0.5);
}

.upload-btn.secondary {
    background: var(--noir-mid);
    color: white;
    border: 2px solid var(--banana-yellow);
}

.upload-btn.secondary:hover {
    background: rgba(255, 217, 61, 0.2);
}

/* Options Panel */
.options-panel {
    background: var(--noir-light);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 217, 61, 0.2);
}

.focus-option {
    padding: 1rem;
    background: var(--noir-mid);
    border: 2px solid rgba(255, 217, 61, 0.2);
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.focus-option:hover {
    border-color: rgba(255, 217, 61, 0.5);
    background: rgba(255, 217, 61, 0.1);
}

.focus-option.active {
    border-color: var(--banana-yellow);
    background: rgba(255, 217, 61, 0.15);
    box-shadow: 0 0 15px rgba(255, 217, 61, 0.2);
}

.focus-label {
    font-weight: 600;
    color: white;
    font-size: 0.95rem;
}

.focus-desc {
    font-size: 0.75rem;
    color: #8899aa;
}

.custom-notes-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--noir-mid);
    border: 1px solid rgba(255, 217, 61, 0.3);
    border-radius: 8px;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.custom-notes-input:focus {
    outline: none;
    border-color: var(--banana-yellow);
    box-shadow: 0 0 10px rgba(255, 217, 61, 0.2);
}

.custom-notes-input::placeholder {
    color: #667788;
}

/* Image Display */
.image-display-area {
    position: relative;
}

.images-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.image-panel {
    flex: 1;
    min-width: 300px;
    background: var(--noir-light);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 217, 61, 0.2);
}

.image-panel.full {
    max-width: 800px;
    margin: 0 auto;
}

.image-panel.with-result {
    flex: 1 1 45%;
}

.panel-label {
    padding: 0.75rem 1rem;
    background: var(--noir-mid);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--banana-yellow);
    border-bottom: 1px solid rgba(255, 217, 61, 0.2);
    margin: 0;
}

.evidence-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 20, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 20;
}

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

.loading-message {
    font-family: 'JetBrains Mono', monospace;
    color: var(--banana-yellow);
    margin-top: 1.5rem;
    font-size: 1.1rem;
    animation: pulse-text 2s ease-in-out infinite;
}

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

.loading-bar {
    width: 200px;
    height: 4px;
    background: var(--noir-mid);
    border-radius: 2px;
    margin: 1.5rem auto 0;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--banana-yellow), var(--banana-glow));
    border-radius: 2px;
    animation: loading-slide 1.5s ease-in-out infinite;
}

@keyframes loading-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 2rem;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 12px;
    margin-top: 1rem;
}

.error-message p {
    color: #ff6b6b;
    margin: 0.5rem 0;
    font-family: 'JetBrains Mono', monospace;
}

.retry-btn {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: var(--noir-mid);
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.retry-btn:hover {
    background: rgba(220, 53, 69, 0.2);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.primary-btn {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--banana-yellow) 0%, #f0c419 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'JetBrains Mono', monospace;
}

.primary-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 217, 61, 0.5);
}

.investigate-btn {
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 217, 61, 0.3); }
    50% { box-shadow: 0 0 25px rgba(255, 217, 61, 0.6); }
}

.secondary-btn {
    padding: 0.75rem 1.5rem;
    background: var(--noir-mid);
    color: white;
    border: 2px solid var(--banana-yellow);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'JetBrains Mono', monospace;
}

.secondary-btn:hover {
    background: rgba(255, 217, 61, 0.2);
}

.danger-btn {
    padding: 0.75rem 1.5rem;
    background: var(--noir-mid);
    color: #ff6b6b;
    border: 2px solid rgba(220, 53, 69, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'JetBrains Mono', monospace;
}

.danger-btn:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
}

/* History Section */
.history-section {
    border-top: 1px solid rgba(255, 217, 61, 0.2);
    padding-top: 1.5rem;
}

.history-toggle {
    width: 100%;
    padding: 1rem;
    background: var(--noir-light);
    border: 1px solid rgba(255, 217, 61, 0.2);
    border-radius: 8px;
    color: var(--banana-yellow);
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.history-toggle:hover {
    background: rgba(255, 217, 61, 0.1);
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.history-item {
    position: relative;
    background: var(--noir-light);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 217, 61, 0.2);
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: var(--banana-yellow);
    transform: translateY(-2px);
}

.history-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.history-info {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.history-focus {
    font-size: 0.7rem;
}

.history-date {
    font-size: 0.65rem;
    color: #667788;
    font-family: 'JetBrains Mono', monospace;
}

.history-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(220, 53, 69, 0.8);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.history-item:hover .history-delete {
    opacity: 1;
}

/* Inception Easter Egg */
.inception-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 20, 0.98);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: inception-flash 0.5s ease-out;
}

@keyframes inception-flash {
    0% { background: rgba(255, 217, 61, 0.5); }
    100% { background: rgba(10, 14, 20, 0.98); }
}

.inception-content {
    text-align: center;
    animation: zoom-in 0.5s ease-out;
}

@keyframes zoom-in {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Nanobanana Icon */
.nanobanana-icon.dancing {
    animation: bananaDance 0.3s ease-in-out infinite;
}

@keyframes bananaDance {
    0%, 100% { transform: rotate(-10deg); }
    25% { transform: rotate(10deg) translateY(-5px); }
    50% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg) translateY(-5px); }
}

/* Footer */
.footer-noir {
    background: var(--noir-mid);
    border-top: 1px solid rgba(255, 217, 61, 0.2);
    position: relative;
    z-index: 10;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .title-text {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .upload-zone {
        padding: 2rem 1rem;
        min-height: 350px;
    }
    
    .images-container {
        flex-direction: column;
    }
    
    .image-panel {
        min-width: 100%;
    }
    
    .focus-options {
        grid-template-columns: 1fr !important;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
    
    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}