/* Custom CSS for Food Truck Fundraiser - Foodie Theme */
/* Warm, appetite-stimulating color scheme with modern foodie aesthetics */

/* Root variables for foodie theme */
:root {
    /* Primary Foodie Colors */
    --foodie-primary: #ff6b35;           /* Warm Orange - appetite stimulating */
    --foodie-secondary: #f7931e;         /* Golden Yellow - warmth & energy */
    --foodie-accent: #c8102e;            /* Deep Red - passion & urgency */
    --foodie-success: #4caf50;           /* Fresh Green - organic & healthy */
    --foodie-earth: #8b4513;             /* Rich Brown - comfort & stability */
    --foodie-cream: #fdf6e3;             /* Warm Cream - background warmth */
    
    /* Enhanced Styling */
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
    --transition-fast: 0.2s ease-in-out;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.15);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--foodie-primary) 0%, var(--foodie-secondary) 100%);
    --gradient-success: linear-gradient(135deg, var(--foodie-success) 0%, #66bb6a 100%);
    --gradient-warm: linear-gradient(135deg, #ff8a50 0%, #ff6b35 50%, #f7931e 100%);
}

/* Foodie-themed card enhancements */
.card {
    transition: all var(--transition-smooth);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    border: none;
    overflow: hidden;
    position: relative;
}

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

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.card:hover::before {
    opacity: 1;
}

/* Food truck themed cards */
.card.truck-card {
    background: linear-gradient(145deg, #fff 0%, #fefefe 100%);
}

.card.event-card {
    position: relative;
    background: linear-gradient(145deg, #fdfcfb 0%, #fff 100%);
}

.card.event-card::after {
    content: '🍴';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    opacity: 0.1;
    transition: opacity var(--transition-fast);
}

.card.event-card:hover::after {
    opacity: 0.3;
}

/* Foodie progress bar enhancements */
.progress {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    height: 12px;
    background: rgba(255, 107, 53, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    transition: width var(--transition-smooth);
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 35%, 
        rgba(255,255,255,0.3) 50%, 
        transparent 65%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== SUPPORT CHAT WIDGET STYLES ===== */

.support-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: system-ui, -apple-system, sans-serif;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-hover);
    transition: all var(--transition-smooth);
    position: relative;
    color: white;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.chat-toggle svg {
    width: 24px;
    height: 24px;
    stroke: white;
    fill: none;
    stroke-width: 2;
}

.chat-toggle::after {
    content: "🎧";
    position: absolute;
    font-size: 24px;
    display: none;
}

.chat-toggle:not(.has-icon)::after {
    display: block;
}

.chat-toggle:not(.has-icon) svg {
    display: none;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--foodie-accent);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-hover);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 107, 53, 0.1);
}

.chat-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: between;
    align-items: center;
}

.chat-header h6 {
    margin: 0;
    font-weight: 600;
    flex: 1;
}

.chat-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-chat-control {
    background: none;
    border: none;
    color: white;
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.btn-chat-control:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-chat-control svg {
    width: 16px;
    height: 16px;
}

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 350px;
}

.chat-message {
    max-width: 85%;
    animation: slideIn 0.3s ease-out;
}

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

.user-message {
    align-self: flex-end;
}

.ai-message, .admin-message {
    align-self: flex-start;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    color: #666;
}

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

.message-time {
    opacity: 0.7;
}

