/* Clean Analytics Dashboard Styles */

.analytics-dashboard {
    margin-top: 2rem;
}

/* KPI Cards */
.kpi-card {
    background: var(--dark-card);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    height: 100%;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.kpi-card.success {
    border-color: var(--neon-green);
    background: linear-gradient(135deg, rgba(57, 255, 20, 0.1), var(--dark-card));
}

.kpi-card.info {
    border-color: #007BFF;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), var(--dark-card));
}

.kpi-card.warning {
    border-color: var(--neon-orange);
    background: linear-gradient(135deg, rgba(255, 127, 17, 0.1), var(--dark-card));
}

.kpi-card.danger {
    border-color: #FF3B30;
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.1), var(--dark-card));
}

.kpi-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.kpi-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.kpi-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chart Cards */
.chart-card {
    background: var(--dark-card);
    border-radius: 12px;
    border: 1px solid #404040;
    overflow: hidden;
    height: 100%;
}

.chart-header {
    padding: 1.5rem 1.5rem 0;
    border-bottom: 1px solid #404040;
    margin-bottom: 1rem;
}

.chart-header h5 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.chart-header p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.chart-body {
    padding: 0 1.5rem;
    position: relative;
}

.chart-footer {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid #404040;
}

/* Donut Chart Specific */
.donut-chart-container {
    position: relative;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.center-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    line-height: 1;
}

.center-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Legend */
.legend-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.legend-item:hover {
    background: rgba(57, 255, 20, 0.05);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-light);
}

.legend-value {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: bold;
}

/* Impact Story */
.impact-story-card {
    background: var(--dark-card);
    border-radius: 12px;
    border: 1px solid #404040;
    overflow: hidden;
}

.story-header {
    padding: 1.5rem;
    border-bottom: 1px solid #404040;
    background: linear-gradient(135deg, rgba(57, 255, 20, 0.05), transparent);
}

.story-header h5 {
    color: var(--text-light);
    margin: 0;
    font-weight: bold;
}

.story-content {
    padding: 1.5rem;
    color: var(--text-light);
    line-height: 1.6;
    font-size: 1rem;
}

.insight-text {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kpi-card {
        margin-bottom: 1rem;
    }
    
    .chart-card {
        margin-bottom: 2rem;
    }
    
    .center-number {
        font-size: 2rem;
    }
    
    .kpi-value {
        font-size: 1.5rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Chart Loading State */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
}

.chart-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--neon-green);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Theme Support */
body.light-theme .kpi-card {
    background: #FFFFFF;
    border-color: #E0E0E0;
}

body.light-theme .chart-card {
    background: #FFFFFF;
    border-color: #E0E0E0;
}

body.light-theme .impact-story-card {
    background: #FFFFFF;
    border-color: #E0E0E0;
}

body.light-theme .chart-header {
    border-bottom-color: #E0E0E0;
}

body.light-theme .chart-footer {
    background: rgba(0, 0, 0, 0.05);
    border-top-color: #E0E0E0;
}

