/* Chart card styles */
.chart-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f0f2f5;
    border: none;
    border-radius: 25px;
    box-shadow: 
        8px 8px 16px rgba(163, 177, 198, 0.4),
        -8px -8px 16px rgba(255, 255, 255, 0.8);
}

.chart-card:hover {
    box-shadow: 
        12px 12px 24px rgba(163, 177, 198, 0.5),
        -12px -12px 24px rgba(255, 255, 255, 0.9),
        inset 2px 2px 4px rgba(163, 177, 198, 0.1);
}

.detail-list {
    max-height: 400px;
    overflow-y: auto;
}

.detail-item {
    padding: 8px 12px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    border-left: 4px solid #007bff;
}

.detail-item:nth-child(even) {
    background: #e9ecef;
}

.modal-xl {
    max-width: 90%;
}

@media (max-width: 768px) {
    .modal-xl {
        max-width: 95%;
    }
}

/* Insights Tabs Mobile Responsiveness */
.insights-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.insights-tab {
    background: #f0f2f5;
    border: none;
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    box-shadow: 
        2px 2px 4px rgba(163, 177, 198, 0.3),
        -2px -2px 4px rgba(255, 255, 255, 0.7);
}

.insights-tab.active {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 
        inset 2px 2px 4px rgba(124, 58, 237, 0.3),
        2px 2px 8px rgba(139, 92, 246, 0.4);
}

.insights-tab .badge {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    border-radius: 50%;
    min-width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    .insights-tabs {
        justify-content: center;
        padding: 0 0.5rem;
    }
    
    .insights-tab {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 0.25rem);
        justify-content: center;
    }
    
    .insights-tab span:not(.badge) {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Carousel Ad Label Fix */
.carousel-ad-label {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 193, 7, 0.9);
    color: #333;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Prevent overlap with card title */
.carousel-insight-card {
    position: relative;
    padding-top: 0.5rem;
}

.carousel-card-title {
    margin-right: 5rem; /* Give space for the ad label */
    line-height: 1.3;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Mobile adjustments for ad cards */
@media (max-width: 768px) {
    .carousel-ad-label {
        top: 0.3rem;
        right: 0.3rem;
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
    
    .carousel-card-title {
        margin-right: 4rem;
        font-size: 0.85rem;
    }
}

/* Awards category specific styling - subtle neomorphism style */
.award-card .carousel-card-icon {
    background: #f0f2f5;
    color: #8b5cf6;
}

.award-card .carousel-card-title {
    color: #6b46c1;
    font-weight: 600;
}

/* Custom notification styles */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999; /* Always on top */
    padding: 18px 25px;
    border-radius: 20px;
    color: #2d3748;
    font-weight: 600;
    background: #f0f2f5;
    box-shadow: 
        8px 8px 16px rgba(163, 177, 198, 0.4),
        -8px -8px 16px rgba(255, 255, 255, 0.8);
    animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 420px;
    text-align: center;
    border: none;
    backdrop-filter: blur(10px);
    /* Prevent repositioning by ensuring stable positioning */
    width: max-content;
    min-width: 300px;
}

.notification.success {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(124, 58, 237, 0.05)) #f0f2f5;
    border-left: 4px solid rgba(139, 92, 246, 0.8);
}

.notification.error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(231, 76, 60, 0.05)) #f0f2f5;
    border-left: 4px solid rgba(220, 53, 69, 0.8);
}

.notification.warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(253, 126, 20, 0.05)) #f0f2f5;
    border-left: 4px solid rgba(255, 193, 7, 0.8);
}

.notification.info {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(124, 58, 237, 0.05)) #f0f2f5;
    border-left: 4px solid rgba(139, 92, 246, 0.8);
}

.notification .close-btn {
    float: right;
    margin-left: 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
    color: #4a5568;
    background: #f0f2f5;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        2px 2px 4px rgba(163, 177, 198, 0.3),
        -2px -2px 4px rgba(255, 255, 255, 0.7);
}

