/* Stats Components CSS - Standardized stats boxes for the admin dashboard */

/* Base stats box styling */
.stats-box {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.stats-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stats-body {
    padding-left: 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
    padding-right: 1rem;
    padding-top: 0.5rem;
}

.stats-row {
    width: 100%;
}

.stats-header {
    margin-bottom: 0.75rem;
}

.stats-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: white;
    opacity: 0.9;
}

.stats-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stats-value-container {
    display: flex;
    flex-direction: column;
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1;
}

.stats-icon {
    font-size: 2.5rem;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.stats-icon i.fas {
    color: #cbcbcb;
}

.stats-box:hover .stats-icon {
    transform: scale(1.1);
}

/* Color variants with gradients from working version */
.stats-box.stats-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
}

.stats-box.stats-info {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
    color: white;
    border: none;
}

.stats-box.stats-warning {
    background: linear-gradient(135deg, #ffc107 0%, #d39e00 100%);
    color: #212529;
    border: none;
}

.stats-box.stats-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border: none;
}

.stats-box.stats-danger {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
    color: white;
    border: none;
}

.stats-box.stats-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
}

.stats-box.stats-dark {
    background: linear-gradient(135deg, #343a40 0%, #1d2124 100%);
    color: white;
    border: none;
}

.stats-box.stats-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e2e6ea 100%);
    color: #212529;
    border: 1px solid #dee2e6;
}

.stats-box.stats-light .stats-title,
.stats-box.stats-light .stats-value {
    color: #212529;
}

.stats-box.stats-light .stats-icon {
    color: rgba(108, 117, 125, 0.3);
}

/* Trend indicators */
.stats-trend {
    display: flex;
    align-items: center;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.stats-trend.trend-up {
    color: rgba(255, 255, 255, 0.9);
}

.stats-trend.trend-down {
    color: rgba(255, 255, 255, 0.9);
}

.stats-trend.trend-neutral {
    color: rgba(255, 255, 255, 0.7);
}

/* Dark text trends for light backgrounds */
.stats-box.stats-warning .stats-trend.trend-up,
.stats-box.stats-warning .stats-trend.trend-down,
.stats-box.stats-warning .stats-trend.trend-neutral {
    color: rgba(33, 37, 41, 0.8);
}

.stats-box.stats-light .stats-trend.trend-up,
.stats-box.stats-light .stats-trend.trend-down,
.stats-box.stats-light .stats-trend.trend-neutral {
    color: rgba(33, 37, 41, 0.8);
}

.stats-trend i {
    margin-right: 0.25rem;
}

/* Badge */
.stats-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 1;
}

/* Stats container with flexbox layout like original */
.stats-container {
    display: flex;
    flex-wrap: wrap;
    margin: calc(var(--stats-gap, 1rem) / -2); /* Negative margin to offset item margins */
}

.stats-container.gap-sm { --stats-gap: 0.5rem; }
.stats-container.gap-md { --stats-gap: 1rem; }
.stats-container.gap-lg { --stats-gap: 1.5rem; }
.stats-container.gap-xl { --stats-gap: 2rem; }

/* Responsive Grid Layout */
.stats-container > .stats-box {
    margin: calc(var(--stats-gap, 1rem) / 2); /* Half gap as margin on all sides */
}

.stats-container.cols-1 > .stats-box { 
    flex: 0 0 calc(100% - var(--stats-gap, 1rem)); 
}

.stats-container.cols-2 > .stats-box { 
    flex: 0 0 calc(50% - var(--stats-gap, 1rem)); 
}

.stats-container.cols-3 > .stats-box { 
    flex: 0 0 calc(33.333% - var(--stats-gap, 1rem)); 
}

.stats-container.cols-4 > .stats-box { 
    flex: 0 0 calc(25% - var(--stats-gap, 1rem)); 
}

.stats-container.cols-6 > .stats-box { 
    flex: 0 0 calc(16.666% - var(--stats-gap, 1rem)); 
}

/* Auto-responsive behavior */
@media (max-width: 1200px) {
    .stats-container.cols-4 > .stats-box,
    .stats-container.cols-6 > .stats-box { 
        flex: 0 0 calc(50% - var(--stats-gap, 1rem)); 
    }
}

@media (max-width: 768px) {
}

/* Animation */
.stats-box.stats-animated {
    cursor: pointer;
}

.stats-box.stats-animated:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Responsive design */
@media (max-width: 768px) {
}

/* Dark mode adjustments */
[data-theme="dark"] .stats-box {
    box-shadow: 0 2px 4px rgba(255,255,255,0.1);
}

[data-theme="dark"] .stats-box:hover {
    box-shadow: 0 4px 8px rgba(255,255,255,0.15);
}

[data-theme="dark"] .stats-box.stats-light {
    background: var(--card-bg);
    border-color: var(--card-border);
}

