/* General Body Styles */
body { font-family: sans-serif; margin: 0; padding: 0; background-color: #fff; color: #333; }

/* Login / auth pages */
body.login-page {
    --login-ink: #15120c;
    --login-muted: #625746;
    --login-gold: #a5761c;
    --login-deep-gold: #61450e;
    --login-cream: #fff8eb;
    --login-line: rgba(165, 118, 28, 0.24);
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(20px, 4vw, 48px);
    background:
        radial-gradient(circle at 18% 18%, rgba(209, 176, 99, 0.2), transparent 26%),
        radial-gradient(circle at 86% 82%, rgba(209, 176, 99, 0.16), transparent 24%),
        linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(255, 255, 255, 0.82) 54%, rgba(255, 248, 235, 0.92)),
        #fffaf0;
    color: var(--login-ink);
    font-family: Inter, "Helvetica Neue", Arial, sans-serif;
    box-sizing: border-box;
}

body.login-page *,
body.login-page *::before,
body.login-page *::after {
    box-sizing: border-box;
}

.login-page .login-container {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    min-width: 0;
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 0.82fr);
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--login-line);
    border-radius: 18px;
    background: rgba(255, 253, 247, 0.94);
    box-shadow: 0 22px 48px rgba(97, 69, 14, 0.16);
}

.login-page .login-container--reset {
    width: min(900px, 100%);
}

.login-brand-panel,
.login-form-panel {
    position: relative;
    min-width: 0;
    display: grid;
    align-content: center;
    padding: clamp(28px, 5vw, 58px);
}

.login-brand-panel {
    justify-items: center;
    text-align: center;
    border-right: 1px solid rgba(165, 118, 28, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 248, 235, 0.58));
}

.login-logo-link {
    display: inline-flex;
}

.login-logo {
    width: clamp(160px, 24vw, 250px);
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 14px 24px rgba(97, 69, 14, 0.18));
}

.login-brand-name {
    margin-top: 10px;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(34px, 4vw, 52px);
    line-height: 1;
}

.login-brand-name strong {
    font-weight: 400;
}

.login-brand-name span {
    color: var(--login-gold);
    font-style: italic;
}

.login-ornament {
    display: grid;
    grid-template-columns: minmax(62px, 1fr) 42px minmax(62px, 1fr);
    align-items: center;
    gap: 14px;
    width: min(300px, 100%);
    margin: 26px 0 18px;
}

.login-ornament span {
    height: 1px;
    background: rgba(165, 118, 28, 0.3);
}