.notification .close-btn:hover {
    color: #2d3748;
    box-shadow: 
        inset 2px 2px 4px rgba(163, 177, 198, 0.3),
        inset -2px -2px 4px rgba(255, 255, 255, 0.7);
    transform: scale(0.95);
}

@keyframes slideInDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutUp {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
}

/* Stats currency styling */
.stats-currency {
    font-size: 1.2rem;
    font-weight: 600;
    color: #6c757d;
    margin-top: -5px;
    margin-bottom: 10px;
}

/* Stats section styling */
.stats-section {
    margin-bottom: 3rem;
}

.stats-header {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

.stats-header i {
    color: #94a3b8;
    opacity: 0.7;
}


/* Smart Insights Panel Styles */
.insights-panel {
    background: #f0f2f5;
    color: #2d3748;
    border: none;
    border-radius: 25px;
    box-shadow: 
        12px 12px 24px rgba(163, 177, 198, 0.4),
        -12px -12px 24px rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.insights-panel .card-title {
    color: #2d3748;
    font-weight: 600;
}

.insights-panel .text-muted {
    color: #718096 !important;
}

.insight-card {
    background: #f0f2f5;
    border-radius: 20px;
    padding: 24px;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: 
        6px 6px 12px rgba(163, 177, 198, 0.3),
        -6px -6px 12px rgba(255, 255, 255, 0.7);
}

.insight-card:hover {
    box-shadow: 
        8px 8px 16px rgba(163, 177, 198, 0.4),
        -8px -8px 16px rgba(255, 255, 255, 0.8),
        inset 2px 2px 4px rgba(163, 177, 198, 0.1);
}

.insight-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.priority-badge {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.insights-summary {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    text-align: center;
}

.insights-summary .badge {
    font-size: 0.85rem;
    padding: 8px 12px;
}

.insights-summary .text-muted {
    color: #6c757d !important;
}

.insight-card.bg-warning-light {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
}

.insight-card.bg-success-light {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda, #a8e6cf);
}

.insight-card.bg-info-light {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #d1ecf1, #81d4fa);
}

.insight-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.insight-content {
    width: 100%;
}

.insight-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 1rem;
}

.insight-description {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Insights Carousel Styling */
.insights-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.insights-tab {
    background: #f0f2f5;
    border: none;
    color: #4a5568;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 
        4px 4px 8px rgba(163, 177, 198, 0.3),
        -4px -4px 8px rgba(255, 255, 255, 0.7);
}

.insights-tab:hover {
    box-shadow: 
        6px 6px 12px rgba(163, 177, 198, 0.4),
        -6px -6px 12px rgba(255, 255, 255, 0.8),
        inset 1px 1px 2px rgba(163, 177, 198, 0.1);
    color: #2d3748;
}

.insights-tab.active {
    box-shadow: 
        inset 4px 4px 8px rgba(163, 177, 198, 0.3),
        inset -4px -4px 8px rgba(255, 255, 255, 0.7);
    color: #2d3748;
    background: #e2e8f0;
}

.insights-tab .badge {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(124, 58, 237, 0.4));
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.insights-tab.active .badge {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(124, 58, 237, 0.4));
    color: white;
}

.insights-carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px 20px 50px 20px;
    /* Ensure no content bleeds outside */
    clip-path: inset(0);
}

.insights-carousel {
    display: flex;
    transition: transform 0.3s ease;
    width: 400%; /* 4 categories */
}

/* Mobile: Hide inactive categories completely */
@media (max-width: 768px) {
    .insights-carousel-container {
        overflow: hidden;
        padding: 20px 20px 20px 20px !important; /* Normal padding */
    }
    
    .insights-carousel {
        width: 100%; /* Full width on mobile */
        transform: none !important; /* Disable desktop transform on mobile */
        overflow: hidden !important; /* Prevent any overflow scrolling */
    }
    
    .category-section {
        width: 100% !important; /* Each section takes full width */
        display: none; /* Hide all sections by default */
        padding: 0 !important; /* Remove any padding */
        position: relative; /* Ensure proper positioning */
    }
    
    .category-section.active {
        display: block !important; /* Only show active section */
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .insights-cards-wrapper {
        width: 100% !important;
        padding: 0 15px 10px 15px !important; /* Normal bottom padding */
        justify-content: flex-start !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        display: flex !important;
        gap: 15px !important;
    }
    
    .insights-cards-wrapper::-webkit-scrollbar {
        display: none !important;
    }
    
    .carousel-insight-card {
        width: 280px !important; /* Fixed width for consistent scrolling */
        min-width: 280px !important;
        max-width: 280px !important;
        flex-shrink: 0 !important;
        scroll-snap-align: start !important;
        height: auto !important; /* Allow height to adjust to content */
        min-height: 180px !important; /* Minimum height for consistency */
        margin: 0 !important;
        padding: 18px !important; /* Increased padding for better readability */
    }
    
    .category-nav-controls {
        display: none !important; /* Hide navigation buttons on mobile */
    }
    
    /* Mobile scroll indicators removed */
}

.category-section {
    width: 25%; /* Each section takes 1/4 of the carousel width */
    flex-shrink: 0;
    padding: 0 15px; /* Increased padding to contain nav buttons */
    overflow: hidden; /* Prevent bleeding from other categories */
    position: relative;
    box-sizing: border-box;
}

.category-nav-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #f0f2f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    color: #4a5568;
    box-shadow: 
        4px 4px 8px rgba(163, 177, 198, 0.3),
        -4px -4px 8px rgba(255, 255, 255, 0.7);
}

.category-section:hover .category-nav-controls {
    opacity: 1;
    pointer-events: auto;
}

.category-nav-controls:hover {
    box-shadow: 
        6px 6px 12px rgba(163, 177, 198, 0.4),
        -6px -6px 12px rgba(255, 255, 255, 0.8),
        inset 1px 1px 2px rgba(163, 177, 198, 0.1);
    color: #2d3748;
    transform: translateY(-50%);
}

.category-nav-controls.prev {
    left: 20px;
}

.category-nav-controls.next {
    right: 20px;
}

.category-nav-controls:active {
    box-shadow: 
        inset 3px 3px 6px rgba(163, 177, 198, 0.3),
        inset -3px -3px 6px rgba(255, 255, 255, 0.7);
    transform: translateY(-50%);
}

.category-nav-controls i {
    font-size: 14px;
}

.insights-cards-wrapper {
    display: flex;
    gap: 20px;
    overflow: hidden; /* Hide overflow to prevent bleeding */
    padding-bottom: 10px;
    width: 100%;
    justify-content: center; /* Center cards when 3 or fewer */
    align-items: stretch; /* Ensure all cards have same height */
    transition: transform 0.3s ease;
    position: relative;
}

.insights-cards-wrapper::-webkit-scrollbar {
    height: 6px;
}

.insights-cards-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.insights-cards-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.insights-cards-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.carousel-insight-card {
    width: calc(33.333% - 14px); /* 3 cards with gap compensation */
    min-width: 280px;
    max-width: 350px;
    min-height: 200px; /* Minimum height for consistency */
    height: auto; /* Allow height to adjust to content */
    background: #f0f2f5;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 
        6px 6px 12px rgba(163, 177, 198, 0.3),
        -6px -6px 12px rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
    position: relative;
    overflow: visible; /* Allow content to show */
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.carousel-insight-card:hover {
    box-shadow: 
        8px 8px 16px rgba(163, 177, 198, 0.4),
        -8px -8px 16px rgba(255, 255, 255, 0.8),
        inset 2px 2px 4px rgba(163, 177, 198, 0.1);
}

.carousel-insight-card .carousel-card-icon {
    background: #f0f2f5;
    color: #6b46c1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        2px 2px 4px rgba(163, 177, 198, 0.3),
        -2px -2px 4px rgba(255, 255, 255, 0.7);
}

.carousel-card-header {
    display: flex;
    align-items: flex-start;
    flex: 1;
    gap: 12px;
}

.carousel-card-header.alert-header {
    align-items: flex-start; /* Align to top like other cards */
}

.carousel-card-header.alert-header .carousel-card-icon {
    margin-top: 0; /* Ensure icon aligns with title */
}

.carousel-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.carousel-card-header.alert-header .carousel-card-icon {
    margin-top: 0 !important; /* Override the 2px margin for alert icons */
    align-self: flex-start !important; /* Force icon to align with text */
}

.carousel-insight-card .carousel-card-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
}

/* Removed conflicting color styles - now using circular backgrounds above */

/* Year Navigation Buttons */
.year-navigation {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 1rem;
    gap: 1rem;
    flex-wrap: nowrap !important;
}

.year-navigation .btn {
    background: #f0f2f5 !important;
    border: none !important;
    color: #4a5568 !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        4px 4px 8px rgba(163, 177, 198, 0.3),
        -4px -4px 8px rgba(255, 255, 255, 0.7) !important;
    flex-shrink: 0 !important;
    min-width: 40px !important;
    padding: 0 !important;
}

.year-navigation .btn:hover:not(:disabled) {
    box-shadow: 
        6px 6px 12px rgba(163, 177, 198, 0.4),
        -6px -6px 12px rgba(255, 255, 255, 0.8),
        inset 1px 1px 2px rgba(163, 177, 198, 0.1) !important;
    color: #2d3748 !important;
    background: #f0f2f5 !important;
}

.year-navigation .btn:active {
    box-shadow: 
        inset 3px 3px 6px rgba(163, 177, 198, 0.3),
        inset -3px -3px 6px rgba(255, 255, 255, 0.7) !important;
    background: #f0f2f5 !important;
}

.year-navigation .btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    color: #a0aec0 !important;
    background: #f0f2f5 !important;
}

