/* ============================================
   H24 REZEPTGENERATOR - NORDIC INDUSTRIAL KITCHEN
   Premium Dashboard UI with Glass Morphism
   ============================================ */

/* CSS Variables */
:root {
    /* H24 Brand Colors */
    --h24-teal: #1FA6B8;
    --h24-teal-dark: #0F2F33;
    --h24-teal-light: #2CC5D9;
    --h24-lime: #C5D786;
    --h24-lime-dark: #9BB35A;

    /* Neutral Palette */
    --surface-dark: #0a1214;
    --surface-card: rgba(15, 47, 51, 0.6);
    --surface-glass: rgba(31, 166, 184, 0.08);
    --surface-hover: rgba(31, 166, 184, 0.15);

    /* Text Colors */
    --text-primary: #FBFCFC;
    --text-secondary: rgba(251, 252, 252, 0.7);
    --text-muted: rgba(251, 252, 252, 0.4);

    /* Status Colors */
    --success: #22C55E;
    --warning: #F59E0B;
    --error: #EF4444;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(31, 166, 184, 0.3);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --font-display: 'DM Sans', -apple-system, sans-serif;
    --font-mono: 'Space Mono', monospace;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-display);
    background: var(--surface-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Animated Background */
.login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--h24-teal), var(--h24-teal-dark));
    top: -150px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--h24-lime-dark), var(--h24-teal));
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--h24-teal-light), var(--h24-lime));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(-30px, -20px) scale(1.02); }
}

.noise-overlay {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: var(--space-lg);
}

.login-card {
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(31, 166, 184, 0.2);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: slideUp 0.6s ease-out;
}

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

/* Decorative Rings */
.deco-ring {
    position: absolute;
    border: 1px solid rgba(31, 166, 184, 0.15);
    border-radius: 50%;
    pointer-events: none;
}

.deco-ring-1 {
    width: 600px;
    height: 600px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 4s infinite ease-in-out;
}

.deco-ring-2 {
    width: 800px;
    height: 800px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 4s infinite ease-in-out 1s;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.1; transform: translate(-50%, -50%) scale(1.05); }
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.logo-mark {
    display: inline-block;
    margin-bottom: var(--space-md);
}

.logo-mark svg {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 4px 20px rgba(31, 166, 184, 0.4));
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xs);
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--h24-teal);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Flash Messages */
.flash-message {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.flash-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

.flash-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86EFAC;
}

.flash-icon {
    flex-shrink: 0;
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-md);
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.form-input {
    width: 100%;
    padding: var(--space-md) var(--space-md) var(--space-md) 48px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(31, 166, 184, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--h24-teal);
    box-shadow: 0 0 0 3px rgba(31, 166, 184, 0.15);
}

.form-input:focus + .input-icon,
.form-input:focus ~ .input-icon {
    color: var(--h24-teal);
}

.password-toggle {
    position: absolute;
    right: var(--space-md);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* Login Button */
.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--h24-teal), var(--h24-teal-dark));
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.login-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--h24-teal-light), var(--h24-teal));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.login-button:hover::before {
    opacity: 1;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 30px rgba(31, 166, 184, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-button > * {
    position: relative;
    z-index: 1;
}

.button-loader {
    display: flex;
    align-items: center;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Login Footer */
.login-footer {
    margin-top: var(--space-xl);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.login-footer .version {
    margin-top: var(--space-xs);
    font-family: var(--font-mono);
    color: var(--h24-teal);
}

/* ============================================
   DASHBOARD PAGE
   ============================================ */

.dashboard-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--surface-dark) 0%, #0d1a1d 100%);
}

/* Header */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(31, 166, 184, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-small svg {
    width: 40px;
    height: 40px;
}

.header-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(31, 166, 184, 0.15);
    border: 1px solid rgba(31, 166, 184, 0.3);
    border-radius: 100px;
    font-size: 0.625rem;
    color: var(--h24-teal);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--surface-glass);
    border-radius: 50%;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: #FCA5A5;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Main Content */
.dashboard-main {
    flex: 1;
    padding: var(--space-xl);
    overflow-y: auto;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: 300px 1fr;
    }
    .panel-preview {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Panels */
.panel {
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(31, 166, 184, 0.15);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: fadeIn 0.5s ease-out;
    animation-fill-mode: both;
}

.panel-scraper { animation-delay: 0.1s; }
.panel-config { animation-delay: 0.2s; }
.panel-preview { animation-delay: 0.3s; }

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

.panel-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(31, 166, 184, 0.1);
}

.panel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--h24-teal), var(--h24-teal-dark));
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