body.light-theme .story-header {
    border-bottom-color: #E0E0E0;
}/* 
Chart Cards */
.chart-card {
    background: var(--dark-card);
    border: 1px solid #404040;
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.chart-card:hover {
    border-color: rgba(57, 255, 20, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.chart-header h5 {
    color: var(--neon-orange);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.chart-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.chart-body {
    position: relative;
    margin: 2rem 0;
    min-height: 300px;
}

.chart-footer {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid rgba(57, 255, 20, 0.1);
}

/* Donut Chart Container */
.donut-chart-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.donut-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.center-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    margin-bottom: 0.25rem;
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

.center-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Legend Styles */
.legend-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.legend-item:hover {
    background: rgba(57, 255, 20, 0.05);
    transform: translateX(4px);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.legend-text {
    flex: 1;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
}

.legend-value {
    color: var(--neon-green);
    font-weight: bold;
    font-size: 0.9rem;
}

/* Impact Story Card */
.impact-story-card {
    background: linear-gradient(135deg, rgba(57, 255, 20, 0.05), rgba(255, 127, 17, 0.05));
    border: 1px solid rgba(57, 255, 20, 0.2);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.impact-story-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(57, 255, 20, 0.1), transparent);
    animation: story-shimmer 3s ease-in-out infinite;
}

.story-header h5 {
    color: var(--neon-orange);
    font-weight: bold;
    margin-bottom: 1rem;
}

.story-content {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

/* Insight Text */
.insight-text {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* KPI Cards */
.kpi-card {
    background: var(--dark-card);
    border: 1px solid #404040;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(57, 255, 20, 0.15);
}

.kpi-card.success {
    border-left: 4px solid var(--neon-green);
}

.kpi-card.info {
    border-left: 4px solid #007BFF;
}

.kpi-card.warning {
    border-left: 4px solid var(--neon-orange);
}

.kpi-card.danger {
    border-left: 4px solid var(--alert-red);
}

.kpi-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.kpi-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pulse animation for KPI updates */
.pulse {
    animation: kpi-pulse 0.6s ease-in-out;
}

@keyframes kpi-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chart-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .chart-body {
        min-height: 250px;
    }
    
    .center-number {
        font-size: 2rem;
    }
    
    .kpi-card {
        margin-bottom: 1rem;
    }
    
    .kpi-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .chart-card {
        padding: 1rem;
    }
    
    .impact-story-card {
        padding: 1.5rem;
    }
    
    .center-number {
        font-size: 1.8rem;
    }
}

/* Light Theme Form Controls (Default) */
.form-select,
.form-select-sm {
    background-color: #ffffff;
    border: 1px solid #ced4da;
    color: #495057;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
}

/* Dark Theme Form Controls */
body.dark-theme .form-select,
body.dark-theme .form-select-sm {
    background-color: var(--dark-card);
    border: 1px solid #404040;
    color: var(--text-light);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2339FF14' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
}

/* Light theme focus states */
.form-select:focus,
.form-select-sm:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    background-color: #ffffff;
    color: #495057;
}

/* Dark theme focus states */
body.dark-theme .form-select:focus,
body.dark-theme .form-select-sm:focus {
    border-color: var(--neon-green);
    box-shadow: 0 0 0 0.2rem rgba(57, 255, 20, 0.25);
    background-color: var(--dark-card);
    color: var(--text-light);
}

/* Light theme hover states */
.form-select:hover,
.form-select-sm:hover {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.05);
}

/* Dark theme hover states */
body.dark-theme .form-select:hover,
body.dark-theme .form-select-sm:hover {
    border-color: rgba(57, 255, 20, 0.5);
    background-color: rgba(57, 255, 20, 0.05);
}

/* Light theme select options */
.form-select option,
.form-select-sm option {
    background-color: #ffffff;
    color: #495057;
    border: none;
}

/* Dark theme select options */
body.dark-theme .form-select option,
body.dark-theme .form-select-sm option {
    background-color: var(--dark-card);
    color: var(--text-light);
    border: none;
}

/* Light theme form inputs (default) */
.form-control {
    background-color: #ffffff;
    border: 1px solid #ced4da;
    color: #495057;
    transition: all 0.3s ease;
}

/* Dark theme form inputs */
body.dark-theme .form-control {
    background-color: var(--dark-card);
    border: 1px solid #404040;
    color: var(--text-light);
}

/* Light theme form control focus */
.form-control:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    background-color: #ffffff;
    color: #495057;
}

/* Dark theme form control focus */
body.dark-theme .form-control:focus {
    border-color: var(--neon-green);
    box-shadow: 0 0 0 0.2rem rgba(57, 255, 20, 0.25);
    background-color: var(--dark-card);
    color: var(--text-light);
}

/* Light theme placeholder */
.form-control::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

/* Dark theme placeholder */
body.dark-theme .form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Light theme form control hover */
.form-control:hover {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.05);
}

/* Dark theme form control hover */
body.dark-theme .form-control:hover {
    border-color: rgba(57, 255, 20, 0.5);
    background-color: rgba(57, 255, 20, 0.05);
}

/* Light theme form labels */
.form-label {
    color: #495057;
    font-weight: 600;
}

/* Dark theme form labels */
body.dark-theme .form-label {
    color: var(--text-light);
    font-weight: 600;
}

/* Modal form styling */
.modal-content {
    background-color: var(--dark-card) !important;
    border: 1px solid #404040 !important;
    color: var(--text-light) !important;
}

body.dark-theme .modal-content {
    background-color: var(--dark-card) !important;
    border: 1px solid #404040 !important;
    color: var(--text-light) !important;
}

.modal-header {
    border-bottom: 1px solid #404040 !important;
}

body.dark-theme .modal-header {
    border-bottom: 1px solid #404040 !important;
}

.modal-footer {
    border-top: 1px solid #404040 !important;
}

body.dark-theme .modal-footer {
    border-top: 1px solid #404040 !important;
}

.modal-title {
    color: var(--neon-orange) !important;
    font-weight: bold;
}

body.dark-theme .modal-title {
    color: var(--neon-orange) !important;
    font-weight: bold;
}

/* Button styling for dark theme */
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body.dark-theme .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Filter controls styling */
.filter-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-controls .form-control,
.filter-controls .form-select {
    min-width: 200px;
    flex: 1;
}

@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls .form-control,
    .filter-controls .form-select {
        min-width: unset;
        width: 100%;
    }
}

