/* ============================================
   KPI DASHBOARD - Styles
   ============================================ */

.kpi-dashboard-wrapper {
    font-family: 'Qatar-medium', sans-serif;
    direction: rtl;
    margin-bottom: 25px;
}

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

.kpi-dashboard-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.kpi-dashboard-title-icon {
    font-size: 28px;
}

.kpi-dashboard-select {
    padding: 10px 18px;
    border: 2px solid rgba(130, 12, 34, 0.15);
    border-radius: 20px;
    font-size: 14px;
    font-family: 'Qatar-medium', sans-serif;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.kpi-dashboard-select:hover {
    border-color: #820c22;
}

.kpi-dashboard-select:focus {
    outline: none;
    border-color: #820c22;
    box-shadow: 0 0 0 3px rgba(130, 12, 34, 0.1);
}

/* Cards Grid */
.kpi-dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.kpi-stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.kpi-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 16px 16px 0;
}

.kpi-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Card Colors */
.kpi-stat-sessions::before { background: #3498db; }
.kpi-stat-teachers::before { background: #9b59b6; }
.kpi-stat-students::before { background: #27ae60; }
.kpi-stat-rating::before { background: #f39c12; }

.kpi-stat-card-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.kpi-stat-sessions .kpi-stat-card-icon { background: rgba(52, 152, 219, 0.12); }
.kpi-stat-teachers .kpi-stat-card-icon { background: rgba(155, 89, 182, 0.12); }
.kpi-stat-students .kpi-stat-card-icon { background: rgba(39, 174, 96, 0.12); }
.kpi-stat-rating .kpi-stat-card-icon { background: rgba(243, 156, 18, 0.12); }

.kpi-stat-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.kpi-stat-card-label {
    font-size: 13px;
    color: #888;
    font-weight: 500;
    margin-bottom: 6px;
}

.kpi-stat-card-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
}

.kpi-stat-sessions .kpi-stat-card-value { color: #3498db; }
.kpi-stat-teachers .kpi-stat-card-value { color: #9b59b6; }
.kpi-stat-students .kpi-stat-card-value { color: #27ae60; }
.kpi-stat-rating .kpi-stat-card-value { color: #f39c12; }

.kpi-stat-card-desc {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

/* Progress Bar for Rating */
.kpi-stat-progress {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.kpi-stat-progress-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    transition: width 0.6s ease-out;
}

/* Rating Details */
.kpi-stat-rating-details {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.kpi-rating-detail {
    font-size: 12px;
    color: #666;
}

.kpi-rating-detail strong {
    color: #820c22;
}

/* Loading */
.kpi-dashboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    color: #666;
}

.kpi-dashboard-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(130, 12, 34, 0.15);
    border-top-color: #820c22;
    border-radius: 50%;
    animation: kpi-dashboard-spin 0.8s linear infinite;
    margin-bottom: 15px;
}

@keyframes kpi-dashboard-spin {
    to { transform: rotate(360deg); }
}

.kpi-dashboard-loading p {
    font-size: 15px;
    margin: 0;
}

/* Error */
.kpi-dashboard-error {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.kpi-dashboard-error-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.kpi-dashboard-error p {
    font-size: 15px;
    margin: 0;
}

/* Hidden */
.kpi-dashboard-wrapper .hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 992px) {
    .kpi-dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .kpi-dashboard-cards {
        grid-template-columns: 1fr;
    }

    .kpi-dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .kpi-dashboard-select {
        width: 100%;
    }

    .kpi-dashboard-title {
        font-size: 18px;
        justify-content: center;
    }

    .kpi-stat-card {
        padding: 18px 16px;
    }

    .kpi-stat-card-value {
        font-size: 26px;
    }

    .kpi-stat-card-icon {
        width: 42px;
        height: 42px;
        font-size: 26px;
    }

    .kpi-stat-rating-details {
        flex-direction: column;
        gap: 4px;
    }
}