.panel-actions {
    display: flex;
    gap: var(--space-sm);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface-glass);
    border: 1px solid rgba(31, 166, 184, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.action-btn.action-primary {
    background: linear-gradient(135deg, var(--h24-teal), var(--h24-teal-dark));
    border-color: transparent;
    color: var(--text-primary);
}

.action-btn.action-primary:hover {
    box-shadow: 0 0 20px rgba(31, 166, 184, 0.3);
}

.panel-content {
    padding: var(--space-lg);
}

/* Scraper Panel */
.scraper-status {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: blink 2s infinite;
}

.status-idle .status-dot {
    background: var(--h24-lime);
    box-shadow: 0 0 10px var(--h24-lime);
}

.status-running .status-dot {
    background: var(--warning);
    box-shadow: 0 0 10px var(--warning);
    animation: pulse-dot 1s infinite;
}

.status-error .status-dot {
    background: var(--error);
    box-shadow: 0 0 10px var(--error);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.status-text {
    font-weight: 600;
    color: var(--text-primary);
}

.status-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Progress Section */
.progress-section {
    margin-bottom: var(--space-lg);
    animation: fadeIn 0.3s ease-out;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--h24-teal), var(--h24-lime));
    border-radius: 100px;
    transition: width var(--transition-normal);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-glow {
    position: absolute;
    top: 50%;
    right: 0;
    width: 20px;
    height: 20px;
    background: var(--h24-lime);
    border-radius: 50%;
    filter: blur(8px);
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.progress-bar.active .progress-glow {
    opacity: 0.6;
}

.progress-percent {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--h24-lime);
    min-width: 40px;
}

.progress-message {
    margin-top: var(--space-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Scraper Button */
.scraper-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--h24-teal), var(--h24-teal-dark));
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.scraper-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 30px rgba(31, 166, 184, 0.3);
}

.scraper-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* CSV List */
.csv-list {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(31, 166, 184, 0.1);
}

.list-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.csv-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.csv-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(31, 166, 184, 0.1);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.csv-item:hover {
    background: var(--surface-hover);
    border-color: var(--h24-teal);
}

.csv-item.active {
    background: var(--surface-hover);
    border-color: var(--h24-teal);
}

.csv-item-name {
    font-size: 0.875rem;
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.csv-item-count {
    font-size: 0.75rem;
    color: var(--h24-lime);
}

/* Skeleton Loader */
.skeleton-loader {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.skeleton-line {
    height: 36px;
    background: linear-gradient(90deg, rgba(31, 166, 184, 0.1) 25%, rgba(31, 166, 184, 0.2) 50%, rgba(31, 166, 184, 0.1) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-line.short {
    width: 60%;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Recipe Form */
.recipe-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.label-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--h24-lime);
}

/* Slider */
.slider-container {
    position: relative;
}

.slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 100px;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--h24-teal), var(--h24-teal-dark));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm), 0 0 10px rgba(31, 166, 184, 0.4);
    transition: transform var(--transition-fast);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--h24-teal), var(--h24-teal-dark));
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.slider-marks {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-xs);
    font-size: 0.625rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Meal Cards */
.meal-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.meal-card {
    position: relative;
    cursor: pointer;
}

.meal-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.meal-card .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(31, 166, 184, 0.15);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.meal-card:hover .card-content {
    background: var(--surface-hover);
}

.meal-card input:checked + .card-content {
    background: var(--surface-hover);
    border-color: var(--h24-teal);
    box-shadow: 0 0 20px rgba(31, 166, 184, 0.2);
}

.card-icon {
    font-size: 1.5rem;
}

.card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.meal-card input:checked + .card-content .card-label {
    color: var(--h24-teal);
}

/* Select */
.select-wrapper {
    position: relative;
}

.form-select {
    width: 100%;
    padding: var(--space-md);
    padding-right: 40px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(31, 166, 184, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all var(--transition-fast);
}

.form-select:focus {
    outline: none;
    border-color: var(--h24-teal);
    box-shadow: 0 0 0 3px rgba(31, 166, 184, 0.15);
}

.form-select option {
    background: var(--surface-dark);
    color: var(--text-primary);
}

.select-arrow {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Checkboxes */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.checkbox-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(31, 166, 184, 0.2);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.checkbox-box svg {
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-fast);
}

.checkbox-item:hover .checkbox-box {
    border-color: var(--h24-teal);
}

.checkbox-item input:checked + .checkbox-box {
    background: var(--h24-teal);
    border-color: var(--h24-teal);
}

.checkbox-item input:checked + .checkbox-box svg {
    opacity: 1;
    transform: scale(1);
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-item input:checked ~ .checkbox-label {
    color: var(--text-primary);
}

/* Generate Button */
.generate-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--h24-lime-dark), var(--h24-lime));
    border: none;
    border-radius: var(--radius-md);
    color: var(--h24-teal-dark);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-top: var(--space-md);
}

.generate-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 30px rgba(197, 215, 134, 0.3);
}

