/* ================================================
   RESPONSIVE TABLE STYLES
   ================================================ */

.students-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.students-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.students-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.students-table tr:hover {
    background: #f8f9ff;
}

/* Responsive Table */
@media (max-width: 1024px) {

    .students-table th,
    .students-table td {
        padding: 12px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .students-table {
        font-size: 12px;
    }

    .students-table th,
    .students-table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .students-table {
        font-size: 11px;
        overflow-x: auto;
        display: block;
    }

    .students-table thead {
        display: none;
    }

    .students-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ccc;
        border-radius: 8px;
        overflow: hidden;
    }

    .students-table td {
        display: flex;
        justify-content: space-between;
        padding: 10px;
        border-bottom: none;
        text-align: right;
    }

    .students-table td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        flex: 1;
    }
}

/* ================================================
   PROGRESS BAR RESPONSIVE
   ================================================ */

.progress-bar-container {
    background: #e0e0e0;
    border-radius: 20px;
    overflow: hidden;
    height: 25px;
    min-width: 150px;
}

.progress-bar {
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75em;
}

@media (max-width: 768px) {
    .progress-bar-container {
        min-width: 120px;
        height: 20px;
    }

    .progress-bar {
        font-size: 0.65em;
    }
}

@media (max-width: 480px) {
    .progress-bar-container {
        min-width: 100px;
        height: 18px;
    }

    .progress-bar {
        font-size: 0.6em;
    }
}

/* ================================================
   STAT CARD RESPONSIVE
   ================================================ */

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all .2s;
}

@media (max-width: 768px) {
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 16px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }

    .stat-info h3 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 12px;
    }

    .stat-info h3 {
        font-size: 16px;
    }

    .stat-info p {
        font-size: 11px;
    }
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-b);
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    transition: all .2s;
    text-decoration: none;
    font-size: 14px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

@media (max-width: 768px) {
    .btn-primary {
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .btn-primary {
        padding: 9px 16px;
        font-size: 12px;
        width: 100%;
        justify-content: center;
    }
}

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

.badge-score {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-score.good {
    background: #51cf66;
}

.badge-score.excellent {
    background: #4dabf7;
}

@media (max-width: 768px) {
    .badge-score {
        padding: 4px 10px;
        font-size: 0.75em;
    }
}

@media (max-width: 480px) {
    .badge-score {
        display: block;
        margin: 5px 0;
    }
}

/* ================================================
   SECTION TITLE RESPONSIVE
   ================================================ */

.section-title {
    font-size: 1.8em;
    font-weight: bold;
    margin: 30px 0 20px 0;
    color: #333;
    border-left: 5px solid #667eea;
    padding-left: 15px;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 1.4em;
        margin: 20px 0 15px 0;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.2em;
        padding-left: 10px;
        margin: 15px 0 10px 0;
    }
}

/* ================================================
   CLASS STATS GRID RESPONSIVE
   ================================================ */

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

@media (max-width: 1024px) {
    .class-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .class-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .class-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.stat-card.alt1,
.stat-card.alt2,
.stat-card.alt3 {
    padding: 20px;
    text-align: center;
    color: white;
}

@media (max-width: 768px) {

    .stat-card.alt1,
    .stat-card.alt2,
    .stat-card.alt3 {
        padding: 16px;
    }

    .stat-value {
        font-size: 2em;
    }

    .stat-label {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {

    .stat-card.alt1,
    .stat-card.alt2,
    .stat-card.alt3 {
        padding: 12px;
    }

    .stat-value {
        font-size: 1.8em;
    }

    .stat-label {
        font-size: 0.75em;
    }
}

/* ================================================
   ANALYTICS CONTAINER RESPONSIVE
   ================================================ */

.analytics-container {
    padding: 20px;
}

@media (max-width: 768px) {
    .analytics-container {
        padding: 16px;
    }
}

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

/* ================================================
   GENERAL RESPONSIVENESS
   ================================================ */

@media (max-width: 480px) {
    .topbar-title {
        width: 100%;
    }

    h1,
    h2,
    h3 {
        font-size: 1.2em !important;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-secondary {
        width: 100%;
    }
}

/* ================================================
   ACCESSIBILITY & ANIMATIONS
   ================================================ */

@prefers-reduced-motion: reduce {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================================
   PRINT STYLES
   ================================================ */

@media print {

    .sidebar,
    .topbar,
    .btn-primary,
    .action-bar {
        display: none;
    }

    .main {
        margin-left: 0;
        padding: 0;
        width: 100%;
    }

    .students-table {
        box-shadow: none;
        border: 1px solid #999;
    }
}