/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --success-color: #28a745;
    --success-light: #5cb85c;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --text-primary: #333;
    --text-secondary: #666;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --bg-card: #fafafa;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content h1 {
    font-size: 32px;
    margin-bottom: 5px;
}

.header-content .subtitle {
    opacity: 0.9;
    font-size: 16px;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.last-updated {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.last-updated .label {
    font-size: 12px;
    opacity: 0.8;
}

.last-updated .value {
    font-size: 14px;
    font-weight: bold;
}

.refresh-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.refresh-btn:active .refresh-icon {
    animation: spin 0.5s ease;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Report Info */
.report-info {
    background-color: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 5px solid var(--primary-color);
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    color: var(--text-primary);
}

.info-item strong {
    color: var(--primary-color);
    margin-right: 8px;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--bg-white);
    border-radius: 8px;
    margin-bottom: 30px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--bg-white);
    border-radius: 8px;
    margin-bottom: 30px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.error-state h3 {
    color: var(--danger-color);
    margin-bottom: 10px;
}

.retry-btn {
    margin-top: 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Team Summary */
.team-summary {
    background-color: var(--bg-white);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.team-summary h2 {
    margin-top: 0;
    color: var(--text-primary);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.team-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.team-stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.team-stat-card .value {
    font-size: 36px;
    font-weight: bold;
    margin: 10px 0;
}

.team-stat-card .label {
    font-size: 14px;
    opacity: 0.9;
    display: block;
    margin-bottom: 5px;
}

.team-stat-card .performance {
    font-size: 16px;
    margin-top: 10px;
    font-weight: 600;
    opacity: 0.95;
}

.team-stat-card .benchmark-info {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 5px;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin-top: 20px;
    padding: 20px;
    background-color: var(--bg-card);
    border-radius: 8px;
}

/* Performance Section */
.performance-section {
    background-color: var(--bg-white);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.performance-section h2 {
    margin-top: 0;
    color: var(--text-primary);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* User Cards */
.user-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.user-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.user-card h3 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 20px;
}

.user-card .user-email {
    color: var(--text-secondary);
    font-size: 14px;
}

.overall-score {
    text-align: right;
}

.overall-score .score-label {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
}

.overall-score .score-value {
    font-size: 28px;
    font-weight: bold;
}

/* Benchmark Table */
.benchmark-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
}

.benchmark-table thead {
    background-color: var(--primary-color);
    color: white;
}

.benchmark-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.benchmark-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.benchmark-table tr:last-child td {
    border-bottom: none;
}

.benchmark-table tbody tr:hover {
    background-color: #fafafa;
}

/* Performance Indicators */
.performance-indicator {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

.status-excellent {
    background-color: #d4edda;
    color: #155724;
}

.status-good {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-fair {
    background-color: #fff3cd;
    color: #856404;
}

.status-needs_improvement {
    background-color: #f8d7da;
    color: #721c24;
}

/* Metric Values */
.metric-value {
    font-weight: bold;
    font-size: 16px;
}

.value-excellent { color: var(--success-color); }
.value-good { color: var(--success-light); }
.value-fair { color: var(--warning-color); }
.value-needs_improvement { color: var(--danger-color); }

.variance {
    font-size: 13px;
    margin-left: 8px;
}

.variance-positive { color: var(--success-color); }
.variance-negative { color: var(--danger-color); }

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Trends Section */
.trends-section {
    background-color: var(--bg-white);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.trends-section h2 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Data Quality Section */
.data-quality-section {
    background-color: var(--bg-white);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.data-quality-section h2 {
    margin-top: 0;
    color: var(--text-primary);
    border-bottom: 3px solid var(--danger-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.data-quality-section .section-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 25px;
    font-style: italic;
}

.quality-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.quality-category {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    border: 2px solid var(--border-color);
}

.quality-category h3 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 18px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.quality-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quality-metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: var(--bg-white);
    border-radius: 6px;
    border-left: 4px solid var(--warning-color);
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.quality-metric-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(5px);
}

.quality-metric-item.critical {
    border-left-color: var(--danger-color);
}

.quality-metric-item.good {
    border-left-color: var(--success-color);
}

.quality-metric-label {
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
}

.quality-metric-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
    margin-right: 10px;
}

.quality-metric-change {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.quality-metric-change.improving {
    background-color: #d1fae5;
    color: #065f46;
}

.quality-metric-change.declining {
    background-color: #fee2e2;
    color: #991b1b;
}

.quality-metric-change.stable {
    background-color: #e0e7ff;
    color: #3730a3;
}

/* Footer */
.footer {
    margin-top: 40px;
    padding: 20px;
    background-color: var(--bg-white);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.benchmark-notes {
    text-align: left;
    padding: 15px;
    background-color: #fafafa;
    border-radius: 5px;
    margin-bottom: 20px;
}

.benchmark-notes h4 {
    margin: 15px 0 10px 0;
    color: var(--primary-color);
    font-size: 16px;
}

.benchmark-notes h4:first-child {
    margin-top: 0;
}

.benchmark-notes p {
    margin: 8px 0;
    line-height: 1.6;
}

.benchmark-notes ul {
    margin: 10px 0;
    padding-left: 20px;
}

.benchmark-notes li {
    margin: 5px 0;
}

.copyright {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }

    .header-meta {
        flex-direction: column;
        width: 100%;
    }

    .last-updated {
        align-items: center;
    }

    .refresh-btn {
        width: 100%;
        justify-content: center;
    }

    .team-stats {
        grid-template-columns: 1fr;
    }

    .report-info {
        flex-direction: column;
        gap: 10px;
    }

    .benchmark-table {
        font-size: 12px;
    }

    .benchmark-table th,
    .benchmark-table td {
        padding: 8px;
    }

    .user-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .overall-score {
        margin-top: 10px;
        text-align: left;
    }

    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header-content h1 {
        font-size: 24px;
    }

    .team-stat-card .value {
        font-size: 28px;
    }
}

/* Main Container for Multi-Tab Layout */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main Header */
.main-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: var(--shadow-md);
}

.main-header .header-content h1 {
    font-size: 28px;
    margin-bottom: 3px;
}

.main-header .subtitle {
    opacity: 0.9;
    font-size: 14px;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background-color: var(--bg-white);
    border-bottom: 2px solid var(--border-color);
    padding: 0;
    gap: 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    background-color: rgba(102, 126, 234, 0.05);
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.1);
}

.tab-icon {
    font-size: 20px;
}

.tab-label {
    font-size: 14px;
}

/* Tab Content Container */
.tab-content-container {
    flex: 1;
    position: relative;
    background-color: var(--bg-light);
    overflow: hidden;
    min-height: calc(100vh - 180px);
}

.tab-content {
    display: none !important;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.tab-content.active {
    display: block !important;
}

.tab-iframe {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 180px);
    border: none;
    display: block;
}

/* Main Footer */
.main-footer {
    background-color: var(--bg-white);
    padding: 15px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* Coming Soon Section */
.coming-soon-section {
    background-color: var(--bg-white);
    padding: 60px 40px;
    border-radius: 8px;
    margin: 30px 0;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.coming-soon-content {
    max-width: 600px;
    margin: 0 auto;
}

.coming-soon-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.coming-soon-section h2 {
    color: var(--text-primary);
    font-size: 32px;
    margin-bottom: 15px;
}

.coming-soon-section > p {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 40px;
}

.planned-features {
    text-align: left;
    background-color: var(--bg-card);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary-color);
}

.planned-features h3 {
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
}

.planned-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.planned-features li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
    color: var(--text-secondary);
}

.planned-features li:last-child {
    border-bottom: none;
}

.contact-info {
    padding: 20px;
    background-color: rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    margin-top: 30px;
}

.contact-info p {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
}

/* Responsive for Tabs */
@media (max-width: 768px) {
    .tab-btn {
        flex-direction: column;
        padding: 12px 10px;
        gap: 5px;
    }

    .tab-icon {
        font-size: 24px;
    }

    .tab-label {
        font-size: 11px;
    }

    .main-header {
        flex-direction: column;
        text-align: center;
        padding: 15px 20px;
    }

    .tab-content {
        height: calc(100vh - 220px);
    }

    .coming-soon-icon {
        font-size: 60px;
    }

    .coming-soon-section h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .tab-navigation {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 33%;
        min-width: 80px;
    }
}

/* Sub-Tab Container */
.sub-tab-container {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sub-Tab Navigation */
.sub-tab-navigation {
    display: flex;
    background-color: var(--bg-card);
    border-bottom: 2px solid var(--border-color);
    padding: 0;
    gap: 0;
    box-shadow: var(--shadow-sm);
}

.sub-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.sub-tab-btn:hover {
    background-color: rgba(102, 126, 234, 0.05);
    color: var(--primary-color);
}

.sub-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.08);
}

.sub-tab-icon {
    font-size: 18px;
}

.sub-tab-label {
    font-size: 13px;
}

/* Sub-Tab Content */
.sub-tab-content-container {
    flex: 1;
    position: relative;
    background-color: var(--bg-light);
    min-height: 0;
    overflow: auto;
}

.sub-tab-content {
    display: none !important;
    width: 100%;
    height: 100%;
    min-height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.sub-tab-content.active {
    display: block !important;
}

.sub-tab-iframe {
    width: 100%;
    height: 100%;
    min-height: 800px;
    border: none;
    display: block;
}

/* Sub-Sub-Tab Navigation (3rd level) */
.sub-sub-tab-navigation {
    display: flex;
    background-color: #e8e8e8;
    border-bottom: 2px solid var(--border-color);
    padding: 0;
    gap: 0;
    box-shadow: var(--shadow-sm);
}

.sub-sub-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.sub-sub-tab-btn:hover {
    background-color: rgba(102, 126, 234, 0.05);
    color: var(--primary-color);
}

.sub-sub-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.06);
}

.sub-sub-tab-icon {
    font-size: 16px;
}

.sub-sub-tab-label {
    font-size: 12px;
}

/* Sub-Sub-Tab Content */
.sub-sub-tab-content-container {
    flex: 1;
    position: relative;
    background-color: var(--bg-light);
}

.sub-sub-tab-content {
    display: none !important;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.sub-sub-tab-content.active {
    display: block !important;
}

.sub-sub-tab-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Responsive Sub-Tabs */
@media (max-width: 768px) {
    .sub-tab-btn {
        flex-direction: column;
        padding: 10px 8px;
        gap: 4px;
    }

    .sub-tab-icon {
        font-size: 20px;
    }

    .sub-tab-label {
        font-size: 11px;
    }

    .sub-sub-tab-btn {
        flex-direction: column;
        padding: 8px 6px;
    }
}