.generate-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.generate-button .btn-content,
.generate-button .btn-loader {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Preview Panel */
.preview-content {
    min-height: 400px;
    position: relative;
}

.preview-empty,
.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.empty-icon {
    margin-bottom: var(--space-md);
    opacity: 0.3;
}

.preview-empty h3 {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.preview-empty p {
    font-size: 0.875rem;
}

/* Loading Animation */
.loading-animation {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.loading-circle {
    width: 12px;
    height: 12px;
    background: var(--h24-teal);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-circle:nth-child(1) { animation-delay: -0.32s; }
.loading-circle:nth-child(2) { animation-delay: -0.16s; }
.loading-circle:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.preview-loading p {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.loading-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Markdown Preview */
.preview-markdown {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-primary);
    overflow-y: auto;
    max-height: 600px;
    padding-right: var(--space-sm);
}

.preview-markdown::-webkit-scrollbar {
    width: 6px;
}

.preview-markdown::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.preview-markdown::-webkit-scrollbar-thumb {
    background: var(--h24-teal);
    border-radius: 3px;
}

.preview-markdown h1,
.preview-markdown h2,
.preview-markdown h3 {
    color: var(--h24-teal);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-md);
}

.preview-markdown h1 { font-size: 1.5rem; }
.preview-markdown h2 { font-size: 1.25rem; }
.preview-markdown h3 { font-size: 1.125rem; }

.preview-markdown p {
    margin-bottom: var(--space-md);
}

.preview-markdown ul,
.preview-markdown ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}

.preview-markdown li {
    margin-bottom: var(--space-xs);
}

.preview-markdown strong {
    color: var(--h24-lime);
}

.preview-markdown code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.875em;
}

.preview-markdown hr {
    border: none;
    height: 1px;
    background: rgba(31, 166, 184, 0.2);
    margin: var(--space-lg) 0;
}

/* Recipe Images */
.recipe-images-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--space-xl);
    animation: fadeIn 0.5s ease-out;
}

.recipe-images-grid {
    display: grid;
    gap: var(--space-md);
    width: 100%;
    max-width: 800px;
}

.recipe-images-grid.images-1 {
    grid-template-columns: 1fr;
}

.recipe-images-grid.images-2 {
    grid-template-columns: repeat(2, 1fr);
}

.recipe-images-grid.images-3 {
    grid-template-columns: repeat(3, 1fr);
}

.recipe-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 2px solid var(--h24-teal);
    box-shadow: var(--shadow-md), 0 0 20px rgba(31, 166, 184, 0.15);
    aspect-ratio: 1;
}

.recipe-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.recipe-image-wrapper:hover .recipe-image {
    transform: scale(1.05);
}

.recipe-image-caption {
    margin-top: var(--space-md);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Legacy single image support */
.recipe-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--space-xl);
    animation: fadeIn 0.5s ease-out;
}

.recipe-image-container > .recipe-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--h24-teal);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(31, 166, 184, 0.2);
}

@media (max-width: 600px) {
    .recipe-images-grid.images-3 {
        grid-template-columns: 1fr;
    }
    .recipe-images-grid.images-2 {
        grid-template-columns: 1fr;
    }
}

/* History card with image thumbnail */
.history-card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    border: 1px solid rgba(31, 166, 184, 0.2);
}

.history-card-no-image {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* History Section */
.history-section {
    animation: fadeIn 0.5s ease-out 0.4s both;
}

.section-header {
    margin-bottom: var(--space-md);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

.history-empty {
    grid-column: 1 / -1;
    padding: var(--space-xl);
    text-align: center;
    color: var(--text-muted);
    background: var(--surface-card);
    border: 1px dashed rgba(31, 166, 184, 0.2);
    border-radius: var(--radius-lg);
}

.history-card {
    background: var(--surface-card);
    border: 1px solid rgba(31, 166, 184, 0.15);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.history-card:hover {
    border-color: var(--h24-teal);
    box-shadow: var(--shadow-md);
}

.history-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.history-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.history-card-badge {
    padding: 2px 8px;
    background: rgba(197, 215, 134, 0.15);
    border-radius: 100px;
    font-size: 0.625rem;
    color: var(--h24-lime);
    font-weight: 600;
}

.history-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.history-card-actions {
    display: flex;
    gap: var(--space-sm);
}

.history-card-actions .action-btn {
    flex: 1;
    justify-content: center;
}

/* Toast Container */
#toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    z-index: 1000;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(31, 166, 184, 0.2);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-success {
    border-color: rgba(34, 197, 94, 0.3);
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.3);
}

.toast-info {
    border-color: rgba(31, 166, 184, 0.3);
}

.toast-icon {
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }
.toast-info .toast-icon { color: var(--h24-teal); }

.toast-message {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: var(--space-md);
        padding: var(--space-md);
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .dashboard-main {
        padding: var(--space-md);
    }

    .panel-content {
        padding: var(--space-md);
    }

    .meal-cards {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    #toast-container {
        left: var(--space-md);
        right: var(--space-md);
    }

    .toast {
        max-width: none;
    }
}