/* Enhanced dropdown arrow for better visibility */
.form-select {
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.25rem;
}

body.dark-theme .form-select {
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.25rem;
}

/* Small form select specific styling */
.form-select-sm {
    padding: 0.25rem 1.5rem 0.25rem 0.5rem;
    font-size: 0.875rem;
    background-position: right 0.5rem center;
    background-size: 12px 9px;
}

body.dark-theme .form-select-sm {
    padding: 0.25rem 1.5rem 0.25rem 0.5rem;
    font-size: 0.875rem;
    background-position: right 0.5rem center;
    background-size: 12px 9px;
}/* Tabl
e-specific form controls */
.inventory-table .form-select-sm {
    border-radius: 6px !important;
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
    min-width: 120px !important;
    transition: all 0.2s ease !important;
}

body.dark-theme .inventory-table .form-select-sm {
    border-radius: 6px !important;
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
    min-width: 120px !important;
    transition: all 0.2s ease !important;
}

.inventory-table .form-select-sm:focus {
    transform: scale(1.02) !important;
    z-index: 10 !important;
    position: relative !important;
}

body.dark-theme .inventory-table .form-select-sm:focus {
    transform: scale(1.02) !important;
    z-index: 10 !important;
    position: relative !important;
}

/* Table cell padding adjustment for form controls */
.inventory-table td:has(.form-select-sm) {
    padding: 0.5rem !important;
}

body.dark-theme .inventory-table td:has(.form-select-sm) {
    padding: 0.5rem !important;
}

/* Ensure proper text contrast in all states */
.form-select-sm option:checked {
    background-color: var(--neon-green) !important;
    color: #000 !important;
}

body.dark-theme .form-select-sm option:checked {
    background-color: var(--neon-green) !important;
    color: #000 !important;
}

/* Loading state for dropdowns */
.form-select-sm.loading {
    opacity: 0.6;
    pointer-events: none;
}

body.dark-theme .form-select-sm.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success state after update */
.form-select-sm.updated {
    border-color: var(--neon-green) !important;
    box-shadow: 0 0 0 2px rgba(57, 255, 20, 0.2) !important;
    animation: form-update-flash 0.6s ease-out;
}

body.dark-theme .form-select-sm.updated {
    border-color: var(--neon-green) !important;
    box-shadow: 0 0 0 2px rgba(57, 255, 20, 0.2) !important;
    animation: form-update-flash 0.6s ease-out;
}

@keyframes form-update-flash {
    0% { 
        background-color: rgba(57, 255, 20, 0.3);
        transform: scale(1.05);
    }
    100% { 
        background-color: var(--dark-card);
        transform: scale(1);
    }
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .inventory-table .form-select-sm {
        min-width: 100px !important;
        font-size: 0.75rem !important;
    }
    
    body.dark-theme .inventory-table .form-select-sm {
        min-width: 100px !important;
        font-size: 0.75rem !important;
    }
}

