/* ========================================
   SCHOOL MEAL APP - MAIN STYLESHEET
   ======================================== */

/* ========================================
   ALLERGEN ICONS
   ======================================== */
.allergen-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%);
}

.allergen-tag .allergen-icon {
    filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(93deg) brightness(103%) contrast(103%);
}

.allergen-tag:hover .allergen-icon {
    filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(93deg) brightness(103%) contrast(103%);
}

/* ========================================
   UBER EATS-STYLE MEAL ORDERING PAGE
   ======================================== */

/* Mobile-First Header */
.mobile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none; /* Hide by default on desktop */
}

/* Show mobile header only on mobile devices */
@media (max-width: 768px) {
    .mobile-header {
        display: block;
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-button {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.header-title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.student-name {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.header-right {
    display: flex;
    align-items: center;
}

.search-button {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Budget Summary */
.budget-summary {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.budget-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.budget-label {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.budget-amount {
    font-size: 1.1rem;
    font-weight: 600;
}

.budget-amount.positive {
    color: #4ade80;
}

.budget-amount.negative {
    color: #f87171;
}

/* Child Selector */
.child-selector-container {
    background: white;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.child-selector-form {
    margin: 0;
}

.child-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.child-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
}

.child-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.child-select {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    color: #374151;
}

.child-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Search Bar */
.search-bar {
    background: white;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: #6b7280;
    font-size: 1.1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    background: #f9fafb;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.search-clear:hover {
    background-color: #f3f4f6;
}

/* Category Navigation */
.category-nav {
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-scroll {
    display: flex;
    gap: 0.75rem;
    padding: 0 1rem;
    min-width: max-content;
}

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 80px;
}

.category-btn:hover {
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
}

.category-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.category-btn i {
    font-size: 1.2rem;
}

.category-btn span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Date Selector */
.date-selector {
    background: white;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.date-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.date-btn {
    padding: 0.5rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.date-btn:hover {
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
}

.date-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.custom-days {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.custom-days-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
}

.custom-days-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.custom-days-btn {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.custom-days-btn:hover {
    background: #5a67d8;
}

/* Messages */
.messages-container {
    padding: 1rem;
    position: fixed;
    top: 60px; /* Below navbar */
    left: 0;
    right: 0;
    z-index: 100000; /* Above navbar */
    pointer-events: none; /* Allow clicks to pass through */
}

.message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    position: relative;
    pointer-events: auto; /* Allow interaction with message */
    max-width: calc(100vw - 2rem);
    margin-left: auto;
    margin-right: auto;
}

.message.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.alert-error,
.message.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.message.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.message.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.message-close {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.message-close:hover {
    background-color: rgba(0,0,0,0.1);
}

/* Meals Container */
.meals-container {
    padding: 1rem;
    background: #f9fafb;
    min-height: calc(100vh - 300px);
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ========================================
   MEALS GRID LAYOUT FIXES
   ======================================== */

/* Week Separator - should span full width */
.week-separator {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    margin: 1rem 0 0.5rem 0;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    width: calc(100% - 2rem);
    margin-left: 1rem;
    margin-right: 1rem;
    box-sizing: border-box;
}

.week-separator h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.week-separator i {
    font-size: 1.2rem;
}

/* Day Header - should span full width */
.day-header {
    grid-column: 1 / -1;
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-left: 4px solid #667eea;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: calc(100% - 2rem);
    margin-left: 1rem;
    margin-right: 1rem;
    box-sizing: border-box;
}

.day-header .day-label {
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
}

.meals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0 1rem;
}

/* Meal Card */
.meal-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    touch-action: pan-y pinch-zoom;
    user-select: none;
    /* Make cards flexible to accommodate content */
    min-height: auto;
    display: flex;
    flex-direction: column;
}

.meal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

.meal-image-container {
    position: relative;
    height: 180px;
    overflow: hidden;
    flex-shrink: 0;
}

.meal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.meal-card:hover .meal-image {
    transform: scale(1.05);
}

.meal-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 3rem;
}

.date-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.date-day {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1;
}

.date-month {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
    text-transform: uppercase;
}

.status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.status-badge.ordered {
    background: #10b981;
}

.status-badge.disabled {
    background: #f59e0b;
}

/* Meal Info */
.meal-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: auto; /* Allow content to expand */
    justify-content: space-between; /* Distribute content evenly */
}

.meal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.meal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.4; /* Increased line height for better spacing */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    margin-bottom: 0.5rem; /* Add bottom margin for spacing */
    flex-shrink: 0; /* Prevent title from shrinking */
}

.meal-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.meal-rating i {
    color: #10b981;
}

.meal-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.meal-variant {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.variant-regular {
    background: #fef3c7;
    color: #92400e;
}

.variant-vegetarian {
    background: #d1fae5;
    color: #065f46;
}

.meal-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
}

.meal-description {
    margin: 0 0 1rem 0;
    color: #6b7280;
    line-height: 1.5;
    font-size: 0.9rem;
    /* Remove flex: 1 to prevent description from taking all available space */
}

/* Order Button */
.order-form {
    margin: 0;
    margin-top: auto;
    flex-shrink: 0;
}

.order-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
}

.order-btn.available {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.order-btn.available:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.order-btn.ordered {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.order-btn.ordered:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

.meal-disabled {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Empty States */
.empty-state,
.error-state,
.no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
}

.empty-state-content,
.error-state-content,
.no-results-content {
    max-width: 400px;
}

.empty-state i,
.error-state i,
.no-results i {
    font-size: 4rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.empty-state h3,
.error-state h3,
.no-results h3 {
    margin: 0 0 0.5rem 0;
    color: #374151;
    font-size: 1.5rem;
}

.empty-state p,
.error-state p,
.no-results p {
    margin: 0;
    color: #6b7280;
    line-height: 1.5;
}

.error-state i {
    color: #f59e0b;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-header {
        padding: 0.75rem;
    }
    
    .header-title h1 {
        font-size: 1.25rem;
    }
    
    .budget-summary {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .category-scroll {
        padding: 0 0.75rem;
    }
    
    .category-btn {
        min-width: 70px;
        padding: 0.5rem 0.75rem;
    }
    
    .date-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-buttons {
        justify-content: center;
    }
    
    .custom-days {
        justify-content: center;
    }
    
    .meals-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
        max-width: 100%;
        overflow-x: hidden;
        width: 100%;
        box-sizing: border-box;
    }
    
    .week-separator {
        margin: 0.5rem 0.5rem 0.25rem 0.5rem;
        padding: 0.75rem;
        border-radius: 6px;
        width: calc(100% - 1rem);
    }
    
    .week-separator h4 {
        font-size: 1rem;
    }
    
    .day-header {
        margin: 0.25rem 0.5rem;
        padding: 0.5rem 0.75rem;
        border-radius: 0 6px 6px 0;
        width: calc(100% - 1rem);
    }
    
    .day-header .day-label {
        font-size: 0.9rem;
    }
    
    .meal-card {
        touch-action: none; /* Prevent all touch actions during swipe */
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        /* Remove aspect ratio constraint to allow flexible height */
    }
    
    .meal-info {
        padding: 1rem;
    }
    
    .meal-title {
        font-size: 1.1rem;
        line-height: 1.4; /* Increased line height for better spacing */
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        margin-bottom: 0.5rem; /* Add bottom margin for spacing */
        flex-shrink: 0; /* Prevent title from shrinking */
    }
    
    .order-btn {
        min-height: 44px;
    }
    
    .category-btn {
        min-height: 44px;
    }
    
    .meal-image-container {
        height: 160px;
    }
    
    .swipe-action {
        width: 70px;
        font-size: 0.8rem;
    }
    
    .swipe-action i {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .meal-card.swipe-right {
        transform: translateX(35px);
    }
    
    .meal-card.swipe-left {
        transform: translateX(-35px);
    }
    
    /* Prevent scroll when swiping */
    .meal-card.swiping {
        touch-action: none;
    }
    
    /* Add momentum scrolling to the container */
    .meals-container {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .meals-container {
        padding: 0.5rem;
    }
    
    .meals-grid {
        padding: 0 0.25rem;
        gap: 0.75rem;
    }
    
    .week-separator {
        padding: 0.5rem;
        margin: 0.25rem 0.25rem;
        width: calc(100% - 0.5rem);
    }
    
    .week-separator h4 {
        font-size: 0.9rem;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .day-header {
        padding: 0.4rem 0.6rem;
        margin: 0.25rem 0.25rem;
        width: calc(100% - 0.5rem);
    }
    
    .day-header .day-label {
        font-size: 0.85rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-left {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .budget-summary {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .category-scroll {
        gap: 0.5rem;
    }
    
    .category-btn {
        min-width: 60px;
        padding: 0.5rem;
    }
    
    .category-btn span {
        font-size: 0.7rem;
    }
    
    .date-buttons {
        gap: 0.25rem;
    }
    
    .date-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* ========================================
   PWA SPECIFIC STYLES
   ======================================== */
/* Prevent pull-to-refresh on mobile */
html, body {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* PWA installation prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    display: none;
    animation: slideUp 0.3s ease-out;
}

.pwa-install-prompt.show {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-install-prompt button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.pwa-install-prompt button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* Offline page styles */
.offline-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.offline-content {
    max-width: 600px;
    width: 100%;
}

.offline-icon {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.offline-title {
    color: #495057;
    margin-bottom: 1rem;
    font-weight: 600;
}

.offline-description {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.offline-features {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.offline-feature-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.offline-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.offline-feature-card i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.offline-feature-card h4 {
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.offline-feature-card p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

/* Mobile-specific enhancements */
@media (max-width: 768px) {
    .pwa-install-prompt {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        border-radius: 15px;
    }
    
    .offline-container {
        padding: 10px;
    }
    
    .offline-features {
        padding: 1.5rem;
    }
    
    .offline-feature-card {
        padding: 1rem;
    }
}

/* Touch-friendly buttons */
.btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Smooth animations */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================
   GLOBAL STYLES
   ======================================== */
body {
    background-color: #f8f9fa;
    color: #212529;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding-top: 50px; /* Account for fixed navbar */
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Ensure container doesn't cause horizontal overflow */
.container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

/* ========================================
   NAVBAR STYLES
   ======================================== */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    padding: 0;
    height: 50px;
    transition: all 0.3s ease;
    z-index: 99999 !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: auto !important;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Force navbar styling with higher specificity */
.navbar.navbar-expand-lg.navbar-dark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    padding: 0;
    transition: all 0.3s ease;
    z-index: 99999 !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: auto !important;
    overflow: hidden;
}

.navbar .container {
    pointer-events: auto !important;
}

.navbar-nav {
    pointer-events: auto !important;
}

.navbar-nav .nav-item {
    pointer-events: auto !important;
}

.navbar .container-fluid {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 1.25rem;
    overflow: hidden;
}

.navbar-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
}

.navbar-user i {
    font-size: 1.1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1rem;
    color: white !important;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    height: 50px;
    line-height: 1;
    position: relative;
    top: 0px;
}

/* Force navbar-brand styling with higher specificity */
.navbar-brand,
.navbar-dark .navbar-brand {
    font-weight: 700;
    font-size: 1rem;
    color: white !important;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 100000 !important;
    pointer-events: auto !important;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    height: 50px;
    line-height: 1;
    position: relative;
    top: 0px;
}

.navbar-brand:hover {
    color: rgba(255,255,255,0.9) !important;
    transform: translateY(-1px);
}

.navbar-brand i {
    margin-right: 8px;
    font-size: 1.8rem;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

/* Force nav-link styling with higher specificity */
.navbar-nav .nav-link,
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    z-index: 100000 !important;
    pointer-events: auto !important;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white !important;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
}

.navbar-toggler:focus {
    box-shadow: none;
    background: rgba(255,255,255,0.2);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Force navbar-toggler styling with higher specificity */
.navbar-dark .navbar-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    cursor: pointer;
    z-index: 100000 !important;
    pointer-events: auto !important;
}

.navbar-dark .navbar-toggler:focus {
    box-shadow: none;
    background: rgba(255,255,255,0.2);
}

.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}


/* ========================================
   NAVBAR BUTTONS & ELEMENTS
   ======================================== */
.btn-navbar {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    position: relative;
    z-index: 100000 !important;
    pointer-events: auto !important;
}

.btn-navbar:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-navbar-primary {
    background: white;
    color: #667eea;
    border: 1px solid white;
}

.btn-navbar-primary:hover {
    background: rgba(255,255,255,0.9);
    color: #667eea;
    border-color: white;
}

.user-info {
    background: rgba(255,255,255,0.1);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.2);
    pointer-events: auto !important;
    z-index: 100000 !important;
}

.language-switcher {
    margin-left: 0.5rem;
}

.language-switcher select {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 100000 !important;
    pointer-events: auto !important;
}

.language-switcher select:focus {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 0 0 0.2rem rgba(255,255,255,0.25);
    outline: none;
}

.language-switcher select option {
    background: #667eea;
    color: white;
}

/* ========================================
   DROPDOWN MENUS
   ======================================== */
.dropdown-menu {
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 0.5rem;
    z-index: 100001 !important;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    pointer-events: auto !important;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #2c3e50;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    pointer-events: auto !important;
    z-index: 100002 !important;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
}

/* ========================================
   HERO SECTIONS
   ======================================== */
.hero-section,
.login-hero-section,
.admin-hero-section,
.user-hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
    margin: 0 0 3rem 0;
    width: 100%;
    box-sizing: border-box;
}

.login-hero-section {
    padding: 80px 0;
}

.admin-hero-section,
.user-hero-section {
    padding: 80px 0;
}

.hero-section::before,
.login-hero-section::before,
.admin-hero-section::before,
.user-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content,
.login-hero-content,
.admin-hero-content,
.user-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title,
.login-hero-title,
.admin-hero-title,
.user-hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.login-hero-title {
    font-size: 2.5rem;
}

.admin-hero-title,
.user-hero-title {
    font-size: 3rem;
}

.hero-subtitle,
.login-hero-subtitle,
.admin-hero-subtitle,
.user-hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.login-hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 0;
}

.admin-hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 0;
}

.user-hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-hero {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-hero-primary {
    background: #fff;
    color: #667eea;
    border: 2px solid #fff;
}

.btn-hero-primary:hover {
    background: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.btn-hero-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.5);
    transition: all 0.3s ease;
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-hero-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
}

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

.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    color: white;
}

.btn-login:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* ========================================
   CARDS
   ======================================== */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
}

.card-header {
    border-radius: 8px 8px 0 0 !important;
    padding: 1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Feature Cards */
.feature-card,
.user-feature-card {
    background: white;
    border-radius: 15px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    border: none;
}

.feature-card:hover,
.user-feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.feature-icon,
.user-feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.feature-title,
.user-feature-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.feature-description,
.user-feature-description {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Admin Cards */
.admin-card {
    background: white;
    border-radius: 15px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    border: none;
    text-decoration: none;
    color: inherit;
    display: block;
}

.admin-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    text-decoration: none;
    color: inherit;
}

.admin-card-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.admin-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.admin-card-description {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Inactive Admin Card */
.admin-card-inactive {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
}

.admin-card-inactive:hover {
    transform: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.admin-card-icon-inactive {
    background: #6c757d !important;
    opacity: 0.7;
}

.admin-card-status {
    margin-top: 1rem;
}

/* Disabled Admin Card */
.admin-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
}

.admin-card.disabled:hover {
    transform: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.admin-card.disabled .admin-card-icon {
    background: #6c757d !important;
    opacity: 0.7;
}

.admin-card.disabled .admin-card-title {
    color: #6c757d;
}

.admin-card.disabled .admin-card-description {
    color: #6c757d;
}

.admin-card-status .badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* Login Card */
.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
}

.login-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    border: none;
}

.login-card-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.login-card-body {
    padding: 2.5rem;
}

.login-card-footer {
    background: #f8f9fa;
    border: none;
    padding: 1.5rem 2.5rem;
    text-align: center;
}

/* ========================================
   FORMS
   ======================================== */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: white;
    outline: none;
}

.form-control::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    position: relative;
    z-index: 1030;
}

.alert-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #ffd93d 0%, #ffb347 100%);
    color: #2c3e50;
}

.alert-info {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
}

/* ========================================
   SECTIONS
   ======================================== */
.features-section,
.user-features-section {
    padding: 80px 0;
    background: #f8f9fa;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.admin-dashboard-section {
    padding: 2rem 0;
}

.login-form-section {
    padding: 2rem 0;
}

/* Stats Section */
.stats-section,
.admin-stats-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    margin: 3rem 0;
    width: 100%;
    box-sizing: border-box;
}

.stat-item,
.admin-stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-number,
.admin-stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label,
.admin-stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* CTA Section */
.cta-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.cta-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* ========================================
   LINKS
   ======================================== */
.login-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #2c3e50;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

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

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 991.98px) {
    .navbar-nav {
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-link {
        margin: 0.25rem 0;
        padding: 0.75rem 1rem !important;
    }
    
    .user-info {
        margin: 0.5rem 0;
        text-align: center;
    }
    
    .language-switcher {
        margin: 0.5rem 0;
        text-align: center;
    }
    
    .btn-navbar {
        margin: 0.25rem 0;
        text-align: center;
        display: block;
    }
}

@media (max-width: 768px) {
    .hero-title,
    .login-hero-title,
    .admin-hero-title,
    .user-hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons,
    .user-hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-hero {
        width: 100%;
        max-width: 300px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .feature-card,
    .user-feature-card,
    .admin-card {
        padding: 2rem;
    }
    
    .login-card-body {
        padding: 2rem;
    }
    
    .login-card-header {
        padding: 1.5rem;
    }
    
    .login-card-footer {
        padding: 1rem 2rem;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.user-hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Ensure proper spacing for main content */
main {
    position: relative;
    z-index: 1;
    margin-top: 80px; /* Add margin to account for fixed navbar */
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}

/* Container adjustments for fixed navbar */
main.container {
    margin-top: 80px;
    padding-top: 2rem;
}

/* ========================================
   LEGACY STYLES (for backward compatibility)
   ======================================== */
/* Admin dashboard tiles - Legacy styles (kept for backward compatibility) */
.admin-tile {
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
    border: 2px solid #f0f0f0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border-radius: 16px;
    min-height: 260px;
}

.admin-tile:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 6px 18px rgba(13,110,253,0.10);
    border-color: #0d6efd;
}

.admin-tile i {
    color: #0d6efd;
}

.admin-tile .card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.admin-tile .card-text {
    color: #6c757d;
    font-size: 1rem;
}

/* Landing page specific styles */
.landing-page .navbar {
    background: rgba(13, 110, 253, 0.95) !important;
    backdrop-filter: blur(10px);
}

.landing-page .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: color 0.3s ease;
}

.landing-page .navbar-nav .nav-link:hover {
    color: #fff !important;
}

/* Custom Legend Tooltip */
.legend-tooltip {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1050;
    max-width: 250px;
}

.legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 5px;
    vertical-align: middle;
}

/* Custom styling for better visibility */
.table-warning {
    background-color: #fff3cd !important;
}

.table-danger {
    background-color: #f8d7da !important;
}

.table-warning:hover {
    background-color: #ffeaa7 !important;
}

.table-danger:hover {
    background-color: #f5c6cb !important;
}

/* Card styling for weekends and holidays */
.card.table-warning {
    border-color: #ffc107;
}

.card.table-danger {
    border-color: #dc3545;
}

.card.table-warning .card-header {
    background-color: #fff3cd;
    border-bottom-color: #ffc107;
}

.card.table-danger .card-header {
    background-color: #f8d7da;
    border-bottom-color: #dc3545;
}

/* Compact card styling for non-interactive days */
.compact-card {
    margin-bottom: 0.5rem !important;
}

.compact-header {
    padding: 0.5rem 1rem !important;
}

.compact-card .card-header h5 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.compact-card .card-header small {
    font-size: 0.75rem;
}

.compact-card .card-header .badge {
    font-size: 0.6rem;
    padding: 0.25rem 0.5rem;
}

/* ========================================
   EXISTING STYLES (preserved for compatibility)
   ======================================== */
.sticky-header {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* Add some spacing to the content below the sticky header */
.sticky-header + .card {
    margin-top: 1rem;
}

/* Ensure the sticky header has a solid background */
.sticky-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.student-photo {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: #f8f9fa;
}

.avatar-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    font-weight: 600;
    color: #495057;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.avatar-initials {
    user-select: none;
    letter-spacing: 1px;
}

.sticky-header .col-auto, .sticky-header .col {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
}

.sticky-header .col-auto.text-end {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

/* ========================================
   DESKTOP BUDGET DISPLAY
   ======================================== */
.desktop-budget-display {
    margin: 2rem 0;
    display: none; /* Hidden on mobile, shown on desktop */
}

.budget-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    max-width: 400px;
    margin: 0 auto;
}

.budget-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.budget-header i {
    font-size: 1.5rem;
    color: #667eea;
}

.budget-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

.budget-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.budget-balance, .budget-meal-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.budget-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.95rem;
}

.budget-amount {
    font-weight: 700;
    font-size: 1.1rem;
}

.budget-amount.positive {
    color: #28a745;
}

.budget-amount.negative {
    color: #dc3545;
}

.budget-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 12px;
    color: #856404;
    font-size: 0.9rem;
    font-weight: 500;
}

.budget-warning i {
    color: #f39c12;
    font-size: 1rem;
}

/* Show desktop budget on larger screens */
@media (min-width: 769px) {
    .desktop-budget-display {
        display: block;
    }
}

/* ========================================
   QUICK BUDGET SUMMARY
   ======================================== */
.quick-budget-summary {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.quick-budget-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    min-width: 140px;
}

.quick-budget-item i {
    color: #667eea;
    font-size: 1rem;
}

.quick-budget-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.9rem;
}

.quick-budget-amount {
    font-weight: 700;
    font-size: 1rem;
    margin-left: auto;
}

.quick-budget-amount.positive {
    color: #28a745;
}

.quick-budget-amount.negative {
    color: #dc3545;
}

/* Mobile adjustments for quick budget */
@media (max-width: 768px) {
    .quick-budget-summary {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .quick-budget-item {
        padding: 0.5rem 0.75rem;
        min-width: 120px;
        font-size: 0.9rem;
    }
    
    .quick-budget-label {
        font-size: 0.8rem;
    }
    
    .quick-budget-amount {
        font-size: 0.9rem;
    }
}

/* ========================================
   PARENT MEAL ORDERING INTERFACE
   ======================================== */

/* ========================================
   CALENDAR VIEW STYLES
   ======================================== */
.meal-calendar {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.calendar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-nav-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.calendar-nav-btn:hover {
    background: rgba(255,255,255,0.3);
    color: white;
    transform: translateY(-1px);
}

.calendar-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
}

.calendar-day-header {
    background: #f8f9fa;
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
}

.calendar-day {
    background: white;
    min-height: 120px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.calendar-day:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.calendar-day.today {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.calendar-day.past {
    background: #f8f9fa;
    opacity: 0.6;
    cursor: not-allowed;
}

.calendar-day.weekend {
    background: #fff3cd;
}

.calendar-day.holiday {
    background: #f8d7da;
}

.calendar-day-number {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.calendar-day-status {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-ordered {
    background: #28a745;
}

.status-not-ordered {
    background: #dc3545;
}

.status-no-meals {
    background: #6c757d;
}

.status-disabled {
    background: #ffc107;
}

.day-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    font-weight: 500;
    margin-top: 0.25rem;
}

.badge-weekend {
    background: #fff3cd;
    color: #856404;
}

.badge-holiday {
    background: #f8d7da;
    color: #721c24;
}

/* ========================================
   MEAL DETAIL CARD STYLES
   ======================================== */
.meal-detail-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.meal-detail-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: center;
    position: relative;
}

.meal-detail-date {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.meal-detail-day {
    font-size: 0.9rem;
    opacity: 0.9;
}

.meal-detail-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.7rem;
}

.meal-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.meal-option-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.meal-option-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.meal-option-card.ordered {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, rgba(40, 167, 69, 0.1) 100%);
}

.meal-option-card.disabled {
    border-color: #6c757d;
    background: #f8f9fa;
    opacity: 0.6;
}

.meal-option-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.meal-option-placeholder {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.meal-option-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.meal-option-variant {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.variant-regular {
    background: #e3f2fd;
    color: #1976d2;
}

.variant-vegetarian {
    background: #e8f5e8;
    color: #2e7d32;
}

.meal-option-description {
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    min-height: 2rem;
    font-size: 0.85rem;
}

.meal-option-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.meal-order-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meal-order-btn.order {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.meal-order-btn.order:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.meal-order-btn.cancel {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
}

.meal-order-btn.cancel:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.meal-order-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.meal-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    font-size: 0.8rem;
}

.status-ordered .meal-status-indicator {
    color: #28a745;
}

.status-not-ordered .meal-status-indicator {
    color: #dc3545;
}

.status-disabled .meal-status-indicator {
    color: #6c757d;
}

/* ========================================
   ENHANCED HEADER & NAVIGATION
   ======================================== */
.parent-header {
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    padding: 1rem;
    margin-bottom: 1rem;
}

.child-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.child-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.2);
}

.child-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid #667eea;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.2);
}

.child-selector select {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    background: white;
    min-width: 150px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.child-selector select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.budget-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.budget-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.budget-row:last-child {
    margin-bottom: 0;
    padding-top: 0.75rem;
    border-top: 1px solid #dee2e6;
}

.budget-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.budget-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.budget-positive {
    color: #28a745;
}

.budget-negative {
    color: #dc3545;
}

.budget-warning {
    color: #ffc107;
}

.budget-info {
    color: #17a2b8;
}

.budget-alert {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.75rem;
    color: #856404;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ========================================
   QUICK ACTIONS & BULK OPERATIONS
   ======================================== */
.quick-actions {
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    padding: 1rem;
    margin-bottom: 1rem;
}

.quick-actions-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    text-align: center;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.quick-action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
}

.quick-action-btn i {
    font-size: 1.2rem;
}

.quick-action-btn.secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.quick-action-btn.secondary:hover {
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

/* ========================================
   MOBILE RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    /* Container adjustments */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Calendar improvements */
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 1px;
    }
    
    .calendar-day {
        min-height: 90px;
        padding: 0.75rem 0.5rem;
        border-radius: 8px;
    }
    
    .calendar-day-number {
        font-size: 1rem;
        font-weight: 700;
    }
    
    .calendar-day-header {
        padding: 0.75rem 0.25rem;
        font-size: 0.8rem;
    }
    
    /* Meal options improvements */
    .meal-options-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .meal-option-card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .meal-option-image,
    .meal-option-placeholder {
        height: 140px;
    }
    
    .meal-option-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .meal-order-btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        min-height: 48px; /* Minimum touch target size */
    }
    
    /* Header improvements */
    .child-selector {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .child-selector select {
        width: 100%;
        max-width: 300px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .budget-row {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.25rem;
    }
    
    .budget-value {
        font-size: 1rem;
    }
    
    .budget-display {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .budget-label {
        font-size: 0.9rem;
    }
    
    /* Quick actions improvements */
    .quick-actions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .quick-action-btn {
        padding: 1.5rem;
        min-height: 80px;
        font-size: 1rem;
    }
    
    /* Header padding adjustments */
    .parent-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .meal-detail-header {
        padding: 1.5rem;
    }
    
    .meal-detail-date {
        font-size: 1.5rem;
    }
    
    .meal-detail-day {
        font-size: 1rem;
    }
    
    /* Date range selector improvements */
    .btn-group {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .btn-group .btn {
        flex: 1;
        min-width: 60px;
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .input-group {
        width: 100% !important;
        margin-top: 0.5rem;
    }
    
    /* Make the date range card more compact */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Modal improvements */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    /* Alert improvements */
    .alert {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    
    /* Make alerts even more compact on mobile */
    .alert.m-3 {
        margin: 0.5rem !important;
    }
    
    /* Card improvements */
    .card-body {
        padding: 1.5rem;
    }
    
    /* Form improvements */
    .form-control {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    /* Button improvements */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    /* Extra small devices */
    .calendar-day {
        min-height: 70px;
        padding: 0.5rem 0.25rem;
    }
    
    .calendar-day-number {
        font-size: 0.9rem;
    }
    
    .calendar-day-header {
        padding: 0.5rem 0.1rem;
        font-size: 0.75rem;
    }
    
    .status-indicator {
        width: 8px;
        height: 8px;
    }
    
    .day-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Meal options for very small screens */
    .meal-options-grid {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .meal-option-card {
        padding: 0.75rem;
    }
    
    .meal-option-image,
    .meal-option-placeholder {
        height: 120px;
    }
    
    .meal-option-title {
        font-size: 1.1rem;
    }
    
    .meal-option-description {
        font-size: 0.9rem;
    }
    
    /* Header for very small screens */
    .parent-header {
        padding: 1rem;
    }
    
    .child-avatar,
    .child-avatar-placeholder {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    /* Quick actions for very small screens */
    .quick-action-btn {
        padding: 1rem;
        min-height: 70px;
        font-size: 0.9rem;
    }
    
    .quick-action-btn i {
        font-size: 1.2rem;
    }
    
    /* Budget display for very small screens */
    .budget-display {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .budget-row {
        margin-bottom: 0.2rem;
        gap: 0.25rem;
    }
    
    .budget-label {
        font-size: 0.85rem;
    }
    
    .budget-value {
        font-size: 0.95rem;
    }
    
    .budget-alert {
        padding: 0.5rem;
        margin-top: 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Modal for very small screens */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Button groups for very small screens */
    .btn-group .btn {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
        min-width: 60px;
    }
}

/* Touch-friendly improvements for all mobile devices */
@media (max-width: 768px) {
    /* Ensure minimum touch target sizes */
    .btn,
    .meal-order-btn,
    .quick-action-btn,
    .calendar-nav-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improve tap targets */
    .calendar-day {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
    }
    
    .meal-option-card {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
    }
    
    /* Prevent zoom on input focus */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Improve scrolling */
    .meal-calendar,
    .meal-detail-card {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better spacing for mobile */
    .container {
        padding-top: 1rem;
        padding-bottom: 2rem;
    }
    
    /* Improve navbar on mobile */
    .navbar {
        padding: 0.5rem 0;
        height: 50px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10000;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
        cursor: pointer;
        z-index: 10001;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        height: 50px;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        margin: 0.25rem 0;
        cursor: pointer;
        z-index: 10001;
    }
    
    /* Removed global modal rules to prevent conflicts */

/* Fix iOS Safari issues */
    .modal {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .modal-dialog {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    /* Removed mobile modal rules to prevent conflicts */
    }
    
    /* Fix Android Chrome issues */
    .btn:active,
    .meal-order-btn:active,
    .quick-action-btn:active {
        transform: scale(0.98);
    }
    
    /* Improve dropdown on mobile */
    .dropdown-menu {
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Fix sticky positioning on mobile */
    .sticky-header {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    /* Improve form elements on mobile */
    .form-select {
        background-size: 16px 12px;
        padding-right: 2.5rem;
    }
    
    /* Fix button group wrapping */
    .btn-group {
        display: flex;
        flex-wrap: wrap;
    }
    
    .btn-group > .btn {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    /* Improve tooltip positioning on mobile */
    .help-tooltip .tooltip-text {
        width: 250px;
        max-width: 90vw;
        left: 50%;
        transform: translateX(-50%);
    }
    
    /* Fix image scaling on mobile */
    .meal-option-image {
        max-width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    /* Improve loading overlay on mobile */
    .loading-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: rgba(255, 255, 255, 0.95);
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px);
    }
    
    /* Fix calendar day spacing on mobile */
    .calendar-day {
        position: relative;
        overflow: hidden;
    }
    
    .calendar-day::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: transparent;
        transition: background-color 0.2s ease;
    }
    
    .calendar-day:active::before {
        background-color: rgba(102, 126, 234, 0.1);
    }

/* ========================================
   COMPACT BUDGET DISPLAY (Alternative)
   ======================================== */
.budget-display-compact {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.budget-item-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.budget-label-compact {
    font-weight: 600;
    color: #2c3e50;
}

.budget-value-compact {
    font-weight: 700;
    font-size: 1rem;
}

.budget-alert-compact {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    color: #856404;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    width: 100%;
}

@media (max-width: 768px) {
    .budget-display-compact {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    
    .budget-item-compact {
        justify-content: space-between;
        font-size: 0.85rem;
    }
    
    .budget-value-compact {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .budget-display-compact {
        padding: 0.4rem;
    }
    
    .budget-item-compact {
        font-size: 0.8rem;
    }
    
    .budget-value-compact {
        font-size: 0.9rem;
    }
    
    .budget-alert-compact {
        padding: 0.4rem;
        font-size: 0.75rem;
    }
    
    /* Extra small mobile landing page fixes */
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .btn-hero {
        font-size: 0.9rem;
        padding: 10px 20px;
        max-width: 250px;
    }
    
    .hero-image i {
        font-size: 8rem !important;
    }
}

/* ========================================
   ANIMATIONS & TRANSITIONS
   ======================================== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.meal-option-card {
    animation: slideInUp 0.6s ease-out;
}

.calendar-day {
    animation: fadeIn 0.4s ease-out;
}

/* ========================================
   LOADING STATES
   ======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   TOOLTIPS & HELP
   ======================================== */
.help-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.help-tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #2c3e50;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
}

.help-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators for keyboard navigation */
.calendar-day:focus,
.meal-order-btn:focus,
.quick-action-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .meal-option-card {
        border-width: 3px;
    }
    
    .status-indicator {
        width: 12px;
        height: 12px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .calendar-day,
    .meal-option-card,
    .meal-order-btn,
    .quick-action-btn {
        animation: none;
        transition: none;
    }
}

/* Swipe Actions */
.swipe-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    pointer-events: none;
    z-index: 10;
}

.swipe-action {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    border-radius: 16px;
}

.swipe-action i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.swipe-order {
    left: 0;
    width: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    transform: translateX(-100%);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.swipe-cancel {
    right: 0;
    width: 80px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transform: translateX(100%);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Swipe States */
.meal-card.swiping {
    transition: transform 0.1s ease;
    z-index: 20;
}

.meal-card.swipe-right .swipe-order {
    opacity: 1;
    transform: translateX(0);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.meal-card.swipe-left .swipe-cancel {
    opacity: 1;
    transform: translateX(0);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.meal-card.swipe-right {
    transform: translateX(40px);
}

.meal-card.swipe-left {
    transform: translateX(-40px);
}

/* Swipe Success Animation */
.meal-card.swipe-success {
    animation: swipeSuccess 0.6s ease-out;
    z-index: 30;
}

@keyframes swipeSuccess {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    25% {
        transform: scale(1.08);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.95;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile-specific swipe improvements */
@media (max-width: 768px) {
    .meals-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .meal-card {
        touch-action: pan-y; /* Allow vertical scrolling by default */
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        min-height: auto; /* Flexible height on mobile */
        border-radius: 12px;
    }
    
    .meal-image-container {
        height: 140px;
    }
    
    .meal-info {
        padding: 1rem;
    }
    
    .meal-title {
        font-size: 1.1rem;
        line-height: 1.4; /* Increased line height for better spacing */
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        margin-bottom: 0.5rem; /* Add bottom margin for spacing */
        flex-shrink: 0; /* Prevent title from shrinking */
    }
    
    .meal-description {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }
    
    .swipe-action {
        width: 70px;
        font-size: 0.8rem;
    }
    
    .swipe-action i {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .meal-card.swipe-right {
        transform: translateX(35px);
    }
    
    .meal-card.swipe-left {
        transform: translateX(-35px);
    }
    
    /* Prevent scroll when swiping */
    .meal-card.swiping {
        touch-action: none;
    }
    
    /* Add momentum scrolling to the container */
    .meals-container {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
    
    /* Improve order button on mobile */
    .order-btn {
        min-height: 44px;
        font-size: 0.95rem;
    }
}

/* Demo Section Styles */
.demo-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.demo-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.demo-section .section-title {
    color: white;
    margin-bottom: 20px;
}

.demo-section .section-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 50px;
}

.demo-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

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

.demo-budget {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.demo-budget-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.demo-budget-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4ade80;
}

.demo-budget-amount.demo-negative {
    color: #f87171;
}

.demo-date-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.demo-date-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.demo-date-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.demo-date-btn.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
}

.demo-meals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.demo-meal-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    color: #333;
}

.demo-meal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.demo-meal-image {
    height: 150px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: white;
}

.demo-meal-image i {
    font-size: 3rem;
    opacity: 0.8;
}

.demo-date-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 5px 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.demo-date-day {
    display: block;
    font-size: 1.1rem;
}

.demo-date-month {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
}

.demo-status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #4ade80;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.demo-meal-info {
    padding: 20px;
}

.demo-meal-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.demo-meal-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.demo-meal-variant {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.demo-variant-regular {
    background: #dbeafe;
    color: #1e40af;
}

.demo-variant-vegetarian {
    background: #dcfce7;
    color: #166534;
}

.demo-meal-price {
    font-weight: bold;
    color: #059669;
    font-size: 1.1rem;
}

.demo-meal-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

.demo-order-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
}

.demo-order-btn.demo-available {
    background: #3b82f6;
    color: white;
}

.demo-order-btn.demo-available:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.demo-order-btn.demo-ordered {
    background: #ef4444;
    color: white;
}

.demo-order-btn.demo-ordered:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.demo-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-demo {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-demo-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-demo-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-demo-secondary {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-demo-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.demo-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #333;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    max-width: 300px;
    animation: slideInRight 0.3s ease;
}

.demo-message-success {
    border-left: 4px solid #4ade80;
}

.demo-message-error {
    border-left: 4px solid #f87171;
}

.demo-message-info {
    border-left: 4px solid #3b82f6;
}

.demo-message button {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    margin-left: auto;
}

.demo-message button:hover {
    color: #333;
}

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

/* Responsive adjustments for demo */
@media (max-width: 768px) {
    .demo-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .demo-date-selector {
        justify-content: center;
    }
    
    .demo-meals-grid {
        grid-template-columns: 1fr;
    }
    
    .demo-actions {
        flex-direction: column;
    }
    
    .demo-message {
        right: 10px;
        left: 10px;
        max-width: none;
    }
} 

/* ========================================
   HELP PAGE STYLES
   ======================================== */

.help-page {
    padding: 2rem 0;
    background: #f8f9fa;
    min-height: 100vh;
}

.help-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    text-align: center;
}

.help-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.help-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}

.help-toc {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.help-toc h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.toc-list li a {
    display: block;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    color: #667eea;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.toc-list li a:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.help-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.help-section h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.help-section h2 i {
    color: #667eea;
    font-size: 1.5rem;
}

.help-content h3 {
    color: #444;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.help-content h4 {
    color: #555;
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.help-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.help-content ul, .help-content ol {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.help-content li {
    margin-bottom: 0.5rem;
}

.help-step {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid #667eea;
}

.help-tip {
    background: #e8f5e8;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid #4ade80;
}

.help-warning {
    background: #fff3cd;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid #ffc107;
}

.help-issue {
    background: #f8d7da;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid #dc3545;
}

.help-tip h4, .help-warning h4, .help-issue h4 {
    margin-top: 0;
}

.help-tip h4 i, .help-warning h4 i, .help-issue h4 i {
    color: inherit;
}

.quick-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.quick-ref-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.quick-ref-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.quick-ref-card h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.quick-ref-card p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

.support-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.support-option {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
}

.support-option h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-to-top {
    text-align: center;
    margin: 3rem 0 1rem 0;
}

.back-to-top .btn {
    background: #667eea;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-to-top .btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Responsive Design for Help Page */
@media (max-width: 768px) {
    .help-header {
        padding: 2rem 1rem;
    }
    
    .help-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .help-subtitle {
        font-size: 1rem;
    }
    
    .help-toc, .help-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .toc-list {
        grid-template-columns: 1fr;
    }
    
    .quick-ref-grid {
        grid-template-columns: 1fr;
    }
    
    .support-options {
        grid-template-columns: 1fr;
    }
    
    .help-content h2 {
        font-size: 1.5rem;
    }
    
    .help-content h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .help-header {
        padding: 1.5rem 1rem;
    }
    
    .help-title {
        font-size: 1.8rem;
    }
    
    .help-toc, .help-section {
        padding: 1rem;
    }
    
    .help-step, .help-tip, .help-warning, .help-issue {
        padding: 1rem;
    }
}

/* ========================================
   DESKTOP STUDENT INFO BAR STYLES
   ======================================== */

.desktop-student-info-bar {
    display: none;
}

@media (min-width: 992px) {
    .desktop-student-info-bar {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1.5rem 0.5rem 1.5rem;
        background: #fff;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 2px 12px rgba(102, 126, 234, 0.07);
        margin-bottom: 0.5rem;
    }
    
    .student-avatar-selector-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.75rem !important;
        width: 100% !important;
        justify-content: center !important;
    }
    
    .student-avatar-selector-row .desktop-avatar,
    .student-avatar-selector-row .child-avatar,
    .student-avatar-selector-row .child-avatar-placeholder {
        flex-shrink: 0 !important;
        margin: 0 !important;
        display: block !important;
    }
    
    .student-avatar-selector-row .header-child-selector-form {
        flex: 1 !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        width: auto !important;
        min-width: 0 !important;
    }
    
    .student-avatar-selector-row .header-child-selector-form .child-select {
        margin: 0 !important;
        flex: 1 !important;
        min-width: 160px !important;
        max-width: 200px !important;
    }
    
    .desktop-controls-row {
        display: flex;
        align-items: center;
        gap: 1rem;
        width: 100%;
        justify-content: center;
        padding: 0.25rem 0;
    }
    
    .desktop-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
        background: #e9ecef;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 1.1rem;
        color: #667eea;
        margin: 0;
        flex-shrink: 0;
    }
    
    .desktop-student-info-bar .header-child-selector-form {
        margin: 0;
    }
    
    .desktop-student-info-bar .header-child-selector-form .child-select {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        background: white;
        color: #495057;
        min-width: 160px;
        max-width: 200px;
    }
    
    .control-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.625rem 1rem;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        border: 1px solid #dee2e6;
        border-radius: 8px;
        color: #6c757d;
        text-decoration: none;
        font-size: 0.875rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        white-space: nowrap;
        min-height: 40px;
        position: relative;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    
    .control-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
        transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .control-btn:hover {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-color: #adb5bd;
        color: #495057;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }
    
    .control-btn:hover::before {
        left: 100%;
    }
    
    .control-btn:active {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .control-btn i {
        font-size: 1rem;
        color: #667eea;
    }
    
    .control-btn span {
        font-weight: 500;
    }
    
    .desktop-budget-summary {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        justify-content: center;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        border-top: 1px solid #e9ecef;
        width: 100%;
    }
    
    .desktop-budget-summary .budget-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        justify-content: flex-start;
        width: auto;
        background: white;
        padding: 0.75rem 1rem;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border: 1px solid #e9ecef;
        min-width: 200px;
    }
    
    .desktop-budget-summary .budget-label {
        font-size: 0.85rem;
        color: #495057;
        font-weight: 500;
        min-width: auto;
        text-align: left;
        white-space: nowrap;
    }
    
    .desktop-budget-summary .budget-amount {
        font-weight: 600;
        font-size: 0.9rem;
        padding: 0;
        border-radius: 0;
        background: transparent;
        border: none;
        color: #dc3545;
    }
    
    .desktop-budget-summary .budget-amount.negative {
        color: #dc3545;
        background: transparent;
        border: none;
    }
    
    .desktop-budget-summary .budget-amount.positive {
        color: #28a745;
        background: transparent;
        border: none;
    }
    
    .desktop-budget-summary .meal-price-amount {
        color: #212529;
        font-weight: 500;
        font-size: 0.9rem;
        padding: 0;
        border-radius: 0;
        background: transparent;
        border: none;
    }
    
    .desktop-budget-summary .budget-item i {
        color: #007bff;
        font-size: 1rem;
        flex-shrink: 0;
    }
    
    /* Responsive adjustments for smaller desktop screens */
    @media (max-width: 1200px) {
        .desktop-budget-summary .budget-label {
            min-width: 60px;
            font-size: 0.75rem;
        }
        
        .desktop-budget-summary {
            gap: 0.75rem;
        }
    }
    
    @media (max-width: 992px) {
        .desktop-budget-summary .budget-label {
            min-width: 50px;
            font-size: 0.7rem;
        }
        
        .desktop-budget-summary {
            gap: 0.5rem;
        }
        
        .desktop-budget-summary .budget-amount,
        .desktop-budget-summary .meal-price-amount {
            font-size: 0.8rem;
            padding: 0.25rem 0.5rem;
        }
    }
}

/* Desktop-only and mobile-only utility classes */
.desktop-only { display: none !important; }
.mobile-only { display: inline !important; }

@media (min-width: 992px) {
    .desktop-only { display: flex !important; }
    .mobile-only { display: none !important; }
}

/* Mobile Child Selector */
.mobile-child-selector {
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

.mobile-avatar-selector-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.mobile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    flex-shrink: 0;
}

.child-avatar-placeholder.mobile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-child-selector-form {
    flex: 1;
    min-width: 0;
}

.mobile-child-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #007bff;
    border-radius: 8px;
    background: white;
    color: #495057;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.mobile-child-select:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.mobile-child-select:disabled {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
}

.mobile-child-select:disabled:focus {
    transform: none;
    box-shadow: none;
}

/* Responsive adjustments for mobile child selector */
@media (max-width: 767.98px) {
    .mobile-child-selector {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .mobile-avatar-selector-row {
        gap: 0.75rem;
    }
    
    .mobile-avatar {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    .mobile-child-select {
        padding: 0.625rem 0.875rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 575.98px) {
    .mobile-child-selector {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .mobile-avatar-selector-row {
        gap: 0.5rem;
    }
    
    .mobile-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .mobile-child-select {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Mobile Budget Summary - matches desktop design */
.mobile-budget-summary {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    padding: 0.75rem 0;
    margin-top: 0.75rem;
    width: 100%;
    flex-wrap: wrap;
}

.mobile-budget-summary .budget-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-start;
    width: auto;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    min-width: 180px;
    flex: 1;
    max-width: 200px;
}

.mobile-budget-summary .budget-label {
    font-size: 0.8rem;
    color: #495057;
    font-weight: 500;
    min-width: auto;
    text-align: left;
    white-space: nowrap;
}

.mobile-budget-summary .budget-amount {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    color: #dc3545;
}

.mobile-budget-summary .budget-amount.negative {
    color: #dc3545;
    background: transparent;
    border: none;
}

.mobile-budget-summary .budget-amount.positive {
    color: #28a745;
    background: transparent;
    border: none;
}

.mobile-budget-summary .meal-price-amount {
    color: #212529;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
}

.mobile-budget-summary .budget-item i {
    color: #007bff;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Responsive adjustments for mobile budget summary */
@media (max-width: 575.98px) {
    .mobile-budget-summary {
        gap: 0.5rem;
        padding: 0.5rem 0;
    }
    
    .mobile-budget-summary .budget-item {
        padding: 0.625rem 0.875rem;
        min-width: 160px;
        max-width: 180px;
    }
    
    .mobile-budget-summary .budget-label {
        font-size: 0.75rem;
    }
    
    .mobile-budget-summary .budget-amount,
    .mobile-budget-summary .meal-price-amount {
        font-size: 0.8rem;
    }
}

/* Mobile Controls Row */
.mobile-controls-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    padding: 0.75rem;
    margin-top: 0.5rem;
    width: 100%;
    overflow: visible;
}

.mobile-controls-row .control-btn {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 40px;
    white-space: nowrap;
    flex-shrink: 0;
    flex: 0 0 auto;
    max-width: 50%;
    width: auto;
    float: none !important;
    clear: none !important;
}

.mobile-controls-row .control-btn:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #adb5bd;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.mobile-controls-row .control-btn:active {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mobile-controls-row .control-btn i {
    font-size: 1rem;
    color: #6c757d;
}

/* Mobile Controls Row Responsive Adjustments */
@media (max-width: 575.98px) {
    .mobile-controls-row {
        gap: 0.5rem;
        padding: 0.5rem;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }
    
    .mobile-controls-row .control-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        min-height: 36px;
        flex-shrink: 0;
        flex: 0 0 auto;
        min-width: 0;
        max-width: 45%;
        width: auto;
    }
    
    .mobile-controls-row .control-btn i {
        font-size: 0.9rem;
    }
}

/* ========================================
   COMPREHENSIVE MOBILE OVERFLOW PREVENTION
   ======================================== */
@media (max-width: 768px) {
    /* Prevent horizontal overflow on all mobile devices */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .container, .container-fluid {
        max-width: 100%;
        overflow-x: hidden;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Ensure all sections respect container boundaries */
    .hero-section,
    .features-section,
    .stats-section,
    .cta-section {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        overflow-x: hidden;
    }
    
    /* Fix any elements that might extend beyond viewport */
    .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Additional landing page mobile fixes */
    .hero-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .btn-hero {
        min-width: auto;
        width: 100%;
        max-width: 280px;
        margin: 0.25rem 0;
    }
    
    .hero-image {
        max-width: 100%;
        overflow: hidden;
    }
    
    .hero-image i {
        max-width: 100%;
        height: auto;
    }
    
    /* Ensure all text content doesn't overflow */
    .hero-title,
    .hero-subtitle,
    .section-title,
    .section-subtitle {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
    .col-sm, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6,
    .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12,
    .col-md, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
    .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12,
    .col-lg, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6,
    .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ========================================
   FAVORITE HEART ICONS
   ======================================== */

/* Ensure Bootstrap Icons font applies even if page CSS resets fonts */
.bi::before,
[class^="bi-"]::before,
[class*=" bi-"]::before {
    font-family: bootstrap-icons !important;
}

.favorite-heart-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-left: 0.5rem;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.favorite-heart-btn:hover {
    transform: scale(1.1);
}

.favorite-heart-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.favorite-heart-btn i {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

/* Unfavorited state (empty heart) */
.favorite-heart-btn.not-favorited i {
    color: #6c757d;
}

.favorite-heart-btn.not-favorited:hover i {
    color: #dc3545;
}

/* Favorited state (filled heart) */
.favorite-heart-btn.favorited i {
    color: #dc3545;
}

.favorite-heart-btn.favorited:hover i {
    color: #b02a37;
}

/* Click animation */
.favorite-heart-btn:active {
    transform: scale(0.95);
}

/* Success animation for adding to favorites */
.favorite-heart-btn.animate-add {
    animation: heartAdd 0.6s ease;
}

/* Success animation for removing from favorites */
.favorite-heart-btn.animate-remove {
    animation: heartRemove 0.6s ease;
}

/* Loading state */
.favorite-heart-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

.favorite-heart-btn.loading i {
    animation: heartPulse 1s infinite;
}

@keyframes heartAdd {
    0% { 
        transform: scale(1);
        background-color: transparent;
    }
    30% { 
        transform: scale(1.3);
        background-color: rgba(220, 53, 69, 0.2);
    }
    60% { 
        transform: scale(1.1);
        background-color: rgba(220, 53, 69, 0.1);
    }
    100% { 
        transform: scale(1);
        background-color: transparent;
    }
}

@keyframes heartRemove {
    0% { 
        transform: scale(1);
        background-color: transparent;
    }
    30% { 
        transform: scale(0.8);
        background-color: rgba(108, 117, 125, 0.2);
    }
    60% { 
        transform: scale(1.1);
        background-color: rgba(108, 117, 125, 0.1);
    }
    100% { 
        transform: scale(1);
        background-color: transparent;
    }
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .favorite-heart-btn {
        width: 1.8rem;
        height: 1.8rem;
        margin-left: 0.25rem;
    }
    
    .favorite-heart-btn i {
        font-size: 1rem;
    }
}

/* Meal header layout adjustment */
.meal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.meal-title {
    flex: 1;
    margin: 0;
}

/* Favorite count indicator for admin */
.favorite-count-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

.favorite-count-indicator i {
    font-size: 0.75rem;
}

.favorite-count-indicator small {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Favorite count display for admin meal management */
.favorite-count-display {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.favorite-count-display i {
    font-size: 0.875rem;
}

.favorite-count-display .favorite-count {
    font-weight: 600;
    color: #dc3545;
}

.favorite-count-display small {
    font-size: 0.75rem;
    color: #6c757d;
}

/* ========================================
   OFFCANVAS MENU STYLES
   ======================================== */

/* Base offcanvas menu styles */
.offcanvas-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 100001 !important;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.offcanvas-menu.open {
    transform: translateX(0);
}

/* Menu backdrop */
.offcanvas-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.offcanvas-menu-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Menu header - minimalist design */
.offcanvas-menu-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 50px; /* Match navbar height exactly */
    box-sizing: border-box;
}

.offcanvas-menu-header-spacer {
    flex: 1;
}

.offcanvas-menu-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    flex: 1;
}

.offcanvas-menu-brand i {
    font-size: 1.4rem;
}

.offcanvas-menu-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1;
    justify-content: center;
}

.offcanvas-menu-user i {
    font-size: 1.1rem;
}

/* User info row - separate from header */
.offcanvas-menu-user-row {
    background: rgba(102, 126, 234, 0.1);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Close button in menu header */
.offcanvas-menu-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    line-height: 1;
}

.offcanvas-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.offcanvas-menu-close:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Menu content */
.offcanvas-menu-content {
    padding: 1rem 0;
}

.offcanvas-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.offcanvas-menu-list li {
    margin: 0;
}

/* Menu items */
.offcanvas-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 0;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.offcanvas-menu-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
    text-decoration: none;
}

.offcanvas-menu-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.offcanvas-menu-item span {
    flex: 1;
}

/* Menu forms */
.offcanvas-menu-form {
    width: 100%;
    margin: 0;
}

.offcanvas-menu-button {
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
}

/* Language switcher */
.offcanvas-menu-language {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
}

.offcanvas-menu-language i {
    font-size: 1.1rem;
    color: #2c3e50;
    width: 20px;
    text-align: center;
}

.offcanvas-menu-language-select {
    flex: 1;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
}

.offcanvas-menu-language-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.offcanvas-menu-language-select option {
    background: white;
    color: #2c3e50;
}

/* Menu divider */
.offcanvas-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

/* Hamburger button */
.offcanvas-menu-toggle {
    position: fixed;
    top: 7px;
    right: 1.25rem;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    z-index: 100002 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    padding: 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
}

/* Hide hamburger button when menu is open */
.offcanvas-menu.open ~ .offcanvas-menu-toggle {
    display: none;
}

.offcanvas-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.offcanvas-menu-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.offcanvas-menu-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
    height: 16px;
}

.offcanvas-menu-toggle-line {
    width: 100%;
    height: 2px;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Hamburger to X animation */
.offcanvas-menu-toggle.open .offcanvas-menu-toggle-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.offcanvas-menu-toggle.open .offcanvas-menu-toggle-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.offcanvas-menu-toggle.open .offcanvas-menu-toggle-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Responsive design */
@media (max-width: 768px) {
    .offcanvas-menu {
        width: 100%;
    }
    
    .offcanvas-menu-toggle {
        top: 7px;
        right: 1rem;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
    }
    
    .offcanvas-menu-header {
        padding: 1.25rem 1rem;
    }
    
    .offcanvas-menu-brand {
        font-size: 1.3rem;
    }
    
    .offcanvas-menu-item {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .offcanvas-menu-language {
        padding: 0.875rem 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .offcanvas-menu {
        border-left: 2px solid #000;
    }
    
    .offcanvas-menu-item {
        border-bottom: 1px solid #e5e7eb;
    }
    
    .offcanvas-menu-item:hover {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .offcanvas-menu,
    .offcanvas-menu-backdrop,
    .offcanvas-menu-item,
    .offcanvas-menu-toggle,
    .offcanvas-menu-toggle-line {
        transition: none;
    }
    
    .offcanvas-menu-item:hover {
        transform: none;
    }
    
    .offcanvas-menu-toggle:hover {
        transform: none;
    }
}

/* ========================================
   PROGRESSIVE ENHANCEMENT FALLBACK
   ======================================== */

/* CSS-only fallback for users with JavaScript disabled */
.no-js .offcanvas-menu-toggle {
    display: none;
}

/* Checkbox hack for CSS-only menu toggle */
.offcanvas-menu-checkbox {
    display: none;
}

.offcanvas-menu-checkbox:checked ~ .offcanvas-menu {
    transform: translateX(0);
}

.offcanvas-menu-checkbox:checked ~ .offcanvas-menu-backdrop {
    opacity: 1;
    visibility: visible;
}

.offcanvas-menu-checkbox:checked ~ .offcanvas-menu-toggle {
    transform: rotate(90deg);
}

.offcanvas-menu-checkbox:checked ~ .offcanvas-menu-toggle .offcanvas-menu-toggle-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.offcanvas-menu-checkbox:checked ~ .offcanvas-menu-toggle .offcanvas-menu-toggle-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.offcanvas-menu-checkbox:checked ~ .offcanvas-menu-toggle .offcanvas-menu-toggle-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* CSS-only hamburger button styling */
.offcanvas-menu-toggle-css {
    position: fixed;
    top: 7px;
    right: 1.25rem;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    z-index: 100002 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    padding: 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
}

/* Hide CSS-only hamburger button when menu is open */
.offcanvas-menu-checkbox:checked ~ .offcanvas-menu-toggle-css {
    display: none;
}

.offcanvas-menu-toggle-css:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.offcanvas-menu-toggle-css:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

/* CSS-only menu icon */
.offcanvas-menu-toggle-css .offcanvas-menu-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
    height: 16px;
}

.offcanvas-menu-toggle-css .offcanvas-menu-toggle-line {
    width: 100%;
    height: 2px;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* CSS-only menu animations */
.offcanvas-menu-css {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 100001 !important;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.offcanvas-menu-css.open {
    transform: translateX(0);
}

/* CSS-only backdrop */
.offcanvas-menu-backdrop-css {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.offcanvas-menu-backdrop-css.show {
    opacity: 1;
    visibility: visible;
}

/* CSS-only menu header - minimalist design */
.offcanvas-menu-css .offcanvas-menu-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px; /* Match navbar height exactly */
    box-sizing: border-box;
}

.offcanvas-menu-css .offcanvas-menu-brand {
    display: none; /* Remove duplicate branding */
}

.offcanvas-menu-css .offcanvas-menu-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.offcanvas-menu-css .offcanvas-menu-user i {
    font-size: 1.2rem;
}

/* CSS-only close button in menu header */
.offcanvas-menu-css .offcanvas-menu-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    line-height: 1;
}

.offcanvas-menu-css .offcanvas-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.offcanvas-menu-css .offcanvas-menu-close:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* CSS-only menu content */
.offcanvas-menu-css .offcanvas-menu-content {
    padding: 1rem 0;
}

.offcanvas-menu-css .offcanvas-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.offcanvas-menu-css .offcanvas-menu-list li {
    margin: 0;
}

/* CSS-only menu items */
.offcanvas-menu-css .offcanvas-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 0;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.offcanvas-menu-css .offcanvas-menu-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
    text-decoration: none;
}

.offcanvas-menu-css .offcanvas-menu-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.offcanvas-menu-css .offcanvas-menu-item span {
    flex: 1;
}

/* CSS-only menu forms */
.offcanvas-menu-css .offcanvas-menu-form {
    width: 100%;
    margin: 0;
}

.offcanvas-menu-css .offcanvas-menu-button {
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
}

/* CSS-only language switcher */
.offcanvas-menu-css .offcanvas-menu-language {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
}

.offcanvas-menu-css .offcanvas-menu-language i {
    font-size: 1.1rem;
    color: #2c3e50;
    width: 20px;
    text-align: center;
}

.offcanvas-menu-css .offcanvas-menu-language-select {
    flex: 1;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
}

.offcanvas-menu-css .offcanvas-menu-language-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.offcanvas-menu-css .offcanvas-menu-language-select option {
    background: white;
    color: #2c3e50;
}

/* CSS-only menu divider */
.offcanvas-menu-css .offcanvas-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

/* CSS-only responsive design */
@media (max-width: 768px) {
    .offcanvas-menu-css {
        width: 100%;
    }
    
    .offcanvas-menu-toggle-css {
        top: 7px;
        right: 1rem;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
    }
    
    .offcanvas-menu-css .offcanvas-menu-header {
        padding: 1.25rem 1rem;
    }
    
    .offcanvas-menu-css .offcanvas-menu-brand {
        font-size: 1.3rem;
    }
    
    .offcanvas-menu-css .offcanvas-menu-item {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .offcanvas-menu-css .offcanvas-menu-language {
        padding: 0.875rem 1rem;
    }
}

/* CSS-only high contrast mode support */
@media (prefers-contrast: high) {
    .offcanvas-menu-css {
        border-left: 2px solid #000;
    }
    
    .offcanvas-menu-css .offcanvas-menu-item {
        border-bottom: 1px solid #e5e7eb;
    }
    
    .offcanvas-menu-css .offcanvas-menu-item:hover {
        background: #000;
        color: #fff;
    }
}

/* CSS-only reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .offcanvas-menu-css,
    .offcanvas-menu-backdrop-css,
    .offcanvas-menu-css .offcanvas-menu-item,
    .offcanvas-menu-toggle-css,
    .offcanvas-menu-toggle-css .offcanvas-menu-toggle-line {
        transition: none;
    }
    
    .offcanvas-menu-css .offcanvas-menu-item:hover {
        transform: none;
    }
    
    .offcanvas-menu-toggle-css:hover {
        transform: none;
    }
}

/* Fallback mode indicator */
.offcanvas-menu-fallback {
    display: block;
}

.offcanvas-menu-fallback .offcanvas-menu-toggle {
    display: none;
}

.offcanvas-menu-fallback .offcanvas-menu-toggle-css {
    display: flex;
}