:root {
    --primary-color: #2e7d32;
    --primary-light: #4caf50;
    --primary-dark: #1b5e20;
    --secondary-color: #ff9800;
    --secondary-light: #ffb74d;
    --accent-color: #2196f3;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: white;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

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

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

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo span {
    font-size: 1rem;
    opacity: 0.9;
}

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

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    opacity: 0.9;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Navigation */
nav {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.nav-tabs {
    display: flex;
    list-style: none;
    overflow-x: auto;
}

.nav-tabs li {
    flex: 1;
    min-width: 150px;
}

.nav-tabs a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    text-decoration: none;
    color: var(--text-light);
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-tabs a i {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.nav-tabs a span {
    font-size: 0.9rem;
    font-weight: 600;
}

.nav-tabs a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: rgba(46, 125, 50, 0.05);
}

.nav-tabs a:hover {
    background-color: rgba(46, 125, 50, 0.05);
}

/* Main Content */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--primary-color);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

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

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

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

.btn-secondary:hover {
    background-color: #e68900;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: rgba(46, 125, 50, 0.1);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1.2rem;
    color: var(--primary-dark);
}

.card-body {
    margin-bottom: 20px;
}

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

.day-card {
    background-color: #f9f9f9;
    border-radius: var(--radius);
    padding: 15px;
    border-left: 4px solid var(--primary-color);
}

.day-card h4 {
    color: var(--primary-dark);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meal-item {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
    display: flex;
    justify-content: space-between;
}

.meal-item:last-child {
    border-bottom: none;
}

.meal-time {
    font-weight: 600;
    color: var(--text-color);
}

.meal-name {
    color: var(--text-light);
}

/* Shopping List */
.shopping-list {
    list-style: none;
}

.shopping-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.shopping-item:last-child {
    border-bottom: none;
}

.shopping-item.checked {
    opacity: 0.6;
    text-decoration: line-through;
}

.item-checkbox {
    margin-right: 15px;
    cursor: pointer;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
}

.item-details {
    display: flex;
    gap: 15px;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 5px;
}

.item-actions {
    display: flex;
    gap: 10px;
}

.item-actions button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s;
}

.item-actions button:hover {
    color: var(--primary-color);
}

/* Expense Tracking */
.expense-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.expense-card {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: var(--radius);
    text-align: center;
}

.expense-card h4 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.expense-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.expense-list {
    max-height: 300px;
    overflow-y: auto;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.expense-item:last-child {
    border-bottom: none;
}

.expense-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.expense-amount {
    font-weight: 600;
    color: var(--primary-dark);
}

/* Camera Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--primary-dark);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--primary-color);
}

.modal-body {
    padding: 20px;
}

.camera-container {
    width: 100%;
    height: 300px;
    background-color: #333;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
}

.camera-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.people-counter {
    display: flex;
    align-items: center;
    gap: 15px;
}

.counter-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

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

.counter-value {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

/* Recipe Suggestions */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.recipe-card {
    background-color: #f9f9f9;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s;
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.recipe-img {
    height: 150px;
    background-color: var(--border-color);
    background-size: cover;
    background-position: center;
}

.recipe-info {
    padding: 15px;
}

.recipe-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.recipe-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .nav-tabs {
        flex-wrap: wrap;
    }

    .nav-tabs li {
        min-width: 120px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .camera-controls {
        flex-direction: column;
    }

    .camera-controls .btn {
        width: 100%;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 2000;
    animation: slideIn 0.3s;
    max-width: 300px;
}

.toast.error {
    background-color: var(--danger-color);
}

.toast.success {
    background-color: var(--success-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Price Comparison */
.comparison-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comparison-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
}

.comparison-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.comparison-item.is-promo {
    border-color: var(--warning-color);
    background-color: rgba(255, 152, 0, 0.05);
}

.comp-store {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.comp-name {
    flex: 1;
    margin: 0 15px;
    font-size: 0.85rem;
    color: var(--text-color);
}

.comp-price {
    font-weight: 700;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.promo-badge {
    background-color: var(--warning-color);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.compare-price {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    transition: var(--transition);
}

.compare-price:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}
