:root {
    --primary-green: #4a9b5e;
    --light-green: #6db87a;
    --dark-green: #2d5c3a;
    --accent-green: #7bc88f;
    --soft-white: #fafafa;
    --warm-gray: #f5f5f5;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --success: #27ae60;
    --warning: #f39c12;
    --gradient: linear-gradient(135deg, var(--primary-green), var(--light-green));
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--soft-white);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Welcome Screen Styles */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

.welcome-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.welcome-animation {
    display: flex;
    gap: 20px;
    align-items: center;
}

.word {
    font-size: 4rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(30px);
    animation: wordAppear 0.8s ease-out forwards;
}

.word-1 {
    animation-delay: 0.2s;
}

.word-2 {
    animation-delay: 0.6s;
    color: #fff700;
}

.word-3 {
    animation-delay: 1.0s;
}

@keyframes wordAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main App Styles */
.main-app {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out;
}

.main-app:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

.hidden {
    display: none !important;
}

/* Header Navigation */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    padding: 0;
}

.nav-tabs {
    display: flex;
    overflow-x: auto;
    padding: 0 20px;
    gap: 8px;
    justify-content: center;
    min-height: 70px;
    align-items: center;
}

.nav-tab {
    background: none;
    border: none;
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    transition: all 0.3s ease;
    border-radius: 12px;
    min-width: 100px;
    cursor: pointer;
    flex: 1;
    max-width: 140px;
}

.nav-tab:hover {
    background: var(--warm-gray);
    color: var(--primary-green);
}

