/* Cohort Analyzer Enhanced WordPress Plugin Styles */

.cohort-analyzer-container {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    background: #fff;
}

.cohort-analyzer-content {
    padding: 30px;
}

.analyzer-header {
    text-align: center;
    margin-bottom: 30px;
}

.analyzer-header h2 {
    color: #0073aa;
    margin-bottom: 10px;
    font-size: 28px;
}

.analyzer-header p {
    color: #666;
    font-size: 16px;
}

/* Upload Section */
.analyzer-upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #0073aa;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #005a87;
    background: #f0f8ff;
}

.upload-area.dragover {
    border-color: #00a32a;
    background: #f0fff0;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.upload-area h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.upload-area p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 16px;
}

.file-requirements {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.file-requirements small {
    color: #888;
    font-size: 12px;
}

.upload-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
    max-width: 300px;
    display: block;
    margin: 0 auto;
}

.upload-button:hover {
    background: #005a87;
}

.upload-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Progress Bar */
.upload-progress {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a32a);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    margin: 0;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Upload Result */
.upload-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    font-size: 14px;
}

.upload-result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.upload-result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Results Section */
.analyzer-results {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

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

.results-header h3 {
    margin: 0;
    color: #0073aa;
    font-size: 24px;
}

.download-pdf-button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.download-pdf-button:hover {
    background: #c82333;
}

.download-pdf-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Analysis Summary */
.analysis-summary {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.analysis-summary h4 {
    margin: 0 0 20px 0;
    color: #0073aa;
    font-size: 20px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    text-align: center;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.date-range {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    color: #666;
}

/* Visualizations Section */
.visualizations-section {
    margin: 25px 0;
}

.visualizations-section h4 {
    margin: 0 0 20px 0;
    color: #0073aa;
    font-size: 20px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.chart-container {
    margin: 25px 0;
    padding: 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.chart-canvas {
    max-height: 400px;
    width: 100%;
}

/* Cohort Heatmap */
.cohort-heatmap {
    margin: 25px 0;
    padding: 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    overflow-x: auto;
}

.cohort-heatmap .chart-title {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.heatmap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 800px;
}

.heatmap-table th,
.heatmap-table td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #ddd;
    min-width: 60px;
}

.heatmap-table th {
    background: #0073aa;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.heatmap-table tbody tr:nth-child(even) {
    background-color: rgba(0,0,0,0.02);
}

.heatmap-table tbody tr:hover {
    background-color: rgba(0,115,170,0.1);
}

.heatmap-cell {
    position: relative;
    font-weight: 600;
    transition: all 0.2s ease;
}

.heatmap-cell:hover {
    transform: scale(1.05);
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Analysis Insights */
.analysis-insights {
    background: #e7f3ff;
    padding: 25px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid #0073aa;
}

.analysis-insights h4 {
    color: #0073aa;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.analysis-insights ul {
    margin: 15px 0;
    padding-left: 25px;
}

.analysis-insights li {
    margin-bottom: 10px;
    color: #333;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cohort-analyzer-content {
        padding: 20px;
    }
    
    .upload-area {
        padding: 25px 15px;
    }
    
    .upload-area h3 {
        font-size: 20px;
    }
    
    .upload-area p {
        font-size: 14px;
    }
    
    .upload-icon {
        font-size: 36px;
    }
    
    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .results-header h3 {
        margin-bottom: 15px;
        text-align: center;
    }
    
    .chart-container,
    .cohort-heatmap {
        padding: 15px;
    }
    
    .heatmap-table {
        font-size: 10px;
    }
    
    .heatmap-table th,
    .heatmap-table td {
        padding: 8px 4px;
        min-width: 50px;
    }
}

@media (max-width: 480px) {
    .cohort-analyzer-content {
        padding: 15px;
    }
    
    .upload-area {
        padding: 20px 10px;
    }
    
    .upload-area h3 {
        font-size: 18px;
    }
    
    .upload-area p {
        font-size: 13px;
    }
    
    .upload-button {
        padding: 12px 30px;
        font-size: 14px;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 18px;
    }
    
    .analyzer-header h2 {
        font-size: 24px;
    }
    
    .chart-title {
        font-size: 16px;
    }
    
    .heatmap-table {
        font-size: 9px;
    }
    
    .heatmap-table th,
    .heatmap-table td {
        padding: 6px 2px;
        min-width: 45px;
    }
}

/* Loading States */
.cohort-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.cohort-loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Error States */
.cohort-error {
    padding: 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
    text-align: center;
    margin: 20px 0;
}

.cohort-error h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.cohort-error p {
    margin: 0;
    font-size: 14px;
}

/* Success States */
.cohort-success {
    padding: 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    color: #155724;
    text-align: center;
    margin: 20px 0;
}

.cohort-success h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.cohort-success p {
    margin: 0;
    font-size: 14px;
}

/* Accessibility */
.cohort-analyzer-container:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.upload-button:focus,
.download-pdf-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .upload-area {
        border-color: #000;
        background: #fff;
    }
    
    .upload-button {
        background: #000;
        color: #fff;
        border: 2px solid #000;
    }
    
    .upload-button:hover {
        background: #fff;
        color: #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .upload-area,
    .upload-button,
    .progress-fill,
    .heatmap-cell {
        transition: none;
    }
    
    .cohort-loading::before {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .cohort-analyzer-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .upload-area,
    .upload-button,
    .download-pdf-button {
        display: none;
    }
    
    .chart-canvas {
        max-height: none;
    }
}