[data-theme="dark"] .stats-box.stats-light .stats-title,
[data-theme="dark"] .stats-box.stats-light .stats-value {
    color: var(--text-color);
}

[data-theme="dark"] .stats-box.stats-light .stats-icon {
    color: var(--secondary-color);
}

/* ============================================
   ADDITIONAL STATS COMPONENTS FROM STYLE.CSS
   ============================================ */

/* Stats Grid Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Stats Widget */
.stats-widget {
    display: grid;
    gap: 1rem;
}

/* Stats Card Icon Styling */
.stats-card-icon {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.card-stat:hover .stats-card-icon {
    opacity: 0.9;
}

/* Card Stat Variants with Icons */
.card-stat-primary .stats-card-icon,
.card.bg-primary .stats-card-icon {
    color: rgba(255, 255, 255, 0.7) !important;
}

.card-stat-success .stats-card-icon,
.card.bg-success .stats-card-icon {
    color: rgba(255, 255, 255, 0.7) !important;
}

.card-stat-warning .stats-card-icon,
.card.bg-warning .stats-card-icon {
    color: rgba(0, 0, 0, 0.7) !important;
}

.card-stat-info .stats-card-icon,
.card.bg-info .stats-card-icon {
    color: rgba(255, 255, 255, 0.7) !important;
}

.card-stat-danger .stats-card-icon,
.card.bg-danger .stats-card-icon {
    color: rgba(255, 255, 255, 0.7) !important;
}

.card-stat-secondary .stats-card-icon,
.card.bg-secondary .stats-card-icon {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Size Variants */
.stats-box.stats-compact {
    min-height: 80px;
}

.stats-box.stats-compact .card-body {
    padding: 1rem;
}

.stats-box.stats-compact .stats-value {
    font-size: 1.5rem;
}

.stats-box.stats-compact .stats-icon {
    font-size: 1.8rem;
}

.stats-box.stats-large {
    min-height: 160px;
}

.stats-box.stats-large .stats-value {
    font-size: 2.5rem;
}

.stats-box.stats-large .stats-icon {
    font-size: 3rem;
}

/* Direction Utilities */
.stats-vertical .stats-container {
    flex-direction: column;
}

.stats-horizontal .stats-container {
    flex-direction: row;
}

/* High contrast and reduced motion support */
@media (prefers-contrast: high) {
    .stats-card-icon {
        opacity: 1 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stats-card-icon {
        transition: none;
    }
}/**
 * Toast Notification Styles
 * Drop-down animations from middle top of page
 */

.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    min-height: 60px;
    pointer-events: all;
    position: relative;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid;
    overflow: hidden;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.hide {
    transform: translateY(-100px);
    opacity: 0;
    margin-bottom: 0;
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    min-height: 60px;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
}

.toast-message {
    flex: 1;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 500;
    word-wrap: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

/* Toast Types */
.toast-success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.toast-success .toast-icon {
    color: #28a745;
}

.toast-error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.toast-error .toast-icon {
    color: #dc3545;
}

.toast-warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.toast-warning .toast-icon {
    color: #ffc107;
}

.toast-info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

.toast-info .toast-icon {
    color: #17a2b8;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #2d3748;
        color: #e2e8f0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .toast-success {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
        border-left-color: #68d391;
        color: #9ae6b4;
    }

    .toast-error {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
        border-left-color: #fc8181;
        color: #feb2b2;
    }

    .toast-warning {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
        border-left-color: #f6e05e;
        color: #faf089;
    }

    .toast-info {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
        border-left-color: #63b3ed;
        color: #90cdf4;
    }

    .toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .toast-container {
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
        padding: 0;
    }

    .toast-content {
        padding: 14px 16px;
        min-height: 50px;
    }

    .toast-message {
        font-size: 13px;
    }

    .toast-icon {
        font-size: 16px;
        width: 20px;
        height: 20px;
    }
}

/* Animation for stacking */
.toast:nth-child(1) { animation-delay: 0ms; }
.toast:nth-child(2) { animation-delay: 100ms; }
.toast:nth-child(3) { animation-delay: 200ms; }
.toast:nth-child(4) { animation-delay: 300ms; }
.toast:nth-child(5) { animation-delay: 400ms; }

/* Pulse animation for urgent messages */
@keyframes pulse {
    0% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); }
    50% { box-shadow: 0 4px 25px rgba(0, 0, 0, 0.25); }
    100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); }
}

.toast.pulse {
    animation: pulse 2s infinite;
}

/* Modal Toast Styles */
.toast-modal {
    background: white;
    border: 2px solid;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-height: auto;
    max-width: 400px;
    width: 90%;
}

.toast-modal .toast-content {
    padding: 20px 24px 16px 24px;
    text-align: center;
}