#current-year-display,
#category-current-year-display {
    background: #f0f2f5 !important;
    padding: 8px 20px !important;
    border-radius: 20px !important;
    box-shadow: 
        inset 3px 3px 6px rgba(163, 177, 198, 0.3),
        inset -3px -3px 6px rgba(255, 255, 255, 0.7) !important;
    color: #2d3748 !important;
    font-weight: 600 !important;
    min-width: 80px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    margin: 0 !important;
}

/* Year Total Display */
.year-total-display {
    text-align: center !important;
    margin-top: 0.75rem !important;
    padding: 8px 16px !important;
    background: rgba(139, 92, 246, 0.05) !important;
    border-radius: 15px !important;
    box-shadow: 
        2px 2px 4px rgba(163, 177, 198, 0.2),
        -2px -2px 4px rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(139, 92, 246, 0.1) !important;
}

.year-total-display .text-muted {
    color: #64748b !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
}

.year-total-display .fw-bold {
    color: #8b5cf6 !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
}

.carousel-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow content to shrink */
}

.carousel-card-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.3;
    flex-shrink: 0;
    /* Improved word breaking for long words */
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.carousel-card-description {
    color: #666;
    font-size: 0.87rem;
    line-height: 1.4;
    margin-bottom: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Allow 4 lines for better readability */
    -webkit-box-orient: vertical;
    /* Enhanced word breaking for long words */
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    /* Ensure proper text handling */
    white-space: normal;
}

