/**
 * Styles for the Principal Dashboard "Students" Tab (Corrected)
 */

/* --- Filter Bar Styles --- */
.iw-students-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.iw-filter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.iw-students-filter select,
.iw-filter-form button {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 16px;
    background-color: #fff;
}

.iw-filter-form button {
    background-color: var(--color-primary);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    border-color: var(--color-primary);
}

.iw-student-count {
    font-weight: 600;
    color: var(--color-text-light);
}

/* --- Main Data Table Styles --- */
.iw-students-table-wrapper {
    overflow-x: auto;
}

.iw-data-table {
    width: 100%;
    border-collapse: collapse;
}

.iw-data-table th,
.iw-data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.iw-data-table th {
    background-color: #f8f9fa;
    font-weight: 700;
    color: var(--color-primary-dark);
    font-size: 14px;
    text-transform: uppercase;
}

.iw-data-table tbody tr:hover {
    background-color: #fcfcfc;
}

.iw-student-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.iw-student-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.iw-student-details {
    display: flex;
    flex-direction: column;
}

.iw-student-name {
    font-weight: 700;
    color: var(--color-primary-dark);
}

.iw-student-email {
    font-size: 13px;
    color: var(--color-text-light);
}

.iw-action-button.iw-view-progress-btn {
    background-color: var(--color-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 600;
    transition: var(--transition);
}
.iw-action-button.iw-view-progress-btn:hover {
    background-color: var(--color-primary-dark);
}
.iw-action-button.iw-view-progress-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.iw-no-data-content {
    text-align: center;
    padding: 40px;
    color: var(--color-text-light);
}

/* --- Modal Styles --- */
.iw-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7); z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; backdrop-filter: blur(4px);
}
.iw-student-progress-modal {
    max-width: 700px; width: 100%; background-color: #fff;
    border-radius: var(--border-radius); box-shadow: var(--shadow-lg);
    max-height: 90vh; display: flex; flex-direction: column; position: relative;
}
.iw-modal-close-btn {
    position: absolute; top: 10px; right: 10px; background: none; border: none;
    font-size: 28px; cursor: pointer; color: var(--color-text-light);
    width: 40px; height: 40px; line-height: 40px; text-align: center; z-index: 10;
}
/* --- THIS IS THE FIX --- */
.iw-modal-header.iw-student-summary {
    text-align: center;
    padding: 20px; /* Adjusted padding */
    border-bottom: 1px solid #eee;
}
.iw-student-summary .iw-student-name {
    font-size: 22px;
}
/* Removed styles for .iw-student-avatar-large */
/* --- END FIX --- */
.iw-modal-body { padding: 20px; overflow-y: auto; }
.iw-student-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 30px; }
@media (min-width: 768px) { .iw-student-stats-grid { grid-template-columns: repeat(4, 1fr); } }
.iw-stat-box { background-color: #f8f9fa; padding: 15px; text-align: center; border-radius: 8px; }
.iw-stat-box span { display: block; font-size: 24px; font-weight: 700; color: var(--color-primary-dark); }
.iw-stat-box label { font-size: 13px; color: var(--color-text-light); }
.iw-section-subtitle { font-size: 18px; font-weight: 700; margin: 0 0 15px; color: var(--color-primary); }
.iw-progress-course-item { margin-bottom: 15px; }
.iw-course-progress-info { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 600; }
.iw-progress-bar-wrapper { background-color: #e9ecef; border-radius: 20px; height: 10px; overflow: hidden; }
.iw-progress-bar { height: 100%; background-color: var(--color-quaternary); border-radius: 20px; transition: width 0.5s ease; }


/* Responsive Table */
@media (max-width: 768px) {
    .iw-data-table thead { display: none; }
    .iw-data-table, .iw-data-table tbody, .iw-data-table tr, .iw-data-table td { display: block; width: 100%; }
    .iw-data-table tr { margin-bottom: 15px; border: 1px solid #eee; border-radius: 8px; overflow: hidden; }
    .iw-data-table td { display: flex; justify-content: space-between; align-items: center; text-align: right; padding: 10px 15px; border-bottom: 1px solid #f5f5f5; }
    .iw-data-table td:before { content: attr(data-label); font-weight: 700; color: var(--color-primary-dark); text-transform: uppercase; font-size: 12px; margin-right: auto; }
    .iw-data-table tr td:nth-of-type(1):before { content: "Student"; }
    .iw-data-table tr td:nth-of-type(2):before { content: "Courses"; }
    .iw-data-table tr td:nth-of-type(3):before { content: "Registered"; }
    .iw-data-table tr td:nth-of-type(4):before { content: "Action"; }
    .iw-data-table td:last-child { border-bottom: 0; }
}