.toast-modal .toast-message {
    font-size: 15px;
    line-height: 1.5;
    margin-top: 8px;
}

.toast-modal .toast-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.toast-actions {
    display: flex;
    gap: 8px;
    padding: 0 24px 20px 24px;
    justify-content: center;
}

.toast-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.toast-btn-confirm {
    background: var(--primary-color, #007cba);
    color: white;
}

.toast-btn-confirm:hover {
    background: var(--primary-color-dark, #005a8a);
    transform: translateY(-1px);
}

.toast-btn-cancel {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.toast-btn-cancel:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-1px);
}

/* Modal toast type styles */
.toast-modal.toast-confirm {
    border-color: #17a2b8;
}

.toast-modal.toast-warning {
    border-color: #ffc107;
}

.toast-modal.toast-error {
    border-color: #dc3545;
}

.toast-modal.toast-info {
    border-color: #17a2b8;
}

/* Force dark mode styles for all modal toasts EXCEPT warning */
.toast-modal:not(.toast-warning) {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%) !important;
    color: #f7fafc !important;
    border: 2px solid #4a5568 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
}

.toast-modal:not(.toast-warning) .toast-message {
    color: #e2e8f0 !important;
}

.toast-modal:not(.toast-warning) .toast-btn-confirm {
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.3) !important;
}

.toast-modal:not(.toast-warning) .toast-btn-confirm:hover {
    background: linear-gradient(135deg, #2c5aa0 0%, #2a4d8f 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.4) !important;
}

.toast-modal:not(.toast-warning) .toast-btn-cancel {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
    color: #e2e8f0 !important;
    border: 1px solid #718096 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.toast-modal:not(.toast-warning) .toast-btn-cancel:hover {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%) !important;
    color: #f7fafc !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Yellow warning modal styles */
.toast-modal.toast-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%) !important;
    color: #856404 !important;
    border: none !important;
    border-left: 4px solid #ffc107 !important;
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.3) !important;
    max-width: 500px !important;
    width: 100% !important;
    min-height: 60px !important;
    border-radius: 8px !important;
}

.toast-modal.toast-warning .toast-content {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-align: left !important;
    padding: 16px 20px 8px 20px !important;
}

.toast-modal.toast-warning .toast-message {
    font-size: 18px !important;
    line-height: 1.4 !important;
    font-weight: 500 !important;
    margin-top: 0 !important;
    flex: 1 !important;
    color: #856404 !important;
}

.toast-modal.toast-warning .toast-icon {
    font-size: 21px !important;
    margin-bottom: 0 !important;
    color: #ffc107 !important;
    flex-shrink: 0 !important;
}

.toast-modal.toast-warning .toast-actions {
    padding: 8px 20px 16px 20px !important;
    justify-content: flex-end !important;
    gap: 12px !important;
}

.toast-modal.toast-warning .toast-btn-confirm {
    background: #ffc107 !important;
    color: #856404 !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 6px 16px !important;
    font-size: 14px !important;
    border-radius: 5px !important;
}

.toast-modal.toast-warning .toast-btn-confirm:hover {
    background: #ffb700 !important;
    color: #6c5400 !important;
}

.toast-modal.toast-warning .toast-btn-cancel {
    background: rgba(255, 255, 255, 0.8) !important;
    color: #856404 !important;
    border: 1px solid rgba(133, 100, 4, 0.3) !important;
    padding: 6px 16px !important;
    font-size: 14px !important;
    border-radius: 5px !important;
}

.toast-modal.toast-warning .toast-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #6c5400 !important;
}

/* Modal type borders and glows */
.toast-modal.toast-confirm {
    border-color: #63b3ed !important;
    box-shadow: 0 8px 32px rgba(99, 179, 237, 0.3) !important;
}

.toast-modal.toast-warning {
    border-color: #f6e05e !important;
    box-shadow: 0 8px 32px rgba(246, 224, 94, 0.3) !important;
}

.toast-modal.toast-error {
    border-color: #fc8181 !important;
    box-shadow: 0 8px 32px rgba(252, 129, 129, 0.3) !important;
}

.toast-modal.toast-info {
    border-color: #90cdf4 !important;
    box-shadow: 0 8px 32px rgba(144, 205, 244, 0.3) !important;
}

/* Icon colors */
.toast-modal.toast-confirm .toast-icon {
    color: #63b3ed !important;
}

.toast-modal.toast-warning .toast-icon {
    color: #f6e05e !important;
}

.toast-modal.toast-error .toast-icon {
    color: #fc8181 !important;
}

.toast-modal.toast-info .toast-icon {
    color: #90cdf4 !important;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: opacity 0.2s ease;
    }
    
    .toast.show {
        transform: none;
    }
    
    .toast.hide {
        transform: none;
    }
}

/* Stats Container Spacing */
.stats-container-spacing {
    margin-bottom: 20px;
}