/* Awards & Bonuses cards need more space for longer content */
.category-section[data-category="awards"] .carousel-card-description {
    -webkit-line-clamp: 6; /* Allow 6 lines for awards cards */
}

.carousel-ad-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #6c757d;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insights-nav-controls {
    display: flex;
    gap: 8px;
}

.insights-nav-controls .btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f0f2f5;
    border: none;
    color: #4a5568;
    box-shadow: 
        3px 3px 6px rgba(163, 177, 198, 0.3),
        -3px -3px 6px rgba(255, 255, 255, 0.7);
}

.insights-nav-controls .btn:hover {
    box-shadow: 
        4px 4px 8px rgba(163, 177, 198, 0.4),
        -4px -4px 8px rgba(255, 255, 255, 0.8),
        inset 1px 1px 2px rgba(163, 177, 198, 0.1);
    color: #2d3748;
}

.empty-category {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.empty-category i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Simplified chart styling */
.chart-card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Special handling for category chart to account for legend */
.chart-container.category-chart-container {
    height: 400px;
}

.chart-container.merchant-chart-container {
    height: 458px;
}

.chart-container-wide {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .insight-card {
        padding: 15px;
        gap: 12px;
    }
    
    .insight-icon {
        font-size: 1.3rem;
    }
    
    .insight-title {
        font-size: 0.95rem;
    }
    
    .insight-description {
        font-size: 0.85rem;
    }
    
    .chart-container {
        height: 300px;
    }
    
    /* Mobile height adjustments */
    .chart-container.category-chart-container {
        height: 300px;
    }
    
    .chart-container.merchant-chart-container {
        height: 358px;
    }
    
    .chart-container-wide {
        height: 300px;
    }
    
    /* Carousel mobile adjustments */
    .insights-tabs {
        gap: 8px;
    }
    
    .insights-tab {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .insights-tab span:not(.badge) {
        display: none; /* Hide text on mobile, keep icons and badges */
    }
    
    .carousel-insight-card {
        width: calc(50% - 10px); /* 2 cards on tablet */
        min-width: 200px;
        height: 200px; /* Consistent height with desktop */
        padding: 15px;
    }
    
    .category-nav-controls {
        display: none; /* Hide navigation buttons on tablet and mobile */
    }
    
    
    .insights-cards-wrapper::-webkit-scrollbar {
        display: none; /* Hide scrollbar on Webkit browsers */
    }
    
    
    .carousel-card-title {
        font-size: 0.9rem;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    
    .carousel-card-description {
        font-size: 0.85rem;
        line-height: 1.4;
        -webkit-line-clamp: 5; /* Allow more lines for better readability */
    }
    
    .carousel-card-content {
        gap: 0.25rem; /* Reduce gap between title and description on mobile */
    }
    
    /* Modal chart responsive adjustments - Mobile only */
    #categoryTrendModal .modal-dialog {
        max-width: 90vw;
        margin: 0.5rem auto;
        max-height: calc(100vh - 1rem);
    }
    
    #categoryTrendModal .modal-content {
        margin: 0;
        border-radius: 15px;
        max-height: calc(100vh - 1rem);
        overflow: hidden;
    }
    
    #categoryTrendModal .modal-body {
        padding: 0.75rem !important;
        overflow-y: auto;
        max-height: calc(100vh - 8rem);
    }
    
    #categoryTrendModal .modal-header {
        padding: 0.75rem;
        border-radius: 15px 15px 0 0;
        flex-shrink: 0;
    }
    
    #categoryTrendModal .modal-title {
        font-size: 1.25rem;
    }
    
    /* Remove chart container decoration on mobile to hide overflow */
    #categoryTrendModal .chart-container {
        height: 200px;
        width: 100%;
        position: relative;
    }
    
    /* Hide decorative chart container on mobile */
    #categoryTrendModal .modal-body > div[style*="background: rgb(240, 242, 245)"] {
        background: transparent !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        min-height: auto !important;
    }
    
    /* Alternative selector for the chart wrapper */
    #categoryTrendModal .modal-body > div[style*="border-radius: 20px"] {
        background: transparent !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        min-height: auto !important;
    }
    
    /* Most aggressive targeting - any div with neomorphism styling */
    #categoryTrendModal .modal-body > div[style*="box-shadow"][style*="padding: 1.5rem"] {
        background: transparent !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        min-height: auto !important;
    }
    
    /* Catch-all for any styled container div */
    #categoryTrendModal .modal-body > div[style*="min-height: 500px"] {
        background: transparent !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        min-height: auto !important;
    }
    
    /* Restore year navigation on mobile */
    #categoryTrendModal .year-navigation {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        gap: 0.25rem;
    }
    
    #categoryTrendModal .year-navigation button {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
        flex-shrink: 0;
    }
    
    #categoryTrendModal #modal-current-year-display {
        background: #f0f2f5 !important;
        padding: 8px 20px !important;
        border-radius: 20px !important;
        box-shadow: 
            inset 3px 3px 6px rgba(163, 177, 198, 0.3),
            inset -3px -3px 6px rgba(255, 255, 255, 0.7) !important;
        color: #2d3748 !important;
        font-weight: 600 !important;
        min-width: 80px !important;
        text-align: center !important;
        margin: 0 0.25rem !important;
        flex-shrink: 0;
    }
    
    /* Override Bootstrap classes with higher specificity */
    #categoryTrendModal span.mx-3.fw-bold#modal-current-year-display {
        background: #f0f2f5 !important;
        padding: 8px 20px !important;
        border-radius: 20px !important;
        box-shadow: 
            inset 3px 3px 6px rgba(163, 177, 198, 0.3),
            inset -3px -3px 6px rgba(255, 255, 255, 0.7) !important;
        color: #2d3748 !important;
        font-weight: 600 !important;
        min-width: 80px !important;
        text-align: center !important;
        margin: 0 0.25rem !important;
        flex-shrink: 0;
    }
    
    /* Simplify chart header on mobile */
    #categoryTrendModal .d-flex.justify-content-between.align-items-center.mb-2 {
        margin-bottom: 0.5rem !important;
        flex-wrap: nowrap;
    }
    
    #categoryTrendModal .d-flex.justify-content-between.align-items-center.mb-2 h6 {
        font-size: 0.9rem;
    }
    
    /* Center period display on mobile */
    #categoryTrendModal #categoryTrendPeriod {
        text-align: center;
    }
    
    /* Adjust category info section for mobile */
    #categoryTrendModal .col-sm-4 {
        margin-bottom: 0.5rem;
    }
}

