:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --dark-color: #1a535c;
    --light-color: #f7fff7;
    --smash-color: #ff6b6b;
    --pass-color: #4ecdc4;
    --neutral-color: #ffe66d;
    --bg-color: #f5f7fa;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --text-color: #1a535c;
    --container-bg: white;
    --container-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --subtitle-color: #666;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--container-bg);
    border-radius: 12px;
    box-shadow: var(--container-shadow);
    padding: 30px;
    overflow: hidden;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: var(--dark-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--subtitle-color);
    font-size: 1.1rem;
}

.disclaimer {
    background-color: #fff8e1;
    border-left: 4px solid var(--neutral-color);
    padding: 15px;
    margin-bottom: 30px;
    border-radius: 4px;
    position: relative;
}

.disclaimer p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.disclaimer strong {
    color: #d32f2f;
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--dark-color);
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    margin-bottom: 30px;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(255, 107, 107, 0.05);
}

.upload-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    color: #999;
    width: 64px;
    height: 64px;
}

.upload-area:hover .upload-icon {
    color: var(--primary-color);
}

.upload-btn {
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
}

.result-container {
    margin-top: 30px;
}

.image-preview-container {
    max-height: 300px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#image-preview {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.result {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.verdict-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

#verdict {
    font-size: 1.8rem;
}

#verdict-icon {
    font-size: 2.5rem;
}

#explanation {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none;
}

/* Smash and Pass specific styles */
.smash {
    background-color: rgba(255, 107, 107, 0.1);
    border: 2px solid var(--smash-color);
}

.pass {
    background-color: rgba(78, 205, 196, 0.1);
    border: 2px solid var(--pass-color);
}

.ai-preferences {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.preference-input {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preference-input label {
    margin-bottom: 8px;
    font-weight: bold;
}

.preference-input input {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
    background-color: var(--container-bg);
    color: var(--text-color);
    transition: border-color 0.3s, background-color 0.3s, color 0.3s;
}

.preference-input input.error {
    border-color: #d32f2f;
    animation: shake 0.4s;
}

.preference-input input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.preference-input input.error:focus {
    border-color: #d32f2f;
}

.error-message {
    color: #d32f2f;
    font-size: 0.9rem;
    margin-top: 5px;
}

.ai-type-selector {
    margin-bottom: 30px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

.ai-type-selector p {
    margin-bottom: 10px;
    font-weight: bold;
}

.ai-type-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
}

.ai-type-option {
    min-width: 140px;
    display: flex;
    flex-direction: column;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-type-option:hover {
    border-color: var(--primary-color);
}

.ai-type-option input {
    position: absolute;
    opacity: 0;
}

.ai-type-option input:checked + .ai-type-name {
    color: var(--primary-color);
}

.ai-type-option input:checked ~ * {
    font-weight: 500;
}

.ai-type-option input:checked + .ai-type-name::before {
    content: "✓ ";
}

.ai-type-name {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.ai-type-desc {
    font-size: 0.9rem;
    color: var(--subtitle-color);
}

/* Dark mode styles */
.dark-mode {
    --bg-gradient: linear-gradient(135deg, #2d3436 0%, #1e272e 100%);
    --text-color: #f7fff7;
    --container-bg: #2d3436;
    --container-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --subtitle-color: #ccc;
}

.dark-mode .ai-type-selector {
    background-color: rgba(255, 255, 255, 0.05);
}

.dark-mode .ai-type-option {
    border-color: #444;
}

.dark-mode .preference-input input {
    border-color: #444;
}

/* Theme toggle */
.theme-toggle {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(30deg);
}

@media (max-width: 600px) {
    .ai-preferences {
        flex-direction: column;
        gap: 15px;
    }

    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 20px;
    }
    
    .theme-toggle {
        top: 20px;
        right: 20px;
    }
}