.login-ornament img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.login-brand-panel p,
.login-form-panel p {
    margin: 0;
    color: var(--login-muted);
    font-size: 15px;
    font-weight: 300;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.login-form-panel {
    background: rgba(255, 255, 255, 0.48);
}

.login-eyebrow {
    display: block;
    margin-bottom: 10px;
    color: var(--login-gold);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-page .login-container h1,
.login-page .login-container h2 {
    margin: 0;
    color: var(--login-ink);
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(28px, 3.2vw, 38px);
    font-weight: 400;
    line-height: 1.08;
    text-align: left;
}

.login-page .login-intro {
    margin-top: 12px;
}

.login-page form {
    display: grid;
    gap: 16px;
    margin-top: 28px;
}

.login-page .form-group {
    display: grid;
    gap: 8px;
    margin: 0;
}

.login-page label {
    display: grid;
    gap: 8px;
    color: #2a241b;
    font-size: 14px;
    font-weight: 600;
}

.login-page .form-group label {
    margin: 0;
}

.login-page input {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid rgba(97, 69, 14, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--login-ink);
    font: inherit;
    font-size: 15px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-page input:focus {
    border-color: var(--login-gold);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(165, 118, 28, 0.14);
}

.login-page button,
.login-page .reset-link {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 20px;
    border: 1px solid rgba(115, 78, 10, 0.16);
    border-radius: 999px;
    background: linear-gradient(90deg, #b98520 0%, #d1b063 48%, #ead9aa 100%);
    color: #17130c;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 12px 22px rgba(165, 118, 28, 0.14);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.login-page button:hover,
.login-page button:focus-visible,
.login-page .reset-link:hover,
.login-page .reset-link:focus-visible {
    transform: translateY(-1px);
    filter: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 16px 28px rgba(165, 118, 28, 0.2);
}

.login-page .login-alt-link {
    margin: 22px 0 0;
    text-align: center;
    font-size: 14px;
}

.login-page .login-alt-link a {
    color: var(--login-deep-gold);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(97, 69, 14, 0.28);
}

.login-page .login-alt-link a:hover,
.login-page .login-alt-link a:focus-visible {
    border-color: currentColor;
}

.login-page .login-alert,
.login-page .reset-alert {
    display: none;
    margin-top: 2px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff1f3;
    color: #9b1c31;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.login-page .reset-alert {
    display: block;
}

.login-page .reset-alert.success {
    background: rgba(255, 248, 235, 0.92);
    color: var(--login-deep-gold);
    border: 1px solid var(--login-line);
}

.login-page .login-alert.success {
    background: rgba(255, 248, 235, 0.92);
    color: var(--login-deep-gold);
    border: 1px solid var(--login-line);
}

.login-page .reset-alert.error {
    background: #fff1f3;
    color: #9b1c31;
}

.login-page .reset-card-body {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.login-page .reset-card-body form {
    margin-top: 4px;
}

/* Legacy form spacing used throughout the older admin screens. */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; }
.form-group input { width: 93%; padding: 8px; border: 1px solid #ccc; border-radius: 3px; }

@media (max-width: 780px) {
    body.login-page {
        align-items: start;
        padding: 18px;
    }

    .login-page .login-container {
        grid-template-columns: 1fr;
        width: calc(100vw - 36px);
        max-width: 100%;
        min-height: 0;
        border-radius: 14px;
    }

    .login-brand-panel {
        min-height: auto;
        padding-bottom: 26px;
        border-right: 0;
        border-bottom: 1px solid rgba(165, 118, 28, 0.18);
    }

    .login-form-panel {
        padding-top: 30px;
    }

    .login-logo {
        width: clamp(132px, 44vw, 190px);
    }

    .login-page .login-container h1,
    .login-page .login-container h2 {
        text-align: center;
    }

    .login-page .login-intro,
    .login-eyebrow {
        text-align: center;
    }
}

/* --- Default Button Style (NO width: 100%) --- */
button, .btn-primary, .btn-secondary, .btn-danger, .btn-sm {
    padding: 0.25rem 0.5rem; /* Smaller, consistent padding */
    color: white;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem; /* Smaller, consistent font size */
    line-height: 1.5;
    box-sizing: border-box;
    vertical-align: middle;
    text-align: center;
    display: inline-block;
    white-space: nowrap;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

/* Specific Button Styles */
.btn-primary, 
button[id*="edit"],  /* Target edit buttons */
.edit-button,
[class*="edit-note"],  /* Target note edit buttons */
#course-list-table button[class*="edit"],
.note-actions button[class*="edit"], /* Explicitly target note edit buttons */
.back-button { /* Add back button to purple group */
    background-color: #41276A; 
    border-color: #41276A; 
    color: white; 
}
.btn-primary:hover,
button[id*="edit"]:hover,
.edit-button:hover,
[class*="edit-note"]:hover,
#course-list-table button[class*="edit"]:hover,
.note-actions button[class*="edit"]:hover,
.back-button:hover { 
    background-color: #311d4f; 
    border-color: #311d4f; 
}

.btn-secondary { 
    background-color: #6c757d; 
    border-color: #6c757d; 
    color: white; 
}
.btn-secondary:hover { 
    background-color: #5a6268; 
    border-color: #5a6268; 
}

.btn-danger,
button[id*="delete"],  /* Target delete buttons */
.delete-button,
[class*="delete-note"],  /* Target note delete buttons */
#course-list-table button[class*="delete"] { /* Target course delete buttons */
    background-color: #dc3545; 
    border-color: #dc3545; 
    color: white; 
}
.btn-danger:hover,
button[id*="delete"]:hover,
.delete-button:hover,
[class*="delete-note"]:hover,
#course-list-table button[class*="delete"]:hover { 
    background-color: #c82333; 
    border-color: #bd2130; 
}

/* Override specific buttons to maintain their size */
#student-search-form button,
#course-search-form button,
.add-button,
#edit-student-button {
    padding: 8px 15px;
    font-size: 14px;
    height: 34px;
}

/* Preserve back button style */
.back-button {
    display: inline-flex; 
    align-items: center; 
    background-color: #41276A;
    color: white;
    border: none; 
    padding: 8px 15px; 
    border-radius: 3px; 
    font-size: 14px; 
    cursor: pointer; 
    width: auto; 
}

.back-button:hover { 
    background-color: #311d4f !important;
    color: white;
}

.back-button .arrow { 
    margin-right: 8px; 
    font-weight: bold; 
}

/* Modal footer buttons */
.modal-footer button {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Add note button specific style */
#add-note-button {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Default button hover (Generic - less specific than class hovers) */
button:hover {
     filter: brightness(90%); /* Simple darken effect */
}
.error { color: red; margin-top: 10px; text-align: center; }

/* === Dashboard App Styling === */
.app-container { display: flex; flex-direction: column; min-height: 100vh; }

/* --- Header Area Styling --- */
.header { padding: 0; background-color: transparent; border-bottom: 1px solid #ccc; }
.header-content { max-width: 960px; margin-left: auto; margin-right: auto; padding: 18px 0 13px 0; display: flex; flex-direction: column; align-items: center; }
.logo { height: 64px; width: auto; margin-bottom: 15px; }
.menu-bar { width: 100%; }
.menu-bar ul { list-style: none; padding: 0; margin: 0; display: flex; justify-content: center; flex-wrap: wrap; }
.menu-bar li.menu-item { margin: 0 15px; padding: 5px 10px; cursor: pointer; border-radius: 3px; color: #333; transition: opacity 0.3s ease; font-size: 18px; }
.menu-bar ul:hover > li.menu-item { opacity: 0.5; }
.menu-bar ul > li.menu-item:hover { opacity: 1; }
.menu-bar li.menu-item.active { font-weight: bold; opacity: 1; }

/* --- Welcome Bar Styling --- */
.welcome-bar { padding: 0; border-bottom: 1px solid #ccc; margin-bottom: 20px; background-color: #f4f4f4; }
.welcome-content { max-width: 960px; margin-left: auto; margin-right: auto; padding: 8px 0; text-align: center; }
.welcome-text { font-size: 16px; font-weight: normal; color: #555; }

/* --- Main Content Area Styling --- */
.content-area { flex-grow: 1; max-width: 960px; margin-left: auto; margin-right: auto; padding: 20px; /* Add padding to area */ box-sizing: border-box; width: 100%; }

/* --- Styling for Content Containers (Main Tabs) --- */
.content-container { display: none; /* padding: 20px; Using content-area padding now */ border: 1px dashed #ddd; min-height: 300px; text-align: left; }
.content-container.active { display: block; }
.content-container h2 { color: #333; margin-top: 10px; margin-bottom: 25px; text-align: center; font-size: 1.5rem; }

/* --- Utility Class --- */
.hidden { display: none !important; }


/* === Student Section Specific Styles === */
.student-controls { display: flex; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.student-search-form { display: flex; flex-grow: 1; min-width: 250px; }
#student-search-input { flex-grow: 1; padding: 8px 10px; border: 1px solid #ccc; border-radius: 3px 0 0 3px; font-size: 14px; box-sizing: border-box; margin: 0; height: 34px; /* Explicit height */ }
#student-search-form button {
    padding: 8px 15px;
    background-color: #41276A; /* Purple */
    color: white;
    border: 1px solid #41276A;
    border-left: none;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    width: auto; /* <<< Key Fix */
    box-sizing: border-box;
    margin: 0;
    height: 34px; /* Match input */
}
#student-search-form button:hover { background-color: #311d4f; border-color: #311d4f; }
/* Shared style for Add Buttons */
.add-button {
    padding: 8px 15px;
    background-color: #41276A; /* Purple */
    color: white;
    border: 1px solid #41276A;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    width: auto; /* <<< Key Fix */
    box-sizing: border-box;
    height: 34px; /* Match input */
}
.add-button:hover { background-color: #311d4f; border-color: #311d4f; }

.reset-search-container { text-align: left; margin: -10px 0 15px 0; padding-left: 5px; }
.reset-link { color: #41276A; text-decoration: none; font-size: 14px; cursor: pointer; }
.reset-link:hover { text-decoration: underline; }

.student-list-container { width: 100%; overflow-x: auto; }
#student-list-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
#student-list-table th, #student-list-table td { border: 1px solid #ddd; padding: 10px 12px; text-align: left; font-size: 14px; vertical-align: top; }
#student-list-table th { background-color: #f9f9f9; font-weight: bold; white-space: nowrap; }
#student-list-table tbody tr:nth-child(even) { background-color: #f9f9f9; }
#student-list-table tbody tr:hover { background-color: #f1f1f1; }
#student-list-table .student-name-link { color: #41276A; cursor: pointer; text-decoration: none; }
#student-list-table .student-name-link:hover { text-decoration: underline; }
#student-list-body td[colspan="4"] { text-align: center; padding: 30px; color: #888; font-style: italic; }

/* === Student Details View Styles === */
#student-details-view h2 { text-align: left; color: #333; margin-top: 0; }
.details-header-controls { 
    display: flex; 
    justify-content: flex-start;
    align-items: center; 
    margin-bottom: 15px; 
    gap: 15px;
}
.back-button { 
    display: inline-flex; 
    align-items: center; 
    background-color: #41276A;
    color: white;
    border: none; 
    padding: 8px 15px; 
    border-radius: 3px; 
    font-size: 14px; 
    cursor: pointer; 
    width: auto; 
}
.back-button:hover { 
    background-color: #311d4f !important;
    color: white;
}
.back-button .arrow { 
    margin-right: 8px; 
    font-weight: bold; 
}
#student-tab-details {
    position: relative;
    padding: 15px 0;
}
#edit-student-button {
    padding: 8px 15px;
    background-color: #41276A;
    color: white;
    border: 1px solid #41276A;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    width: auto;
    box-sizing: border-box;
    margin-bottom: 20px;
    display: inline-block;
}
#edit-student-button:hover {
    background-color: #311d4f;
    border-color: #311d4f;
}
#student-details-content { margin-top: 15px; border-top: 1px solid #eee; padding-top: 15px; }

/* Student Detail Tabs */
.student-detail-tabs {
    display: flex !important;
    visibility: visible !important;
    border-bottom: 1px solid #ccc;
    margin: 20px 0 15px 0;
    background-color: #e9ecef;
    padding: 8px;
    border-radius: 4px;
    position: relative;
    z-index: 1;
}

.detail-tab-button {
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    color: #495057;
    font-weight: 500;
    position: relative;
    transition: all 0.2s ease;
    margin-right: 4px;
    border-radius: 4px;
}

.detail-tab-button:hover {
    background-color: #dee2e6;
    color: #41276A;
}

.detail-tab-button.active {
    background-color: white;
    color: #41276A;
    border-bottom: 2px solid #41276A;
}

.student-tab-pane {
    display: none;
    padding: 20px 0;
}

.student-tab-pane.active {
    display: block;
}

/* Student Basic Info */
.student-basic-info { 
    background-color: #f8f9fa; 
    padding: 15px; 
    border-radius: 4px; 
    margin-bottom: 20px; 
    border-left: 3px solid #41276A; 
}
.student-basic-info h3 { margin-top: 0; color: #333; }

/* *** START: Student Detailed Info Grid Layout v2 *** */
.student-detailed-info {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 15px;
    row-gap: 4px;
    align-items: center;
    margin-top: 10px;
}
.student-detailed-info dt {
    grid-column: 1;
    font-weight: bold;
    color: #555;
    text-align: left;
    padding-right: 0;
    margin-bottom: 0;
}
.student-detailed-info dd {
    grid-column: 2;
    margin-left: 0;
    padding-left: 0;
    margin-bottom: 0;
}
.student-detailed-info dt.space-after + dd.space-after {
    margin-bottom: 15px; /* Slightly reduced space-after margin */
}
.student-detailed-info dt.space-after {
    margin-bottom: 0;
}
/* *** END: Student Detailed Info Grid Layout v2 *** */

/* Profile Image Styling */
.profile-header { display: flex; align-items: flex-start; gap: 20px; }
.profile-image-container { flex-shrink: 0; position: relative; width: 120px; }
.profile-image { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; border: 2px solid #e0e0e0; background-color: #f0f0f0; }
.profile-image-controls { margin-top: 8px; text-align: center; }
.img-control-btn { background: none; border: none; font-size: 0.8em; color: #41276A; cursor: pointer; padding: 2px 4px; margin: 0 2px; }
.img-control-btn:hover { text-decoration: underline; }
.basic-info-text { flex-grow: 1; }

/* Status indicators */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.85em; font-weight: normal; text-align: center; }
.status-badge.true { background-color: #d4edda; color: #155724; }
.status-badge.false { background-color: #f8d7da; color: #721c24; }
.status-badge.neutral { background-color: #e2e3e5; color: #383d41; }
.status-badge.consultant { background-color: #e6d9f2; color: #6a359c; }

/* Enrollment Styles */
.enrollment-controls { margin-bottom: 15px; }
.enrollment-list { margin-top: 15px; }

#enrollments-table { 
    width: 100%; 
    border-collapse: collapse; 
    table-layout: fixed;
}

#enrollments-table th, 
#enrollments-table td { 
    padding: 8px 12px; 
    text-align: left; 
    border-bottom: 1px solid #e0e0e0; 
    vertical-align: middle;
}

#enrollments-table th { 
    background-color: #f8f9fa; 
    font-weight: bold; 
}

/* Column widths */
#enrollments-table th:nth-child(1), 
#enrollments-table td:nth-child(1) { width: 40%; } /* Course column */

#enrollments-table th:nth-child(2), 
#enrollments-table td:nth-child(2) { width: 30%; } /* Instructor column */

#enrollments-table th:nth-child(3), 
#enrollments-table td:nth-child(3) { width: 20%; } /* Date column */

#enrollments-table th:nth-child(4), 
#enrollments-table td:nth-child(4) { 
    width: 10%; 
    text-align: right; 
    padding-right: 5px; 
} /* Actions column */

.enrollment-action-btn { 
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    margin: 0;
}

/* === Modal Styles === */
.modal-overlay { display: none; position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100dvh !important; min-width: 100vw !important; min-height: 100dvh !important; background-color: rgba(0, 0, 0, 0.6); z-index: 2147483000 !important; justify-content: center; align-items: center; padding: 20px; box-sizing: border-box; }
.modal-overlay.active { display: flex; }
.modal-content { background-color: #fff; border-radius: 6px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); width: 100%; /* Adjust width */ max-width: 600px; /* Max width */ position: relative; max-height: 90vh; /* Max height */ overflow: hidden; display: flex; flex-direction: column; }
.modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid #dee2e6; display: flex; justify-content: center; align-items: center; }
.modal-header h3 { margin: 0; font-size: 1.25rem; color: #343a40; }
.modal-body { padding: 1.25rem; flex-grow: 1; overflow-y: auto; } /* Add flex-grow */
.modal-body .form-group { margin-bottom: 1rem; }
.modal-body .form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: #495057; }
.modal-body .form-group select,
.modal-body .form-group input:not([type="checkbox"]):not([type="radio"]), /* Exclude check/radio */
.modal-body .form-group textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    box-sizing: border-box;
}
.modal-body .form-group textarea { min-height: 120px; resize: vertical; }
.modal-body .form-group input:focus,
.modal-body .form-group select:focus,
.modal-body .form-group textarea:focus { 
    border-color: #41276A; 
    outline: 0; 
    box-shadow: 0 0 0 0.2rem rgba(65, 39, 106, 0.25); 
}
.modal-body .checkbox-group { display: flex; align-items: center; margin-bottom: 1rem;} /* Align checkbox layout */
.modal-body .checkbox-group input[type="checkbox"] { width: auto; margin-right: 0.5rem; }
.modal-body .checkbox-group .inline-label { margin-bottom: 0; font-weight: normal; color: #495057; }
.modal-footer { padding: 0.75rem 1.25rem; border-top: 1px solid #dee2e6; display: flex; justify-content: flex-end; gap: 0.5rem; background-color: #f8f9fa; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; }
.modal-footer button { /* Inherit from base button styles */ }
.modal-overlay .error { color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; border-radius: 0.25rem; padding: 0.75rem 1.25rem; margin-top: 1rem; font-size: 0.9em; }
.modal-overlay .error.hidden { display: none; }
#current-profile-image-container { margin-bottom: 10px; }
#current-profile-image-container.hidden { display: none; }


/* === Courses Section Specific Styles === */
.course-controls { display: flex; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }
.course-search-form { display: flex; flex-grow: 1; min-width: 250px; }
#course-search-input { flex-grow: 1; padding: 8px 10px; border: 1px solid #ccc; border-radius: 3px 0 0 3px; font-size: 14px; box-sizing: border-box; margin: 0; height: 34px; }
#course-search-form button { background-color: #41276A; border-color: #41276A; border-left: none; border-radius: 0 3px 3px 0; padding: 8px 15px; width: auto; height: 34px; }
#course-search-form button:hover { background-color: #311d4f; border-color: #311d4f; }
.course-filter { padding: 8px 10px; border: 1px solid #ccc; border-radius: 3px; font-size: 14px; height: 34px; box-sizing: border-box; min-width: 150px; background-color: #fff; color: #555; }
.course-filter:disabled { background-color: #e9ecef; cursor: not-allowed; }
/* #add-course-button uses .add-button style */
.course-list-container { width: 100%; overflow-x: auto; }
#course-list-table { width: 100%; border-collapse: collapse; margin-top: 0; }
#course-list-table th, #course-list-table td { border: 1px solid #ddd; padding: 10px 12px; text-align: left; font-size: 14px; vertical-align: top; }
#course-list-table th { background-color: #f9f9f9; font-weight: bold; white-space: nowrap; }
#course-list-table tbody tr:nth-child(even) { background-color: #f9f9f9; }
#course-list-table tbody tr:hover { background-color: #f1f1f1; }
#course-list-body td[colspan="6"] { text-align: center; padding: 30px; color: #888; font-style: italic; }
/* === END Courses Section Styles === */

/* === START: Refined Notes CSS v4 === */ /* <<< Final spacing adjustments */

#student-tab-notes {
    padding: 5px 5px 10px 5px;
}

#notes-controls {
    margin-bottom: 15px;
    padding-right: 5px;
    text-align: right;
}

.notes-list {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: none;
}

#student-tab-notes .notes-list .note-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem;
    padding: 4px 8px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0;
}

.note-author-type {
    font-weight: 500;
    color: #333;
}
.note-author-type .note-type-label {
    color: #666;
    font-weight: normal;
}

.note-date {
    color: #666;
    font-size: 0.9em;
}

.note-content {
    padding: 1px 0 0 0;
    margin: 0;
    line-height: 1.4;
}

.note-follow-up {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #e9ecef;
}

.note-actions {
    margin-top: 4px;
    text-align: right;
}

.note-actions button {
    margin-left: 0.5rem;
}

/* Style modal radios to align better */
.note-type-group label {
    margin-right: 1rem;
    font-weight: normal;
    cursor: pointer;
}
 .note-type-group input[type="radio"] {
    margin-right: 0.3rem;
    vertical-align: middle;
    position: relative;
    top: -1px;
}
#note-modal .modal-body .form-group {
     margin-bottom: 1rem;
}
/* === END: Refined Notes CSS v4 === */

/* Animation for row removal */
.fade-out {
    transition: opacity 0.4s ease-out;
    opacity: 0;
}

/* Form section titles */
.form-section-title {
    margin: 20px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    color: #444;
    font-size: 1.1em;
}
.form-section-title:first-child {
    margin-top: 0;
}

/* Checkbox group */
.checkbox-group {
    display: flex;
    align-items: center;
}
.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
}
.inline-label {
    margin-bottom: 0;
    font-weight: normal;
}

/* Placeholder comments to maintain line count consistency */
/* Placeholder comment */
/* Placeholder comment */
/* Placeholder comment */
/* Placeholder comment */

/* Course list table specific button styles */
#course-list-table button {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    margin: 0 2px;
}

/* Note type visibility control */
.dashboard-note-modal .note-type-group {
    display: none !important;
}

/* Modal form group spacing adjustment when type is hidden */
.dashboard-note-modal .modal-body .form-group:first-of-type {
    margin-top: 0;
}

/* Flatpickr customization */
.flatpickr-input {
    background-color: white !important;
    cursor: pointer;
}

.flatpickr-calendar {
    font-size: 14px;
}

.flatpickr-current-month {
    font-size: 16px !important;
}

.flatpickr-day {
    border-radius: 3px;
}

.flatpickr-day.selected {
    background: #41276A !important;
    border-color: #41276A !important;
}

.flatpickr-day:hover {
    background: rgba(65, 39, 106, 0.1) !important;
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
    background: #f3f0f7;
}

/* Make the datetime input match other form inputs */
input[type="datetime-local"] {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    box-sizing: border-box;
}

input[type="datetime-local"]:focus {
    border-color: #41276A;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(65, 39, 106, 0.25);
}

/* Curriculum Section Styles */
.curriculum-section {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.curriculum-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1rem;
}

.curriculum-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.curriculum-section-number {
    color: #666;
    margin-right: 4px;
}

.curriculum-section-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.curriculum-section-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
}

/* Lecture Styles */
.curriculum-lecture {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
    background: white;
}

.curriculum-lecture:last-child {
    border-bottom: none;
}

.lecture-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.lecture-number {
    color: #666;
    margin-right: 4px;
}

.lecture-name {
    margin: 0;
    font-size: 0.95rem;
}

.lecture-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
}

/* Action buttons styling */
.edit-button, .delete-button {
    background: none;
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    color: #666;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    line-height: 1;
    transition: color 0.2s ease;
}

.edit-button:hover {
    color: #8c5cc9;  /* Lighter purple that keeps icon visible */
}

.delete-button:hover {
    color: #ff6b6b;  /* Lighter red that keeps icon visible */
}

/* Tab Navigation */
.tab-nav {
    display: flex !important;
    visibility: visible !important;
    background-color: #e9ecef;
    padding: 10px 10px 0;
    border-radius: 4px 4px 0 0;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 15px;
}

.tab-button {
    background: none;
    border: none;
    padding: 8px 16px;
    margin-right: 4px;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px 4px 0 0;
    position: relative;
}

.tab-button:hover {
    background-color: #dee2e6;
    color: #41276A;
}

.tab-button.active {
    background-color: white;
    color: #41276A;
    border-bottom: 2px solid #41276A;
}

/* Tab Content */
.tab-content {
    background: white;
    padding: 20px;
    border-radius: 0 0 4px 4px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Toast Notification Styles */
.toast-notification {
    position: fixed;
    top: 20px;
    bottom: auto;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 2147483647;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-in-out;
    max-width: 300px;
    text-align: center;
    font-weight: 500;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* For error toasts if needed later */
.toast-notification.error {
    background-color: #f44336;
}

/* Content Type Selector - Global Styles */
.content-type-selector {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
    justify-content: flex-start !important;
    margin-left: 0 !important;
    margin-bottom: 15px !important;
    padding: 10px 15px !important;
    border-radius: 5px !important;
    background-color: #f5f5f5 !important;
    box-sizing: border-box !important;
}

.content-type-selector span {
    min-width: 120px !important;
    display: inline-block !important;
    margin-right: 15px !important;
    font-weight: 500 !important;
}

.content-type-selector .content-type-btn,
.content-type-btn {
    display: inline-block !important;
    margin-right: 10px !important;
    padding: 8px 16px !important;
    border: none !important;
    border-radius: 4px !important;
    background-color: #e0e0e0 !important;
    color: #333 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
}

/* Portal Access Button Colors */
#portal-access-button.portal-enabled {
    background-color: #4CAF50 !important; /* Green color for enabled */
    color: white !important;
}

#portal-access-button.portal-disabled {
    background-color: #f44336 !important; /* Red color for disabled */
    color: white !important;
}

#portal-access-button.portal-enabled:hover {
    background-color: #3e8e41 !important; /* Darker green on hover */
}

#portal-access-button.portal-disabled:hover {
    background-color: #d32f2f !important; /* Darker red on hover */
}
