/* Reset y variables CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores dark theme */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --bg-card: #1e1e1e;
    --bg-hover: #333333;
    
    /* Colores de acento */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    
    /* Colores de texto */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    --gradient-breakfast: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --gradient-lunch: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-dinner: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    
    /* Bordes */
    --border-radius: 16px;
    --border-radius-lg: 24px;
    
    /* Transiciones */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Contenedor principal */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0a 100%);
    position: relative;
}

.app-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.app-header {
    padding: 2rem 1rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo i {
    font-size: 3rem;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Contenido principal */
.app-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

.step-container {
    width: 100%;
    max-width: 800px;
}

.step-content {
    text-align: center;
}

.step-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

/* Botones de tiempo de comida */
.meal-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.meal-btn {
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.meal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: var(--transition);
    border-radius: var(--border-radius-lg);
}

.breakfast-btn::before {
    background: var(--gradient-breakfast);
}

.lunch-btn::before {
    background: var(--gradient-lunch);
}

.dinner-btn::before {
    background: var(--gradient-dinner);
}

.meal-btn:hover::before {
    opacity: 0.1;
}

.meal-btn:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-icon {
    font-size: 2.5rem;
    z-index: 1;
    position: relative;
}

.breakfast-btn .btn-icon {
    color: #f59e0b;
}

.lunch-btn .btn-icon {
    color: #10b981;
}

.dinner-btn .btn-icon {
    color: #6366f1;
}

.btn-text {
    z-index: 1;
    position: relative;
}

.btn-title {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.btn-subtitle {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Header del tiempo seleccionado */
.selected-meal-header {
    margin-bottom: 3rem;
}

.selected-meal-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

/* Loading */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 3rem;
}

.spinner {
    position: relative;
    width: 80px;
    height: 80px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    animation-delay: -0.5s;
    border-top-color: var(--accent-secondary);
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
}

.spinner-ring:nth-child(3) {
    animation-delay: -1s;
    border-top-color: var(--accent-success);
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Resultado */
.result-container {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--bg-tertiary);
    box-shadow: var(--shadow-lg);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
}

.result-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.result-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.meal-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.ingredients-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--bg-tertiary);
}

.ingredients-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ingredients-header i {
    color: var(--accent-primary);
}

.ingredients-text {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Botones de acción */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    min-width: 160px;
    justify-content: center;
}

.primary-btn {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.secondary-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--bg-hover);
}

.secondary-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        padding: 1.5rem 1rem;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 2.5rem;
    }
    
    .meal-buttons {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .meal-btn {
        padding: 1.5rem;
    }
    
    .btn-title {
        font-size: 1.3rem;
    }
    
    .step-title {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding: 1rem;
    }
    
    .result-card {
        padding: 1.5rem;
    }
    
    .meal-btn {
        padding: 1.2rem;
    }
    
    .btn-icon {
        font-size: 2rem;
    }
    
    .btn-title {
        font-size: 1.2rem;
    }
}

/* Efectos adicionales */
.meal-btn:active {
    transform: translateY(-4px) scale(0.98);
}

.action-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}