:root {
    --primary-start: #667eea;
    --primary-end: #764ba2;
    --primary-gradient: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow-color: rgba(102, 126, 234, 0.3);
    --light-bg: rgba(255, 255, 255, 0.95);
    --text-dark: #333;
    --text-light: #fff;
    --text-muted: #666;
    --border-radius-lg: 20px;
    --border-radius-md: 15px;
    --border-radius-sm: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: var(--text-dark);
}

.container {
    background: var(--light-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.title {
    font-size: 2.5rem;
    font-weight: bold;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-style: italic;
}

.ai-status {
    margin: 15px 0;
    padding: 10px;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    background: #d4edda;
    color: #155724;
    transition: all 0.3s ease;
}
.ai-status.error {
    background: #f8d7da;
    color: #721c24;
}

.photo-section { margin: 30px 0; }
.upload-area {
    border: 3px dashed #ccc;
    border-radius: var(--border-radius-md);
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-start);
    background: rgba(102, 126, 234, 0.05);
}

.photo-preview {
    width: 100%;
    max-width: 300px;
    height: 300px;
    border-radius: var(--border-radius-md);
    border: 3px solid var(--primary-start);
    object-fit: cover;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    margin: 0 auto;
    overflow: hidden;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.controls { margin: 20px 0; }

button {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.primary-btn {
    background: var(--primary-gradient);
    color: var(--text-light);
}
.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--shadow-color);
}
.primary-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.results {
    margin-top: 30px;
    padding: 25px;
    background: var(--secondary-gradient);
    border-radius: var(--border-radius-md);
    color: var(--text-light);
    display: none;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.vibe-score {
    font-size: 3rem;
    font-weight: bold;
    margin: 15px 0;
}

.meters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.meter {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    padding: 15px;
    text-align: left;
}

.meter-name { font-weight: bold; margin-bottom: 8px; }
.meter-bar {
    background: rgba(255, 255, 255, 0.3);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}
.meter-fill {
    height: 100%;
    background: var(--text-light);
    border-radius: 4px;
    transition: width 2s cubic-bezier(0.25, 1, 0.5, 1);
    width: 0%;
}

.category {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
}

.roast {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-sm);
    font-style: italic;
}

.mode-selector select {
    padding: 10px;
    border-radius: var(--border-radius-sm);
    border: none;
    background: #f0f0f0;
    font-size: 1rem;
    cursor: pointer;
}

/* Loader Styles */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: white;
    font-size: 1.2rem;
}
.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden { display: none !important; }