/* Desktop modal styles - restore normal behavior */
@media (min-width: 769px) {
    #categoryTrendModal .modal-dialog {
        max-width: 800px;
        margin: 1.75rem auto;
        height: auto;
    }
    
    #categoryTrendModal .modal-content {
        height: auto;
        overflow: visible;
    }
    
    #categoryTrendModal .modal-body {
        padding: 2rem !important;
        overflow-y: visible;
        flex: none;
    }
    
    #categoryTrendModal .modal-header {
        flex-shrink: none;
        position: relative;
    }
    
    #categoryTrendModal .btn-close {
        position: static;
        transform: none;
        right: auto;
        top: auto;
    }
    
    #categoryTrendModal .chart-container {
        height: 350px;
    }
    
    /* Center period display on desktop */
    #categoryTrendModal #categoryTrendPeriod {
        text-align: center;
    }
}

@media (max-width: 480px) {
    
    /* Enhanced mobile modal adjustments for very small screens */
    #categoryTrendModal .modal-dialog {
        max-width: 95vw;
        margin: 0.25rem auto;
        max-height: calc(100vh - 0.5rem);
    }
    
    #categoryTrendModal .modal-content {
        max-height: calc(100vh - 0.5rem);
    }
    
    #categoryTrendModal .modal-body {
        padding: 0.5rem !important;
        overflow-y: auto;
        max-height: calc(100vh - 6rem);
    }
    
    #categoryTrendModal .modal-header {
        padding: 0.5rem;
        flex-shrink: 0;
    }
    
    #categoryTrendModal .modal-title {
        font-size: 1.1rem;
    }
    
    #categoryTrendModal .chart-container {
        height: 200px;
        width: 100%;
        position: relative;
    }
    
    /* Stack category info vertically on very small screens */
    #categoryTrendModal .col-sm-4 {
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    /* Reduce icon size on very small screens */
    #categoryTrendModal #categoryTrendIcon {
        font-size: 1.75rem !important;
    }
    
    /* Extra aggressive removal of decorative elements on small screens */
    #categoryTrendModal .modal-body > div[style*="background: rgb(240, 242, 245)"] {
        background: transparent !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        min-height: auto !important;
    }
    
    #categoryTrendModal .modal-body > div[style*="border-radius: 20px"] {
        background: transparent !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        min-height: auto !important;
    }
    
    /* Compact year navigation on small screens */
    #categoryTrendModal .year-navigation {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        gap: 0.15rem;
    }
    
    #categoryTrendModal .year-navigation button {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
        flex-shrink: 0;
        min-width: 30px;
    }
    
    #categoryTrendModal #modal-current-year-display {
        background: #f0f2f5 !important;
        padding: 6px 16px !important;
        border-radius: 16px !important;
        box-shadow: 
            inset 3px 3px 6px rgba(163, 177, 198, 0.3),
            inset -3px -3px 6px rgba(255, 255, 255, 0.7) !important;
        color: #2d3748 !important;
        font-weight: 600 !important;
        min-width: 70px !important;
        text-align: center !important;
        margin: 0 0.15rem !important;
        flex-shrink: 0;
        font-size: 0.8rem;
    }
    
    /* Override Bootstrap classes with higher specificity for small screens */
    #categoryTrendModal span.mx-3.fw-bold#modal-current-year-display {
        background: #f0f2f5 !important;
        padding: 6px 16px !important;
        border-radius: 16px !important;
        box-shadow: 
            inset 3px 3px 6px rgba(163, 177, 198, 0.3),
            inset -3px -3px 6px rgba(255, 255, 255, 0.7) !important;
        color: #2d3748 !important;
        font-weight: 600 !important;
        min-width: 70px !important;
        text-align: center !important;
        margin: 0 0.15rem !important;
        flex-shrink: 0;
        font-size: 0.8rem;
    }
    
    /* Keep navigation horizontal on small screens */
    #categoryTrendModal .d-flex.justify-content-between.align-items-center.mb-2 {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }
    
    /* Hide title on very small screens to make room for navigation */
    #categoryTrendModal .d-flex.justify-content-between.align-items-center.mb-2 > div:first-child {
        display: none;
    }
    
    /* Removed duplicate - already handled above */
    
    .insights-carousel-container {
        padding: 15px 15px 15px 15px !important; /* Normal padding */
        margin-bottom: 10px;
        overflow: hidden;
    }
}

/* Global override for modal year display - highest priority */
#modal-current-year-display {
    background: #f0f2f5 !important;
    padding: 8px 20px !important;
    border-radius: 20px !important;
    box-shadow: 
        inset 3px 3px 6px rgba(163, 177, 198, 0.3),
        inset -3px -3px 6px rgba(255, 255, 255, 0.7) !important;
    color: #2d3748 !important;
    font-weight: 600 !important;
    min-width: 80px !important;
    text-align: center !important;
    margin: 0 0.5rem !important;
    display: inline-block !important;
}

/* Force override with maximum specificity */
span#modal-current-year-display.mx-3.fw-bold {
    background: #f0f2f5 !important;
    padding: 8px 20px !important;
    border-radius: 20px !important;
    box-shadow: 
        inset 3px 3px 6px rgba(163, 177, 198, 0.3),
        inset -3px -3px 6px rgba(255, 255, 255, 0.7) !important;
    color: #2d3748 !important;
    font-weight: 600 !important;
    min-width: 80px !important;
    text-align: center !important;
    margin: 0 0.5rem !important;
    display: inline-block !important;
}