/* ================================
   KaloriKu - Main Stylesheet
   ================================ */

:root {
    --primary: #FF6B35;
    --primary-dark: #E55A2B;
    --secondary: #2EC4B6;
    --accent: #FFD166;
    --dark: #1A1A2E;
    --dark-light: #16213E;
    --success: #06D6A0;
    --danger: #EF476F;
    --light-bg: #F8F9FA;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Global */
body {
    font-family: 'Poppins', sans-serif;
    color: #333;
    background-color: var(--light-bg);
    padding-top: 72px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Gradient backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, #20a89d 100%);
}

.bg-gradient-dark {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
}

/* Navbar */
.navbar {
    padding: 0.8rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 0.4rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #ff8c5a 50%, var(--accent) 100%);
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-top: -72px;
    padding-top: 72px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.95;
}

.hero-illustration {
    position: relative;
    z-index: 2;
}

.hero-stats {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-stats .stat-item {
    text-align: center;
}

.hero-stats .stat-number {
    font-size: 2rem;
    font-weight: 800;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

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

.btn-secondary-custom:hover {
    background-color: #20a89d;
    border-color: #20a89d;
    color: white;
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

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

.btn-lg {
    padding: 0.8rem 2rem;
    font-weight: 600;
    border-radius: 50px;
}

/* Cards */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.card-feature {
    text-align: center;
    padding: 2rem;
}

.card-feature .icon-box {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
}

.icon-box-orange {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 107, 53, 0.2));
    color: var(--primary);
}

.icon-box-teal {
    background: linear-gradient(135deg, rgba(46, 196, 182, 0.1), rgba(46, 196, 182, 0.2));
    color: var(--secondary);
}

.icon-box-yellow {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.1), rgba(255, 209, 102, 0.3));
    color: #e6a800;
}

.icon-box-green {
    background: linear-gradient(135deg, rgba(6, 214, 160, 0.1), rgba(6, 214, 160, 0.2));
    color: var(--success);
}

/* Section styling */
.section-padding {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
}

.section-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* Food Cards */
.food-card {
    border-radius: 12px;
    padding: 1rem;
    background: white;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.food-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.15);
}

.food-card .calories-badge {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Dashboard */
.dashboard-card {
    border-radius: 16px;
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.dashboard-card::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.dashboard-card .card-icon {
    font-size: 2.5rem;
    opacity: 0.3;
    position: absolute;
    right: 15px;
    top: 15px;
}

.calorie-progress {
    height: 12px;
    border-radius: 10px;
    overflow: hidden;
    background-color: #e9ecef;
}

.calorie-progress .progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Meal Section */
.meal-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
}

.meal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.meal-header .meal-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.meal-breakfast { background: linear-gradient(135deg, #FFE0B2, #FFCC80); color: #E65100; }
.meal-lunch { background: linear-gradient(135deg, #C8E6C9, #A5D6A7); color: #2E7D32; }
.meal-dinner { background: linear-gradient(135deg, #BBDEFB, #90CAF9); color: #1565C0; }
.meal-snack { background: linear-gradient(135deg, #F8BBD0, #F48FB1); color: #C2185B; }

/* Food log item */
.food-log-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f5f5f5;
}

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

/* Auth pages */
.auth-container {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.auth-card .form-control {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    font-size: 0.95rem;
}

.auth-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.15);
}

/* Admin Panel */
.admin-sidebar {
    background: var(--dark);
    min-height: calc(100vh - 72px);
    padding: 1.5rem;
}

.admin-sidebar .nav-link {
    color: #adb5bd;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.3rem;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(255, 107, 53, 0.15);
    color: var(--primary);
}

.admin-sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 8px;
}

.admin-content {
    padding: 2rem;
}

.stat-card {
    border-radius: 16px;
    padding: 1.5rem;
    background: white;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

/* Water tracker */
.water-glass {
    width: 40px;
    height: 50px;
    border: 2px solid #90CAF9;
    border-radius: 0 0 8px 8px;
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    margin: 0 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.water-glass.filled {
    background: linear-gradient(0deg, #42A5F5 0%, #90CAF9 100%);
}

.water-glass.filled::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
}

/* BMI indicator */
.bmi-scale {
    height: 20px;
    border-radius: 10px;
    background: linear-gradient(90deg, #42A5F5, #66BB6A, #FFA726, #EF5350);
    position: relative;
    margin: 1.5rem 0;
}

.bmi-marker {
    width: 4px;
    height: 30px;
    background: var(--dark);
    position: absolute;
    top: -5px;
    border-radius: 2px;
    transition: left 0.5s ease;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* Counter animation */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Floating shapes */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-section {
        min-height: 70vh;
        text-align: center;
    }

    .section-padding {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .admin-sidebar {
        min-height: auto;
    }

    .dashboard-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-stats {
        display: none;
    }

    .auth-card {
        padding: 1.5rem;
        margin: 0 1rem;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

/* Tables */
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background: var(--light-bg);
    border: none;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.table-modern tbody td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.table-modern tbody tr:hover {
    background-color: rgba(255, 107, 53, 0.03);
}

/* Badges */
.badge-success {
    background-color: var(--success);
}

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

/* Chart container */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Nutrient bars */
.nutrient-bar {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    overflow: hidden;
    margin-top: 4px;
}

.nutrient-bar .fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.nutrient-protein .fill { background: linear-gradient(90deg, #42A5F5, #1E88E5); }
.nutrient-carbs .fill { background: linear-gradient(90deg, #FFA726, #FB8C00); }
.nutrient-fat .fill { background: linear-gradient(90deg, #EF5350, #E53935); }

/* Pulse animation for CTA */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(255, 107, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0); }
}

/* Testimonial */
.testimonial-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.2;
    position: absolute;
    top: 10px;
    left: 20px;
    font-family: Georgia, serif;
}

/* Search box */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 2.5rem;
    border-radius: 50px;
    border: 2px solid #e9ecef;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.15);
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}

/* Modal styling */
.modal-content {
    border: none;
    border-radius: 16px;
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
}
