/* ============================================
   EcoEats Custom Styles
   Teammate A (Front-End Lead) owns this file
   ============================================ */

/* ---- Brand Colors ---- */
:root {
    --eco-green: #2E7D32;
    --eco-green-light: #4CAF50;
    --eco-green-dark: #1B5E20;
    --eco-bg: #F9FBF2;
}

/* ---- Global ---- */
body {
    background-color: var(--eco-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Navbar ---- */
.navbar-brand {
    font-size: 1.4rem;
}

/* ---- Product Cards ---- */
.card-img-top {
    height: 200px;
    object-fit: cover;
}

.card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* ---- Menu Card Animations (staggered entrance) ---- */
.card {
    opacity: 0;
    transform: translateY(16px);
    animation: cardFadeIn 0.4s ease forwards;
}

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.col-lg-4:nth-child(1)  .card { animation-delay: 0.05s; }
.col-lg-4:nth-child(2)  .card { animation-delay: 0.10s; }
.col-lg-4:nth-child(3)  .card { animation-delay: 0.15s; }
.col-lg-4:nth-child(4)  .card { animation-delay: 0.20s; }
.col-lg-4:nth-child(5)  .card { animation-delay: 0.25s; }
.col-lg-4:nth-child(6)  .card { animation-delay: 0.30s; }
.col-lg-4:nth-child(7)  .card { animation-delay: 0.35s; }
.col-lg-4:nth-child(8)  .card { animation-delay: 0.40s; }
.col-lg-4:nth-child(9)  .card { animation-delay: 0.45s; }
.col-lg-4:nth-child(10) .card { animation-delay: 0.50s; }
.col-lg-4:nth-child(11) .card { animation-delay: 0.55s; }
.col-lg-4:nth-child(12) .card { animation-delay: 0.60s; }

/* ---- Menu Card Fade Transition ---- */
.card-fade-enter-active {
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.card-fade-leave-active {
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.card-fade-enter-from {
    opacity: 0;
    transform: translateY(12px);
}
.card-fade-leave-to {
    opacity: 0;
    transform: translateY(-8px);
}
.card-fade-move {
    transition: transform 0.4s ease;
}

/* ---- Toast ---- */
.toast.show {
    opacity: 1;
}

/* ---- Footer ---- */
footer .text-muted {
    color: #adb5bd !important;
}

footer a {
    color: #cbd5e0 !important;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

footer a:hover {
    color: var(--eco-green-light) !important;
}

/* ---- Form validation ---- */
.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875rem;
}

.is-invalid ~ .invalid-feedback {
    display: block;
}

/* ---- Skip to content (accessibility) ---- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--eco-green);
    color: #fff;
    padding: 8px;
    z-index: 9999;
}
.skip-link:focus {
    top: 0;
}

/* ---- Responsive tweaks ---- */
@media (max-width: 576px) {
    .card-img-top {
        height: 150px;
    }
    h1 {
        font-size: 1.75rem;
    }
}

/* ---- Order Status Tracker ---- */
.status-tracker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 1.5rem;
}

.status-tracker::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 3px;
    background: #dee2e6;
    z-index: 0;
}

.status-tracker .progress-line {
    position: absolute;
    top: 20px;
    left: 0;
    height: 3px;
    background: #198754;
    z-index: 1;
    transition: width 0.6s ease;
}

.status-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    flex: 1;
}

.status-step .step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #6c757d;
    border: 3px solid #dee2e6;
    transition: all 0.3s ease;
}

.status-step.active .step-icon,
.status-step.completed .step-icon {
    background: #198754;
    border-color: #198754;
    color: white;
}

.status-step.cancelled .step-icon {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.status-step .step-label {
    font-size: 0.7rem;
    margin-top: 6px;
    color: #6c757d;
    text-align: center;
}

.status-step.active .step-label,
.status-step.completed .step-label {
    color: #198754;
    font-weight: 600;
}