/* ── student-roster.css ── */

.hwc-roster-wrap {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.hwc-roster-header { margin-bottom: 24px; }
.hwc-roster-header h2 { font-size: 26px; margin: 0 0 6px; color: #2c3e50; }
.hwc-roster-header p  { color: #666; margin: 0; }

/* ── Tabs ── */
.hwc-roster-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #667eea;
    margin-bottom: 0;
}
.hwc-rtab {
    padding: 10px 22px;
    border: none;
    background: #f0f0f1;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    transition: background 0.15s;
}
.hwc-rtab:hover  { background: #dde3f0; }
.hwc-rtab.active { background: #667eea; color: #fff; }

/* ── Tab Content ── */
.hwc-rtab-content        { display: none; }
.hwc-rtab-content.active { display: block; }

/* ── Card ── */
.hwc-roster-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0 8px 8px 8px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.hwc-roster-card h3 { margin-top: 0; font-size: 18px; color: #2c3e50; }

/* ── CSV Format ── */
.hwc-csv-format {
    background: #f6f8ff;
    border-left: 4px solid #667eea;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    margin: 16px 0;
}
.hwc-csv-format pre {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.7;
    color: #333;
}

/* ── CSV Preview ── */
.hwc-preview-box {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    margin: 12px 0;
    overflow-x: auto;
}
.hwc-preview-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hwc-preview-table th { background: #667eea; color: #fff; padding: 6px 10px; text-align: left; }
.hwc-preview-table td { padding: 5px 10px; border-bottom: 1px solid #eee; }
.hwc-preview-note   { font-size: 12px; color: #888; margin-top: 6px; }

/* ── Form ── */
.hwc-roster-form   { margin-top: 20px; }
.hwc-form-row      { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.hwc-form-group    { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 5px; }
.hwc-form-group label { font-weight: 600; font-size: 14px; color: #333; }
.hwc-input {
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.hwc-input:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.15); }

/* ── Buttons ── */
.hwc-btn {
    display: inline-block;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity 0.2s;
}
.hwc-btn:hover         { opacity: 0.88; }
.hwc-btn-primary       { background: #667eea; color: #fff; }
.hwc-btn-outline       { background: transparent; border: 2px solid #667eea; color: #667eea; }
.hwc-btn-danger        { background: #e74c3c; color: #fff; }
.hwc-btn-sm            { padding: 5px 12px; font-size: 13px; }

/* ── Messages ── */
.hwc-msg {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin: 10px 0;
}
.hwc-msg-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.hwc-msg-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Filter Bar ── */
.hwc-filter-bar  { margin-bottom: 16px; }
.hwc-filter-form {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.hwc-filter-form label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 14px;
}
.hwc-filter-form select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

/* ── Student Table ── */
.hwc-student-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.hwc-student-table th {
    background: #f8f9fa;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    color: #444;
}
.hwc-student-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #f0f0f0;
}
.hwc-student-table tr:hover td { background: #f9f9ff; }
.hwc-total-count { color: #666; font-size: 13px; margin-top: 8px; }

/* ── Empty State ── */
.hwc-empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #888;
}
.hwc-empty-state span { font-size: 40px; display: block; margin-bottom: 12px; }

/* ── Notice (not logged in) ── */
.hwc-roster-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 14px 18px;
    border-radius: 6px;
    color: #856404;
}

/* ── Error text ── */
.hwc-error { color: #e74c3c; font-size: 13px; }

/* ── Homework Checker — new dropdowns ── */
.hwc-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23667eea' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.hwc-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}
.hwc-select:disabled { background-color: #f5f5f5; color: #aaa; cursor: not-allowed; }

/* student-name readonly style */
#student-name[readonly] {
    background: #f8f9ff;
    color: #2c3e50;
    font-weight: 600;
    cursor: default;
}

/* ── Loading state ── */
.hwc-loading {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 15px;
}


/* ── Bulk bar ── */
#hwc-bulk-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 8px 16px;
    margin-bottom: 10px;
    font-size: 14px;
}

/* ── List actions (Download Excel) ── */
.hwc-list-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

/* ── Checkbox column ── */
.hwc-student-table th:first-child,
.hwc-student-table td:first-child {
    width: 36px;
    text-align: center;
}

/* ── Action buttons in table ── */
.hwc-action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.hwc-btn-warning {
    background: #f39c12;
    color: #fff;
    border: none;
    cursor: pointer;
}
.hwc-btn-warning:hover { opacity: 0.88; }

/* ── Row highlight after edit ── */
.hwc-row-updated {
    background: #d4edda !important;
    transition: background 1s ease;
}

/* ── Modal overlay ── */
.hwc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Modal box ── */
.hwc-modal-box {
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: hwcModalIn 0.18s ease;
}
@keyframes hwcModalIn {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.hwc-modal-header {
    background: #667eea;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.hwc-modal-header h3 { margin: 0; font-size: 17px; }

.hwc-modal-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.hwc-modal-close-btn:hover { opacity: 0.7; }

.hwc-modal-body   { padding: 20px; }
.hwc-modal-footer {
    padding: 12px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #eee;
}