@media (max-width: 576px) {
    .inventory-table .form-select-sm {
        min-width: 80px !important;
        font-size: 0.7rem !important;
        padding: 0.2rem 1.2rem 0.2rem 0.4rem !important;
    }
    
    body.dark-theme .inventory-table .form-select-sm {
        min-width: 80px !important;
        font-size: 0.7rem !important;
        padding: 0.2rem 1.2rem 0.2rem 0.4rem !important;
    }
}

/* Particle Trail Effect */
.particle-trail {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 4px;
    height: 4px;
    border-radius: 1px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.particle-green {
    background: #39FF14;
    box-shadow: 0 0 4px rgba(57, 255, 20, 0.5);
}

.particle-blue {
    background: #007BFF;
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.5);
}

.particle-fade {
    animation: particleFade 0.8s ease-out forwards;
}

@keyframes particleFade {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.3);
    }
}

/* Disable particles on mobile to save resources */
@media (max-width: 768px) {
    .particle-trail {
        display: none;
    }
}

/* Disable particles for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .particle-trail {
        display: none;
    }
}/* Lig
ht Theme Card Fixes */

/* How to Use Card - Light Theme */
.how-to-use-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(40, 167, 69, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

body.dark-theme .how-to-use-card {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(57, 255, 20, 0.4);
}

/* How to Use Header - Light Theme */
.how-to-header h3 {
    color: #28a745;
    font-size: 1.25rem;
    font-weight: bold;
    margin: 0;
}

body.dark-theme .how-to-header h3 {
    color: var(--neon-green);
}

.how-to-header h3 i {
    margin-right: 0.5rem;
    color: #fd7e14;
}

body.dark-theme .how-to-header h3 i {
    color: var(--neon-orange);
}

/* How to Use Section Headers - Light Theme */
.how-to-section h4 {
    color: #fd7e14;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark-theme .how-to-section h4 {
    color: var(--neon-orange);
}

/* How to Use List Items - Light Theme */
.how-to-section li {
    color: #495057;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

body.dark-theme .how-to-section li {
    color: rgba(255, 255, 255, 0.9);
}

.how-to-section li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

body.dark-theme .how-to-section li::before {
    color: var(--neon-green);
}

.how-to-section strong {
    color: #28a745;
    font-weight: 600;
}

body.dark-theme .how-to-section strong {
    color: var(--neon-green);
}

/* How to Use Tips - Light Theme */
.how-to-tips {
    background: rgba(253, 126, 20, 0.1);
    border: 1px solid rgba(253, 126, 20, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

body.dark-theme .how-to-tips {
    background: rgba(255, 127, 17, 0.15);
    border-color: rgba(255, 127, 17, 0.4);
}

.how-to-tips h4 {
    color: #fd7e14;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

body.dark-theme .how-to-tips h4 {
    color: var(--neon-orange);
}

/* Context Cards - Light Theme */
.context-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

body.dark-theme .context-card {
    background: var(--dark-card);
    border-color: rgba(57, 255, 20, 0.2);
}

.context-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.15);
    border-color: #28a745;
}

body.dark-theme .context-card:hover {
    box-shadow: 0 8px 25px rgba(57, 255, 20, 0.15);
    border-color: var(--neon-green);
}

.context-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.context-label {
    color: #fd7e14;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

body.dark-theme .context-label {
    color: var(--neon-orange);
}

.context-value {
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

body.dark-theme .context-value {
    color: var(--text-light);
}

/* Analytics Cards - Light Theme */
.analytics-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    height: 100%;
    transition: all 0.3s ease;
}

body.dark-theme .analytics-card {
    background: var(--dark-card);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-color: #404040;
}

.analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.15);
    border-color: #28a745;
}

body.dark-theme .analytics-card:hover {
    border-color: rgba(57, 255, 20, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* Glass Card - Light Theme */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(40, 167, 69, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    transition: all 0.3s ease;
}

body.dark-theme .glass-card {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(57, 255, 20, 0.3);
}

/* Button Theme Fixes */
.btn-outline-light {
    border-color: #28a745;
    color: #28a745;
}

body.dark-theme .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.8);
}

.btn-outline-light:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

body.dark-theme .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    color: white;
}

/* Text Visibility Fixes for Light/Dark Mode */

/* How to Use Section Text */
.how-to-section li {
    color: #495057;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
    line-height: 1.6;
}

body.dark-theme .how-to-section li {
    color: rgba(255, 255, 255, 0.9);
}

/* Status Items */
.status-item {
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(40, 167, 69, 0.05);
    transition: all 0.3s ease;
}

body.dark-theme .status-item {
    background: rgba(255, 255, 255, 0.05);
}

.status-item:hover {
    background: rgba(40, 167, 69, 0.1);
    transform: translateX(5px);
}

body.dark-theme .status-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.status-item span:last-child {
    color: #6c757d;
    font-size: 0.85rem;
    flex: 1;
}

body.dark-theme .status-item span:last-child {
    color: rgba(255, 255, 255, 0.8);
}

/* Tip Items */
.tip-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

body.dark-theme .tip-item {
    background: rgba(255, 255, 255, 0.05);
}

.tip-item:hover {
    background: rgba(40, 167, 69, 0.1);
    transform: translateY(-2px);
}

body.dark-theme .tip-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tip-item span {
    color: #495057;
    font-size: 0.85rem;
    line-height: 1.4;
}

body.dark-theme .tip-item span {
    color: rgba(255, 255, 255, 0.9);
}

/* Insight Messages */
.insight-message {
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.4;
}

body.dark-theme .insight-message {
    color: #fff;
}

/* Insight Action Buttons */
.insight-action-btn {
    background: none;
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #28a745;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

body.dark-theme .insight-action-btn {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.insight-action-btn:hover {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.5);
    transform: translateX(2px);
}

body.dark-theme .insight-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Developer Note */
.developer-note p {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

body.dark-theme .developer-note p {
    color: rgba(255, 255, 255, 0.9);
}

/* Context Labels and Values */
.context-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

body.dark-theme .context-label {
    color: rgba(255, 255, 255, 0.7);
}

.context-value {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
    line-height: 1.3;
}

body.dark-theme .context-value {
    color: #fff;
}

/* Chart Subtitles */
.chart-subtitle {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

body.dark-theme .chart-subtitle {
    color: rgba(255, 255, 255, 0.6);
}

/* Center Labels */
.center-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

body.dark-theme .center-label {
    color: rgba(255, 255, 255, 0.8);
}

/* Chart Summaries */
.chart-summary {
    background: rgba(40, 167, 69, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid rgba(40, 167, 69, 0.1);
}

body.dark-theme .chart-summary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.summary-highlight {
    font-size: 1rem;
    color: #495057;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-align: center;
}

body.dark-theme .summary-highlight {
    color: #fff;
}

.summary-trend {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

body.dark-theme .summary-trend {
    color: rgba(255, 255, 255, 0.7);
}

/* Legend Items */
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

body.dark-theme .legend-item {
    background: rgba(255, 255, 255, 0.05);
}

.legend-item:hover {
    background: rgba(40, 167, 69, 0.1);
    transform: translateX(3px);
}

body.dark-theme .legend-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.legend-text {
    font-size: 0.8rem;
    color: #495057;
    flex: 1;
    font-weight: 500;
}

body.dark-theme .legend-text {
    color: rgba(255, 255, 255, 0.8);
}

.legend-value {
    font-size: 0.8rem;
    color: #28a745;
    font-weight: 600;
}

body.dark-theme .legend-value {
    color: #fff;
}

/* Notification Text */
.notification {
    border: 1px solid rgba(40, 167, 69, 0.1);
}

body.dark-theme .notification {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification.alert-info {
    background: rgba(0, 123, 255, 0.1);
    color: #0056b3;
    border-color: #007bff;
}

body.dark-theme .notification.alert-info {
    background: rgba(0, 123, 255, 0.9);
    color: #fff;
}

/* General Text Elements */
.text-muted {
    color: #6c757d !important;
}

body.dark-theme .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Ensure all white text has dark theme alternatives */
.text-white {
    color: #495057 !important;
}

body.dark-theme .text-white {
    color: #fff !important;
}

/* Fix any remaining visibility issues */
.card-text, .card-body p, .section-description {
    color: #495057;
}

body.dark-theme .card-text,
body.dark-theme .card-body p,
body.dark-theme .section-description {
    color: rgba(255, 255, 255, 0.9);
}/* 
Table Filtering Highlights */
.highlight-row {
    background-color: rgba(255, 193, 7, 0.1) !important;
    border-left: 4px solid #ffc107 !important;
    animation: highlightPulse 2s ease-in-out;
}

body.dark-theme .highlight-row {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

@keyframes highlightPulse {
    0%, 100% { 
        background-color: rgba(255, 193, 7, 0.1);
    }
    50% { 
        background-color: rgba(255, 193, 7, 0.2);
    }
}

/* Filter Controls Enhancements */
.filter-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-message {
    font-size: 0.9rem;
    font-style: italic;
}

#reset-filter-btn {
    white-space: nowrap;
}

/* Insight Action Button Enhancements */
.insight-action-btn {
    transition: all 0.3s ease;
    cursor: pointer;
}

.insight-action-btn:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}/* C
omplete Light Mode Fix for All Analytics Components */

/* Impact Story Card */
.impact-story-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(40, 167, 69, 0.2);
    color: #495057;
}

body.dark-theme .impact-story-card {
    background: linear-gradient(135deg, rgba(57, 255, 20, 0.05), rgba(255, 127, 17, 0.05));
    border: 1px solid rgba(57, 255, 20, 0.2);
    color: var(--text-light);
}

.story-content {
    color: #495057;
    line-height: 1.6;
    font-size: 1rem;
}

body.dark-theme .story-content {
    color: var(--text-light);
}

/* KPI Cards Light Mode */
.kpi-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(40, 167, 69, 0.2);
    color: #495057;
}

body.dark-theme .kpi-card {
    background: var(--dark-card);
    border-color: rgba(57, 255, 20, 0.2);
    color: var(--text-light);
}

.kpi-value {
    color: #495057;
    font-size: 1.8rem;
    font-weight: bold;
}

body.dark-theme .kpi-value {
    color: var(--text-light);
}

.kpi-label {
    color: #6c757d;
    font-size: 0.9rem;
}

body.dark-theme .kpi-label {
    color: var(--text-muted);
}

/* Chart Cards Light Mode */
.chart-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(40, 167, 69, 0.2);
    color: #495057;
}

body.dark-theme .chart-card {
    background: var(--dark-card);
    border: 1px solid #404040;
    color: var(--text-light);
}

.chart-header h5 {
    color: #fd7e14;
    font-weight: bold;
}

body.dark-theme .chart-header h5 {
    color: var(--neon-orange);
}

.chart-header p {
    color: #6c757d;
    font-size: 0.9rem;
}

body.dark-theme .chart-header p {
    color: var(--text-muted);
}

/* Chart Footer/Insights */
.chart-footer {
    background: rgba(40, 167, 69, 0.05);
    border: 1px solid rgba(40, 167, 69, 0.1);
    color: #495057;
}

body.dark-theme .chart-footer {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(57, 255, 20, 0.1);
    color: var(--text-light);
}

.insight-text {
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.5;
}

body.dark-theme .insight-text {
    color: var(--text-light);
}

/* Donut Chart Center Text */
.donut-center-text {
    color: #495057;
}

body.dark-theme .donut-center-text {
    color: var(--text-light);
}

.center-number {
    color: #28a745;
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
}

body.dark-theme .center-number {
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.center-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-theme .center-label {
    color: var(--text-muted);
}

/* Legend Container Light Mode */
.legend-container {
    background: rgba(40, 167, 69, 0.05);
    border-radius: 12px;
    padding: 1rem;
}

body.dark-theme .legend-container {
    background: rgba(0, 0, 0, 0.2);
}

/* Context Cards (Top Saver, Needs Attention, etc.) */
.context-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(40, 167, 69, 0.2);
    color: #495057;
}

body.dark-theme .context-card {
    background: var(--dark-card);
    border-color: rgba(57, 255, 20, 0.2);
    color: var(--text-light);
}

/* All text elements that might be invisible */
.story-header h5,
.chart-title,
h3, h4, h5 {
    color: #fd7e14;
}

body.dark-theme .story-header h5,
body.dark-theme .chart-title,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5 {
    color: var(--neon-orange);
}

/* Generic text color fixes */
p, span, div {
    color: inherit;
}

/* Specific fixes for analytics text */
.analytics-card p,
.analytics-card span,
.analytics-card div:not(.chart-container):not(.legend-color) {
    color: #495057;
}

body.dark-theme .analytics-card p,
body.dark-theme .analytics-card span,
body.dark-theme .analytics-card div:not(.chart-container):not(.legend-color) {
    color: var(--text-light);
}

/* Chart body text */
.chart-body p,
.chart-body span,
.chart-body div:not(.chart-container):not(.legend-color) {
    color: #495057;
}

body.dark-theme .chart-body p,
body.dark-theme .chart-body span,
body.dark-theme .chart-body div:not(.chart-container):not(.legend-color) {
    color: var(--text-light);
}

/* Ensure all card content is visible */
.card-body,
.card-text,
.card-content {
    color: #495057;
}

body.dark-theme .card-body,
body.dark-theme .card-text,
body.dark-theme .card-content {
    color: var(--text-light);
}

/* Fix any remaining white text issues */
[style*="color: white"],
[style*="color: #fff"],
[style*="color: #ffffff"] {
    color: #495057 !important;
}

body.dark-theme [style*="color: white"],
body.dark-theme [style*="color: #fff"],
body.dark-theme [style*="color: #ffffff"] {
    color: var(--text-light) !important;
}

/* Specific fixes for dynamically generated content */
#impact-story,
#usage-insights,
#story-content {
    color: #495057;
}

body.dark-theme #impact-story,
body.dark-theme #usage-insights,
body.dark-theme #story-content {
    color: var(--text-light);
}

/* Override any hardcoded styles */
.analytics-card * {
    color: inherit;
}

.chart-card * {
    color: inherit;
}

.kpi-card * {
    color: inherit;
}

/* Ensure proper inheritance */
.analytics-card,
.chart-card,
.kpi-card,
.impact-story-card {
    color: #495057;
}

body.dark-theme .analytics-card,
body.dark-theme .chart-card,
body.dark-theme .kpi-card,
body.dark-theme .impact-story-card {
    color: var(--text-light);
}/* Chart 
Container Light Mode Fixes */
.chart-container {
    background: rgba(40, 167, 69, 0.05);
    border: 1px solid rgba(40, 167, 69, 0.1);
    border-radius: 12px;
    padding: 1rem;
    margin: 2rem 0;
}

body.dark-theme .chart-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(57, 255, 20, 0.1);
}

