:root {
    scroll-behavior: smooth;
    --fresh-green: #27ae60;
    --leafy-green: #2ecc71;
    --carrot-orange: #e67e22;
    --tomato-red: #e74c3c;
    --lemon-yellow: #f1c40f;
    --berry-blue: #3498db;
    --eggplant-purple: #8e44ad;
    --cream-bg: #fdfcfb;
    --mint-light: #f0f9f4;
    --forest-dark: #1b5e20;

    --primary: var(--fresh-green);
    --secondary: var(--carrot-orange);
    --success: var(--leafy-green);
    --danger: var(--tomato-red);
    --warning: var(--lemon-yellow);
    --info: var(--berry-blue);

    --card-shadow: 0 8px 30px rgba(39, 174, 96, 0.1);
    --card-shadow-hover: 0 15px 45px rgba(39, 174, 96, 0.15);
}

/* Global Styles */
body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, var(--mint-light) 0%, #e6f0e9 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #2c3e50;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    letter-spacing: -0.5px;
}

.navbar-logo {
    height: 48px;
    width: auto;
    margin-right: 12px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Cards */
.card {
    border: 1px solid rgba(39, 174, 96, 0.1);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 12px;
    border: 2px solid #edf2f7;
    padding: 0.75rem 1.2rem;
    transition: all 0.2s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--fresh-green);
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.15);
}

/* Buttons */
.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background-color: var(--fresh-green);
    border-color: var(--fresh-green);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--leafy-green);
    border-color: var(--leafy-green);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.1rem;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

/* Route Steps */
.route-step {
    position: relative;
    padding-left: 50px;
}

.route-step::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 40px;
    bottom: -20px;
    width: 2px;
    background-color: #dee2e6;
}

.route-step:last-child::before {
    display: none;
}

.step-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background-color: var(--fresh-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
}

