/**
 * 24Coupons Stats Charts - Frontend Styles
 */

.tfc-stats-chart-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.tfc-chart-title {
    margin: 0 0 15px 0;
    font-weight: 600;
    line-height: 1.2;
}

.tfc-stats-summary {
    margin: 0 0 20px 0;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tfc-total-count {
    font-weight: 600;
}

.tfc-time-range {
    opacity: 0.7;
    font-style: italic;
}

.tfc-chart-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.tfc-chart-container canvas {
    max-width: 100%;
    height: auto !important;
}

.tfc-chart-legend {
    margin-top: 15px;
    text-align: center;
}

.tfc-chart-error {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

/* Loading state */
.tfc-chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #666;
    font-size: 14px;
}

.tfc-chart-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: tfc-spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .tfc-stats-chart-wrapper {
        padding: 15px;
    }
    
    .tfc-chart-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .tfc-stats-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        margin-bottom: 15px;
    }
    
    .tfc-chart-container {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .tfc-stats-chart-wrapper {
        padding: 10px;
    }
    
    .tfc-chart-title {
        font-size: 16px;
    }
    
    .tfc-stats-summary {
        font-size: 13px;
    }
}

/* Print styles */
@media print {
    .tfc-stats-chart-wrapper {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .tfc-chart-container {
        max-height: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tfc-chart-error {
        border-width: 2px;
        font-weight: 600;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .tfc-chart-loading::before {
        animation: none;
    }
}