.message-content {
    padding: 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message .message-content {
    background: var(--gradient-primary);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.ai-message .message-content {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 0.25rem;
}

.admin-message .message-content {
    background: var(--gradient-success);
    color: white;
    border-bottom-left-radius: 0.25rem;
}

.typing-indicator .message-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 1rem;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #666;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.chat-input-container {
    border-top: 1px solid #e9ecef;
    background: white;
}

.escalation-banner {
    padding: 0.75rem;
    background: #fff3cd;
    border-bottom: 1px solid #ffeaa7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.escalation-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #856404;
}

.escalation-text svg {
    width: 16px;
    height: 16px;
}

.chat-input-area {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 1.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.chat-input-area input:focus {
    border-color: var(--foodie-primary);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.1);
}

.chat-input-area button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-input-area button:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.chat-input-area button svg {
    width: 16px;
    height: 16px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .support-chat-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .chat-window {
        width: calc(100vw - 30px);
        max-width: 350px;
        height: 450px;
    }
    
    .chat-toggle {
        width: 55px;
        height: 55px;
    }
    
    .chat-toggle svg {
        width: 22px;
        height: 22px;
    }
}

/* Special progress variants */
.progress-success .progress-bar {
    background: var(--gradient-success);
}

.progress-warning .progress-bar {
    background: linear-gradient(135deg, #ffa726 0%, #ff9800 100%);
}

/* Foodie-themed button enhancements */
.btn {
    transition: all var(--transition-fast);
    border-radius: var(--border-radius-lg);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary:hover {
    background: linear-gradient(135deg, #e55a2e 0%, #e0841a 100%);
    color: white;
}

.btn-success {
    background: var(--gradient-success);
    border: none;
}

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

.btn-outline-primary:hover {
    background: var(--foodie-primary);
    border-color: var(--foodie-primary);
    color: white;
    transform: translateY(-2px);
}

.btn-lg {
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
}

/* CTA Buttons */
.btn-cta {
    background: var(--gradient-warm);
    border: none;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 2rem;
    border-radius: var(--border-radius-xl);
}

.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
    color: white;
}

/* Form enhancements */
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Foodie badge enhancements */
.badge {
    font-weight: 600;
    border-radius: var(--border-radius-lg);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.bg-success {
    background: var(--gradient-success) !important;
    color: white;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ffa726 0%, #ff9800 100%) !important;
    color: white;
}

.badge.bg-primary {
    background: var(--gradient-primary) !important;
    color: white;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ef5350 0%, #e53935 100%) !important;
    color: white;
}

.badge.bg-info {
    background: linear-gradient(135deg, #42a5f5 0%, #2196f3 100%) !important;
    color: white;
}

/* Alert enhancements */
.alert {
    border: none;
    border-radius: var(--border-radius-lg);
}

/* Foodie navigation enhancements */
.navbar {
    background: linear-gradient(90deg, #2c3e50 0%, #34495e 100%) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    transition: all var(--transition-fast);
}

.navbar-brand:hover {
    color: var(--foodie-secondary) !important;
    transform: scale(1.05);
}

.navbar-brand i {
    color: var(--foodie-primary);
    margin-right: 0.5rem;
}

.nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--foodie-secondary) !important;
    transform: translateY(-1px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--foodie-primary);
    transition: all var(--transition-fast);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Foodie footer styling */
footer {
    margin-top: auto;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 3rem 0 2rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '🍴🚚🍕🌮🍔🍟🥗';
    position: absolute;
    top: 1rem;
    left: 0;
    right: 0;
    text-align: center;
    opacity: 0.1;
    font-size: 2rem;
    letter-spacing: 2rem;
    animation: foodFloat 10s linear infinite;
}

@keyframes foodFloat {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

footer h5 {
    color: var(--foodie-secondary);
    font-weight: 600;
    margin-bottom: 1rem;
}

footer p {
    opacity: 0.9;
    line-height: 1.6;
}

footer a {
    color: var(--foodie-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

footer a:hover {
    color: white;
}

/* Jumbotron-like styling for hero sections */
.jumbotron {
    border-radius: var(--border-radius-lg);
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-dark, #0056b3) 100%);
}

/* Custom utilities */
.text-shadow {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.border-dashed {
    border-style: dashed !important;
}

.bg-pattern {
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0);
    background-size: 20px 20px;
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Spinner overlay */
.spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Fade in animation for content */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Slide in animation for cards */
.slide-in {
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Enhanced table styling */
.table-hover tbody tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

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

::-webkit-scrollbar-track {
    background: var(--bs-dark);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-light);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .jumbotron {
        padding: 2rem !important;
    }
    
    .jumbotron h1 {
        font-size: 2rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    footer,
    .alert-dismissible .btn-close {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .progress {
        border: 1px solid #000 !important;
    }
    
    .progress-bar {
        background-color: #000 !important;
    }
}

/* Accessibility improvements */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus indicators */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border-width: 2px;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .progress {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Foodie theme adjustments for warm feel */
body {
    background: linear-gradient(145deg, #fefefe 0%, #f8f8f8 100%);
    color: #2c3e50;
    font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

/* Hero/Jumbotron sections */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3)), url('/static/images/food-truck-hero.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 4rem 0;
    border-radius: var(--border-radius-xl);
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

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

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

.hero-section h1 {
    font-weight: 700;
    font-size: 3rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-section p {
    font-size: 1.2rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
}

/* Stats cards */
.stats-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: all var(--transition-smooth);
    border-left: 4px solid var(--foodie-primary);
}

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

.stats-card .icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.stats-card h3 {
    color: var(--foodie-primary);
    font-weight: 700;
    font-size: 2.5rem;
    margin: 0.5rem 0;
}

.stats-card p {
    color: #666;
    margin: 0;
    font-weight: 500;
}

/* Stripe Elements styling to match theme */
.StripeElement {
    background-color: var(--bs-body-bg);
    padding: 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    transition: border-color var(--transition-fast);
}

.StripeElement:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.StripeElement--invalid {
    border-color: var(--bs-danger);
}

/* Menu item styling - enhanced for food appeal */
.menu-item {
    transition: all var(--transition-fast);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    margin: 0.5rem 0;
    border: 2px solid transparent;
    background: white;
    position: relative;
}

.menu-item:hover {
    background: linear-gradient(145deg, #fff9f5 0%, #fff 100%);
    border-color: var(--foodie-primary);
    transform: scale(1.02);
    box-shadow: var(--shadow-soft);
}

.menu-item::before {
    content: '🍽️';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0.1;
    font-size: 1.2rem;
    transition: opacity var(--transition-fast);
}

.menu-item:hover::before {
    opacity: 0.3;
}

.menu-item h5 {
    color: var(--foodie-earth);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.menu-item .price {
    color: var(--foodie-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.menu-item .description {
    color: #666;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Pledge buttons in menu items */
.menu-item .btn-pledge {
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-weight: 600;
    border-radius: var(--border-radius-lg);
    min-width: 140px;
    padding: 0.7rem 1.2rem;
}

.menu-item .btn-pledge:hover {
    background: linear-gradient(135deg, #e55a2e 0%, #e0841a 100%);
    transform: translateY(-2px);
    color: white;
}

/* Status indicators */
.status-pending { color: var(--bs-warning); }
.status-funded { color: var(--bs-success); }
.status-approved { color: var(--bs-primary); }
.status-completed { color: var(--bs-info); }
.status-cancelled { color: var(--bs-danger); }

/* Quick amount buttons */
.quick-amounts .btn {
    min-width: 60px;
}

/* Menu item pledge buttons */
.d-flex .btn-outline-primary.btn-sm {
    min-width: 120px;
    text-align: center;
    padding: 8px 12px;
    line-height: 1.2;
    white-space: normal;
    height: auto;
}

.d-flex .btn-outline-primary.btn-sm small {
    display: block;
    font-weight: bold;
    color: inherit;
}

/* Event card spacing */
.event-card .card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.event-card .mt-auto {
    margin-top: auto !important;
}

/* Toast notifications positioning */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}
