/* MENÚMAMI - Estilos Globales */
:root {
    --primary-color: #ee8c2b;
    --primary-hover: #d67820;
    --secondary-color: #4ecdc4;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;

    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);

    --radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #fef3e7 0%, #fff5eb 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #f59e0b 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: #e5e7eb;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-back:hover {
    color: var(--primary-color);
}

/* Navigation Cards */
.nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.nav-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.nav-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.nav-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.nav-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.nav-card-green {
    border-top: 4px solid #10b981;
}

.nav-card-orange {
    border-top: 4px solid var(--primary-color);
}

.nav-card-red {
    border-top: 4px solid #ef4444;
}

.nav-card-teal {
    border-top: 4px solid var(--secondary-color);
}

/* Stats Section */
.stats-section {
    margin-top: 2rem;
}

.stats-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.stat-label {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 1rem;
    font-weight: 600;
}

.menu-preview h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(238, 140, 43, 0.1);
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Recetas Grid */
.recetas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.receta-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
}

.receta-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.receta-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #fef3e7, #f59e0b);
}

.receta-content {
    padding: 1.5rem;
}

.receta-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.receta-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.receta-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    transition: var(--transition);
}

.icon-btn:hover {
    transform: scale(1.2);
}

.receta-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-Primero {
    background: #dcfce7;
    color: #166534;
}

.category-Plato.Único,
.category-Plato\ Único {
    background: #e0e7ff;
    color: #3730a3;
}

.category-Segundo {
    background: #fef3c7;
    color: #92400e;
}

.category-Postre {
    background: #fce7f3;
    color: #9f1239;
}

.category-Desayuno {
    background: #dbeafe;
    color: #1e40af;
}

.receta-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.receta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.tag {
    padding: 0.25rem 0.5rem;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Form Styles */
.receta-form {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.input-text,
.input-select,
.input-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.input-text:focus,
.input-select:focus,
.input-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(238, 140, 43, 0.1);
}

.input-textarea {
    resize: vertical;
}

/* Image Upload */
.image-upload {
    border: 3px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-upload:hover {
    border-color: var(--primary-color);
    background: #fef3e7;
}

.upload-placeholder {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.image-preview-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius);
}

/* Ingredientes List */
.ingredientes-list {
    margin-bottom: 1rem;
}

.ingrediente-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr auto;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.ingrediente-item input {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.btn-remove {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.btn-remove:hover {
    background: #fecaca;
}

/* Tags Selector */
.tags-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.tag-chip input {
    margin-right: 0.5rem;
}

.tag-chip:has(input:checked) {
    background: var(--primary-color);
    color: white;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Calendario */
.calendario-grid {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.calendario-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dia-header {
    text-align: center;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0.5rem;
}

.calendario-dias {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.dia-cell {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem;
    min-height: 150px;
    background: white;
    transition: var(--transition);
}

.dia-cell:hover {
    border-color: var(--primary-color);
    background: #fef3e7;
}

.dia-numero {
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.dia-comidas {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comida-item {
    background: linear-gradient(135deg, #fef3e7, #fff5eb);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    border-left: 3px solid var(--primary-color);
}

.comida-label {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

/* Reglas Form */
.reglas-form {
    max-width: 800px;
    margin: 0 auto;
}

.regla-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.regla-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.slider-group input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.slider-group span {
    font-weight: 700;
    color: var(--primary-color);
    min-width: 100px;
}

.limit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f9fafb;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.number-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.number-input button {
    width: 35px;
    height: 35px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    transition: var(--transition);
}

.number-input button:hover {
    background: var(--primary-hover);
}

.number-input input {
    width: 50px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem;
    font-weight: 700;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: var(--radius);
    transition: var(--transition);
}

.checkbox-label:hover {
    background: #f3f4f6;
}

.checkbox-label input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Generar View */
.generar-container {
    max-width: 600px;
    margin: 0 auto;
}

.generar-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.generar-card h3 {
    margin-bottom: 1rem;
}

.reglas-resumen {
    list-style: none;
    padding-left: 0;
}

.reglas-resumen li {
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    padding-left: 2rem;
    position: relative;
}

.reglas-resumen li::before {
    content: "✓";
    position: absolute;
    left: 0.75rem;
    color: var(--success-color);
    font-weight: 700;
}

.loader-container {
    text-align: center;
    padding: 3rem;
}

.loader {
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.menu-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 1.3rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .nav-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .nav-card {
        padding: 1.5rem 1rem;
    }

    .nav-card-icon {
        font-size: 2rem;
    }

    .nav-card h3 {
        font-size: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .recetas-grid {
        grid-template-columns: 1fr;
    }

    .view-header {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-bar {
        flex-direction: column;
    }

    .calendario-dias {
        grid-template-columns: 1fr;
    }

    .dia-cell {
        min-height: auto;
    }

    .ingrediente-item {
        grid-template-columns: 1fr;
    }

    .limit-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-large {
        width: 100%;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}