.nav-tab.active {
    background: var(--gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(74, 155, 94, 0.3);
}

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

.nav-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.section.active {
    display: block;
}

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

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    color: var(--primary-green);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Welcome Card */
.welcome-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-section h2 {
    color: var(--primary-green);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.tagline {
    font-size: 1.3rem;
    color: var(--light-green);
    font-weight: 500;
    margin-bottom: 20px;
}

.welcome-text {
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 20px;
}

.go-message {
    font-size: 1.4rem;
    color: var(--primary-green);
    font-weight: 600;
}

/* Today's Featured Items */
.today-meal, .today-workout {
    background: var(--warm-gray);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.today-meal h3, .today-workout h3 {
    color: var(--primary-green);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 155, 94, 0.4);
}

/* Routine Section */
.routine-category {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.routine-category h3 {
    color: var(--primary-green);
    font-size: 1.4rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.habit-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.habit-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: var(--warm-gray);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.habit-item:hover {
    background: #e8f5ea;
    transform: translateX(5px);
}

.habit-checkbox {
    display: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid var(--light-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.habit-checkbox:checked + .checkmark {
    background: var(--success);
    border-color: var(--success);
}

.habit-checkbox:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.habit-content {
    flex: 1;
}

.habit-content strong {
    color: var(--text-dark);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 5px;
}

.habit-content small {
    color: var(--text-light);
    line-height: 1.5;
}

/* Progress Summary */
.progress-summary {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.progress-summary h3 {
    color: var(--primary-green);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    width: 0%;
    transition: width 0.8s ease;
    border-radius: 6px;
}

#progressText {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1.1rem;
}

/* Meal Plan Styles */
.meal-plan {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.day-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.day-card:hover {
    transform: translateY(-5px);
}

.day-card h3 {
    color: var(--primary-green);
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
    border-bottom: 2px solid var(--light-green);
    padding-bottom: 8px;
}

.meal-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meal {
    padding: 12px;
    background: var(--warm-gray);
    border-radius: 8px;
    border-left: 4px solid var(--accent-green);
}

.meal strong {
    color: var(--primary-green);
}

.swap-options {
    margin-top: 8px;
    padding: 8px;
    background: #fff;
    border-radius: 6px;
    border: 1px dashed var(--light-green);
}

.swap-options small {
    color: var(--text-light);
    font-style: italic;
}

/* Grocery List Styles */
.grocery-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.grocery-category {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.grocery-category h3 {
    color: var(--primary-green);
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.grocery-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.grocery-list label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.grocery-list label:hover {
    background: var(--warm-gray);
}

.grocery-list input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-green);
}

.grocery-list input[type="checkbox"]:checked + span {
    text-decoration: line-through;
    color: var(--text-light);
}

/* Workout Plan Styles */
.workout-plan {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.workout-day {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.workout-day h3 {
    color: var(--primary-green);
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 600;
    border-bottom: 2px solid var(--light-green);
    padding-bottom: 10px;
}

.workout-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-style: italic;
}

.workout-exercises {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.exercise {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--warm-gray);
    border-radius: 10px;
    border-left: 4px solid var(--accent-green);
}

.exercise strong {
    color: var(--text-dark);
    font-size: 1.1rem;
}

.exercise span {
    color: var(--text-light);
    font-weight: 500;
}

/* Detailed Exercise Styles */
.exercise-detailed {
    background: var(--warm-gray);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--accent-green);
    transition: all 0.3s ease;
}

.exercise-detailed:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.exercise-header {
    margin-bottom: 10px;
}

.exercise-header strong {
    color: var(--primary-green);
    font-size: 1.2rem;
    font-weight: 600;
}

.previous-workout {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 15px;
    font-style: italic;
}

.prev-data {
    color: var(--text-dark);
    font-weight: 500;
}

.weight-inputs {
    margin-top: 10px;
}

.weight-inputs > label {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 10px;
}

.sets {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.set {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.set label {
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 500;
}

.weight-input {
    width: 70px;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.weight-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 5px rgba(74, 155, 94, 0.3);
}

.weight-input:not(:placeholder-shown) {
    background: #e8f5ea;
    border-color: var(--success);
}

.weight-input.completed {
    background: #e8f5ea;
    border-color: var(--success);
    font-weight: 600;
}

/* Collapsible Workout Styles */
.workout-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    transition: color 0.3s ease;
}

.workout-header:hover {
    color: var(--accent-green);
}

.collapse-icon {
    transition: transform 0.3s ease;
    color: var(--text-light);
}

.workout-header:hover .collapse-icon {
    color: var(--accent-green);
}

.workout-day[data-day] .collapse-icon.rotated {
    transform: rotate(180deg);
}

.workout-content {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    max-height: 2000px;
    opacity: 1;
}

.workout-content.collapsed {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

/* Tracker Styles */
.tracker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.tracker-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    text-align: center;
}

.tracker-card h3 {
    color: var(--primary-green);
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-green);
    display: block;
}

.stat-label {
    color: var(--text-light);
    font-size: 1rem;
}

.rating-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.rating-btn {
    background: none;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rating-btn:hover, .rating-btn.active {
    border-color: var(--primary-green);
    background: var(--primary-green);
    transform: scale(1.1);
}

.goal-checklist {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.goal-checklist label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.goal-checklist input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-green);
}

.milestone-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.streak-counter {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-green);
    margin-top: 15px;
}

/* FAQ Styles */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.faq-question {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--warm-gray);
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: #e8f5ea;
}

.faq-question h4 {
    color: var(--primary-green);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.faq-question i {
    color: var(--primary-green);
    transition: transform 0.3s ease;
}

.faq-item.open .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.open .faq-answer {
    padding: 20px;
    max-height: 200px;
}

.faq-answer p {
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-tabs {
        justify-content: center;
        padding: 0 15px;
        min-height: 65px;
    }
    
    .nav-tab {
        min-width: 85px;
        padding: 15px 12px;
        max-width: none;
        flex: 1;
    }
    
    .nav-text {
        font-size: 0.8rem;
    }
    
    .nav-icon {
        font-size: 1.4rem;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .welcome-animation {
        flex-direction: column;
        gap: 10px;
    }
    
    .word {
        font-size: 2.5rem;
    }
    
    .hero-section h2 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1.1rem;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .exercise {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .rating-buttons {
        gap: 10px;
    }
    
    .rating-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .sets {
        gap: 10px;
    }

    .weight-input {
        width: 60px;
        padding: 6px;
    }

    .exercise-detailed {
        padding: 15px;
    }

    .workout-day {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .nav-tabs {
        overflow-x: scroll;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .welcome-card {
        padding: 20px;
    }
    
    .routine-category, .tracker-card, .workout-day {
        padding: 20px;
    }
    
    .habit-item {
        padding: 12px;
    }
    
    .word {
        font-size: 2rem;
    }
}

/* Animation for completed habits */
.habit-item.completed {
    background: #e8f5ea;
    border-left: 4px solid var(--success);
}

.habit-item.completed .habit-content {
    opacity: 0.8;
}

/* Pulse animation for motivation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.milestone-icon {
    animation: pulse 2s infinite;
}

/* Smooth transitions for all interactive elements */
button, .nav-tab, .habit-item, .day-card, .tracker-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus styles for accessibility */
button:focus, .nav-tab:focus, input:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--light-green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green);
}