/* Product Cards */
.product-item {
    background-color: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 5px solid var(--fresh-green);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.product-item.has-discount {
    border-left-color: var(--carrot-orange);
    background-color: #fffaf0;
}

/* Price Display */
.price-original {
    text-decoration: line-through;
    color: #95a5a6;
    font-size: 0.9rem;
}

.price-current {
    color: var(--forest-dark);
    font-weight: 700;
    font-size: 1.1rem;
}

.price-savings {
    color: var(--tomato-red);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Store Cards */
.store-card {
    transition: all 0.2s ease-in-out;
}

.store-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Metrics Cards */
.metric-card {
    text-align: center;
    padding: 20px;
}

.metric-card i {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--forest-dark);
}

.metric-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }

    .card-body {
        padding: 1rem;
    }

    .metric-card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .route-step {
        padding-left: 40px;
    }

    .step-number {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes hopping {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.spinning-rabbit {
    animation: hopping 0.6s infinite ease-in-out;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spinner-classic {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes fade-in-out {

    0%,
    100% {
        opacity: 0;
    }

    10%,
    90% {
        opacity: 1;
    }
}

@keyframes fade-out-up {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.fade-out-up {
    animation: fade-out-up 0.6s forwards ease-in-out;
}

.fade-prompt {
    animation: fade-in-out 5s infinite ease-in-out;
}

.zen-input {
    font-size: 1.25rem;
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    resize: none;
}

.zen-input:focus {
    box-shadow: 0 15px 40px rgba(39, 174, 96, 0.15);
    outline: none;
}

.slide-in {
    animation: slideIn 0.5s ease-out forwards;
}

/* Hop Loader */
@keyframes shimmer {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

@keyframes messageScale {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.hop-message-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 3rem;
    text-align: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.hop-message-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 2rem;
    line-height: 1.2;
    animation: shimmer 2s infinite ease-in-out;
}

.hop-message-subtext {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-top: 1rem;
    max-width: 600px;
}

.hop-step-animation {
    animation: messageScale 0.5s ease-out forwards;
}

/* Glassmorphism utility */
.glass {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Gradient backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--fresh-green) 0%, var(--leafy-green) 100%) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--leafy-green) 0%, var(--forest-dark) 100%) !important;
}

.bg-fresh-navbar {
    background: linear-gradient(90deg, var(--fresh-green) 0%, var(--leafy-green) 100%) !important;
}

/* Custom Badge Colors */
.badge-discount {
    background-color: var(--carrot-orange);
}

.badge-store {
    background-color: var(--fresh-green);
}

.badge-time {
    background-color: var(--berry-blue);
}

/* Footer */
footer {
    margin-top: auto;
}

/* Utility Classes */
.text-decoration-line-through {
    text-decoration: line-through;
}

.border-start-primary {
    border-left: 5px solid var(--fresh-green) !important;
}

.border-start-success {
    border-left: 5px solid var(--leafy-green) !important;
}

.bg-light-primary {
    background-color: rgba(39, 174, 96, 0.1) !important;
}

.bg-light-success {
    background-color: rgba(46, 204, 113, 0.1) !important;
}

/* Bootstrap Utility Overrides */
.text-primary {
    color: var(--fresh-green) !important;
}

.text-success {
    color: var(--leafy-green) !important;
}

.text-danger {
    color: var(--tomato-red) !important;
}

.text-warning {
    color: var(--lemon-yellow) !important;
}

.text-info {
    color: var(--berry-blue) !important;
}

.bg-primary {
    background-color: var(--fresh-green) !important;
}

.bg-success {
    background-color: var(--leafy-green) !important;
}

.border-primary {
    border-color: var(--fresh-green) !important;
}

.border-success {
    border-color: var(--leafy-green) !important;
}

.border-warning {
    border-color: var(--lemon-yellow) !important;
}

.border-info {
    border-color: var(--berry-blue) !important;
}

.border-secondary {
    border-color: var(--carrot-orange) !important;
}

.navbar-brand i {
    margin-right: 8px;
}

.card-title {
    font-weight: 700;
}

.lead {
    font-weight: 500;
    color: #4a5568 !important;
}

/* Offer Cards */
.offer-card {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
}

.offer-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.offer-image-container {
    width: 80px;
    height: 80px;
    min-width: 80px;
    padding: 10px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.zoomable-image {
    cursor: zoom-in;
}

.zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(39, 174, 96, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.offer-image-container:hover .zoom-overlay {
    opacity: 1;
}

.offer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.offer-image-placeholder {
    width: 80px;
    height: 80px;
    min-width: 80px;
    background: #f8f9fa;
    font-size: 1.5rem;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.opacity-90 {
    opacity: 0.9;
}

.tiny {
    font-size: 0.75rem;
}

/* Markdown & List Formatting */
.markdown-content p:last-child {
    margin-bottom: 0;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.tips-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.tips-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.tips-list li:last-child {
    margin-bottom: 0;
}

.tips-list li i {
    flex-shrink: 0;
    margin-top: 0.2rem;
}

/* Premium Button */
.btn-premium {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid var(--fresh-green);
    color: var(--fresh-green);
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-premium:hover,
.btn-premium:focus {
    background: var(--fresh-green);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.25);
}

.btn-premium i {
    transition: transform 0.3s ease;
}

.btn-premium:hover i {
    transform: scale(1.2) rotate(-10deg);
}

/* Premium Outline Button */
.btn-premium-outline {
    background: transparent;
    border: 2px solid var(--fresh-green);
    color: var(--fresh-green);
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-premium-outline:hover,
.btn-premium-outline:focus {
    background: var(--fresh-green);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.15);
}

.cursor-pointer {
    cursor: pointer;
}

/* Hide if zero savings */
.hide-if-zero {
    display: none !important;
}

/* For better list transitions */
.list-group-item {
    transition: background-color 0.2s ease;
}

.list-group-item:hover {
    background-color: rgba(39, 174, 96, 0.05) !important;
}

/* Map Container */
.map-card-container {
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: #f8f9fa;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.map-card-container:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: rgba(39, 174, 96, 0.3);
}

.map-iframe {
    width: 100%;
    height: 100%;
    border: none;
    filter: saturate(1.1) contrast(1.05);
}

/* Google Places Autocomplete (New) */
gmp-place-autocomplete {
    flex: 1 1 auto;
    display: flex;
    color-scheme: light;
    /* Force light theme colors internally */
    border: none !important;
    outline: none !important;
    padding-left: 5px;

}