* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4CAF50;
    --secondary-color: #FF9800;
    --danger-color: #f44336;
    --background: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--background);
    padding-bottom: 70px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), #66BB6A);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* Main Content */
main {
    padding: 20px;
}

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 22px;
}

/* Select Groups */
.select-group {
    margin-bottom: 20px;
}

.select-group label {
    display: flex;
    align-items: center;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 16px;
}

.emoji {
    font-size: 20px;
    margin-right: 8px;
}

.menu-select {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.3s;
    cursor: pointer;
}

.menu-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Estilos para optgroup de alternativas */
optgroup {
    font-weight: 700;
    color: var(--secondary-color);
    font-style: normal;
}

optgroup option {
    font-weight: 400;
    padding-left: 10px;
    color: var(--text-primary);
}

/* Alternativas */
.alternativas-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px dashed var(--border-color);
}

.alternativas-section h3 {
    margin-bottom: 15px;
    color: var(--secondary-color);
    font-size: 18px;
}

.alternativas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.alternativa-card {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.alt-number {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    line-height: 24px;
    margin-bottom: 8px;
}

.alt-nombre {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--card-bg);
    padding: 8px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Add Section */
.add-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.add-section h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 18px;
}

.add-section input,
.add-section select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 12px;
}

.add-section input:focus,
.add-section select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-edit {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 8px 12px;
    font-size: 14px;
}

.btn-edit {
    background: var(--secondary-color);
    color: white;
    padding: 8px 12px;
    font-size: 14px;
    margin-right: 8px;
}

/* Lista Items */
.lista-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-card {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-info h4 {
    margin-bottom: 5px;
    font-size: 16px;
}

.item-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.item-actions {
    display: flex;
    gap: 8px;
}

/* Calendario Semanal */
.controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.controls button {
    flex: 1;
}

.calendario {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--shadow);
}

.dia-semana {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.dia-semana:last-child {
    border-bottom: none;
}

.dia-header {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.dia-header .emoji {
    margin-right: 8px;
}

.comida-item {
    margin-bottom: 10px;
}

.comida-item label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 600;
}

.comida-item select {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 600px;
    width: 100%;
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 5px 20px;
    transition: all 0.3s;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 12px;
    font-weight: 600;
}

/* Modal para edición */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons button {
    flex: 1;
}

/* Responsive */
@media (max-width: 480px) {
    header h1 {
        font-size: 24px;
    }
    
    .alternativas-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.item-card {
    animation: fadeIn 0.3s ease;
}
