:root {
    --primary: #4A90E2;
    --accent: #ACE1AF;
    --background: #FDFBF0;
    --sidebar: #FFFFFF;
    --text-main: #334155;
    --text-light: #64748b;
    --card-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --radius: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--sidebar);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4A90E2, #ACE1AF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar nav ul {
    list-style: none;
    flex-grow: 1;
}

.sidebar nav li {
    padding: 1rem 1.2rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.sidebar nav li:hover {
    background: #f8fafc;
    color: var(--primary);
}

.sidebar nav li.active {
    background: #eff6ff;
    color: var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 2.5rem;
    background: linear-gradient(135deg, #fdfbf0 0%, #f7fee7 100%);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.search-bar input {
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
    width: 300px;
    outline: none;
    transition: all 0.3s;
}

.search-bar input:focus {
    width: 350px;
    border-color: var(--primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.milestone-badge {
    background: #fef3c7;
    color: #d97706;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: var(--shadow);
}

/* Tab Management */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

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

/* Dashboard Widgets */
.welcome-section h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.carb { background: #dbeafe; }
.stat-icon.protein { background: #fee2e2; }
.stat-icon.vitamin { background: #dcfce7; }
.stat-icon.fat { background: #fef3c7; }

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.progress-bar {
    width: 100px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
}

/* Today Focus Content */
.today-focus {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 1.5rem;
}

.card {
    background: var(--sidebar);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.featured-recipe {
    background: linear-gradient(135deg, #4A90E2, #63b3ed);
    color: white;
}

.featured-recipe h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.featured-recipe .highlight {
    color: #ffd700;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
}

.btn-primary {
    background: white;
    color: var(--primary);
}

/* Menu Grid Styling */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.menu-day-card {
    background: white;
    padding: 1rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid transparent;
    transition: 0.3s;
}

.menu-day-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.day-label {
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 15px;
}

.meal-slot {
    margin-bottom: 15px;
}

.meal-slot h5 {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
}

.meal-name {
    font-size: 0.85rem;
    font-weight: 500;
    display: block;
    margin-top: 5px;
}

/* Recipes List */
.recipe-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.recipe-card {
    display: flex;
    gap: 20px;
    background: white;
    padding: 1rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    align-items: center;
}

.recipe-img {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
}

.tag {
    display: inline-block;
    padding: 3px 10px;
    background: #f1f5f9;
    font-size: 0.7rem;
    border-radius: 5px;
    margin-top: 5px;
}

/* Growth Chart Section */
.full-chart {
    height: 400px;
    margin-top: 2rem;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tip-item {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.tip-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Timeline Styling */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--primary);
    top: 0;
    bottom: 0;
    left: 20px;
}

.timeline-item {
    padding: 1rem 3rem;
    position: relative;
    background: white;
    margin-bottom: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: 0.3s;
}

.timeline-item:hover {
    transform: translateX(5px);
}

.timeline-item::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid var(--primary);
    left: -29px;
    top: 1.5rem;
    border-radius: 50%;
    z-index: 1;
}

.timeline-content h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.timeline-content .milestone-tags {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.milestone-tags span {
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Montessori Grid Styling */
.montessori-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.montessori-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-bottom: 5px solid var(--accent);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.montessori-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.montessori-card h4 {
    font-size: 1.2rem;
    color: var(--text-main);
}

.montessori-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
}

.difficulty-level {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
}

/* Diary Styling */
.diary-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#diary-input {
    width: 100%;
    height: 150px;
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    resize: none;
    transition: 0.3s;
}

#diary-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
}

.diary-actions {
    display: flex;
    gap: 1rem;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-main);
}

.diary-history {
    margin-top: 2rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 2rem;
}

.diary-entry {
    background: white;
    padding: 1.2rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.diary-entry small {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 600;
}

/* Month 6 Detailed Section */
.month6-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.routine-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 1.5rem;
}

.routine-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.routine-time {
    font-weight: 700;
    color: var(--primary);
    min-width: 70px;
}

.routine-activity {
    font-size: 0.95rem;
    font-weight: 500;
}

.week-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.week-detail-card {
    background: #fdfbf0;
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid #fde68a;
}

.week-detail-card h4 {
    color: #b45309;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.week-focus {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 10px;
}

.week-menu-list {
    list-style: none;
    font-size: 0.9rem;
}

.week-menu-list li {
    padding: 4px 0;
    display: flex;
    gap: 8px;
}

/* Feedback Section */
.feedback-input-group {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.feedback-input-group input, .feedback-input-group select {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    outline: none;
}

.feedback-input-group input { flex-grow: 1; }

.reaction-history {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 1rem;
}

.reaction-tag {
    background: white;
    padding: 8px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

/* Hub-and-Spoke Redesign */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.hub-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid transparent;
}

.hub-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 15px 45px rgba(74, 144, 226, 0.1);
}

.hub-icon {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.month6-icon { background: #fee2e2; }
.montessori-icon { background: #dcfce7; }
.roadmap-icon { background: #dbeafe; }
.menu-icon { background: #fef3c7; }
.diary-icon { background: #f3e8ff; }
.growth-icon { background: #ffe4e6; }

.hub-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--text-main);
}

.hub-info p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* Quick Stats Bar */
.quick-stats {
    margin-top: 3rem;
}

.mini-card {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    padding: 1rem 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
}

.mini-progress-group {
    display: flex;
    gap: 8px;
}

.mini-bar {
    width: 30px;
    height: 6px;
    border-radius: 10px;
}

.mini-bar.carb { background: var(--primary); }
.mini-bar.protein { background: #fee2e2; }
.mini-bar.vitamin { background: #dcfce7; }

/* Section Headers with Back Button */
.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 2rem;
}

.back-to-hub {
    background: #f1f5f9;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: 0.3s;
}

.back-to-hub:hover {
    background: #e2e8f0;
    color: var(--primary);
}

/* Tab Content Visibility Improvements */
.tab-content {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.tab-content.active {
    opacity: 1;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { width: 80px; padding: 1.5rem 0.5rem; }
    .logo h1, .nav-icon + span, .sidebar-footer { display: none; }
    .sidebar nav li { justify-content: center; }
}

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; flex-direction: row; }
    .hub-grid { grid-template-columns: 1fr; }
}