/* Enhanced Chart Card Backgrounds */
.enhanced-chart-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(40, 167, 69, 0.2);
    backdrop-filter: blur(10px);
    color: #495057;
}

body.dark-theme .enhanced-chart-card {
    background: var(--dark-card);
    border: 1px solid #404040;
    color: var(--text-light);
}

/* KPI Context Cards */
.kpi-context-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(40, 167, 69, 0.2);
    color: #495057;
}

body.dark-theme .kpi-context-card {
    background: var(--dark-card);
    border: 1px solid #404040;
    color: var(--text-light);
}

.kpi-card-title {
    color: #fd7e14;
    font-size: 0.9rem;
    font-weight: bold;
}

body.dark-theme .kpi-card-title {
    color: var(--neon-orange);
}

.kpi-card-value {
    color: #495057;
    font-size: 1.2rem;
    font-weight: bold;
}

body.dark-theme .kpi-card-value {
    color: var(--text-light);
}

.kpi-card-subtitle {
    color: #6c757d;
    font-size: 0.85rem;
}

body.dark-theme .kpi-card-subtitle {
    color: var(--text-muted);
}

/* Force all text in analytics section to be theme-responsive */
.analytics-section,
.analytics-section * {
    color: #495057;
}

body.dark-theme .analytics-section,
body.dark-theme .analytics-section * {
    color: var(--text-light);
}

/* Override any inline styles that might be causing issues */
.analytics-card [style],
.chart-card [style],
.kpi-card [style] {
    color: #495057 !important;
}

body.dark-theme .analytics-card [style],
body.dark-theme .chart-card [style],
body.dark-theme .kpi-card [style] {
    color: var(--text-light) !important;
}