/* Global */
html {
    overflow-y: scroll;
}

body {
    font-family: Tahoma, Arial, sans-serif;
    font-size: 14px;
    margin: 0;
    padding: 0;
    color: #222;
    background-color: #ffffff;
    background-image:
        linear-gradient(to right, #e0e0e0 1px, transparent 1px),
        linear-gradient(to bottom, #e0e0e0 1px, transparent 1px);
    background-size: 64px 64px;
    background-position: 0 0;
    background-repeat: repeat;
}

.ilp-container {
    max-width: 1000px;
    margin: 20px auto;
    background: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Header */
.header {
    background: #ffffff;
    color: #1f3a5f;
    height: 120px;        /* NEW */
    padding: 0;           /* ensures height is exact */
    display: flex;
    align-items: center;  /* vertically centers content */
    border-bottom: 1px solid #d7e5ff;
}

.header-inner {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.logo-placeholder {
    width: 80px;              /* adjust to your real logo width */
    height: 80px;             /* adjust to your real logo height */
    background: #1f3a5f11;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: #1f3a5f;
    margin-right: 20px;       /* NEW so the text doesn’t overlap */
    position: static;         /* NEW — removes overflow behavior */
}


.header-text {
    text-align: center;
}

.header-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 2px;
    color: #1f3a5f;
}

.header-subtitle {
    font-size: 13px;
    opacity: 0.9;
    color: #1f3a5f;
}

/* Page wrapper */
.page {
    padding: 20px 24px 40px 24px;
    background: transparent;  /* container provides the background */
}

/* Selector bar */
.selector-bar {
    background: #ffffff;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.selector-bar label {
    font-size: 14px;
    font-weight: bold;
}

.selector-spacer {
    flex: 1;
}

/* Voice Control Button */
.btn-voice {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-left: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: transform 0.1s ease;
}

.btn-voice:hover {
    transform: scale(1.1);
}

.btn-voice .voice-icon {
    font-size: 28px;
    opacity: 0.5;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.btn-voice:hover .voice-icon {
    opacity: 0.8;
}

.btn-voice.listening {
    animation: pulse-voice 1.5s ease-in-out infinite;
}

.btn-voice.listening .voice-icon {
    opacity: 1;
    color: #dc3545;
}

@keyframes pulse-voice {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.student-select {
    min-width: 260px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccd2dd;
    font-size: 14px;
    background-color: #fdfdff;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px; /* pill-style */
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.05s ease-out, box-shadow 0.05s ease-out, background-color 0.15s ease-out;
    font-weight: 500;
    min-height: 40px;      /* ensures Select/Add same height */
}

/* Round icon-only buttons */
.btn-icon-round {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center;
    align-items: center;
}

.btn-icon-round .btn-icon {
    font-size: 18px;
    margin: 0;
    width: auto;
    line-height: 1;
}

.btn-add.btn-icon-round .btn-icon {
    font-size: 24px;
    font-weight: bold;
}

.btn-save.btn-icon-round .btn-icon {
    font-size: 20px;
    font-weight: bold;
}

.btn-select {
    background: #ffffff;
    color: #2e7dd7;
    border: 2px solid #2e7dd7;
}

.btn-select:hover {
    background: #2e7dd7;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn-selector-cancel {
    background: #ffffff;
    color: #dc3545;
    border: 2px solid #dc3545;
    display: none;
}

.btn-selector-cancel.visible {
    display: inline-flex;
}

.btn-selector-cancel:hover {
    background: #dc3545;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn-add {
    background: #34a853;
    color: #ffffff;
}

.btn-add:hover {
    background: #27823f;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn-save {
    background: #ffffff;
    color: #2e7dd7;
    border: 2px solid #2e7dd7;
}

.btn-save:hover {
    background: #2e7dd7;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn-cancel {
    background: #d3d7dd;
    color: #333333;
}

.btn-cancel:hover {
    background: #c3c7ce;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 16px;
    display: inline-block;
    width: 16px;           /* fixed width so Select/Add feel the same */
    text-align: center;
}

/* Icon colors for specific button types */
.btn-add .btn-icon {
    color: #ffffff;
}

.btn-select .btn-icon,
.btn-save .btn-icon {
    color: inherit;
}

.btn-selector-cancel .btn-icon {
    color: inherit;
}

.btn-text {
    font-size: 14px;
}

/* Panels */
.panel {
    background: #ffffff;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    margin-bottom: 20px;
    position: relative;
}

.panel-hidden,
.auth-panel .panel-hidden {
    display: none !important;
}

.panel h2 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.panel h3 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 16px;
}

/* Section panels (inside ILP forms) */
.section-panel {
    background: #f7faff;
    border-radius: 8px;
    border: 1px solid #d7e5ff;
    padding: 12px 14px 14px 14px;
    margin-top: 14px;
}

.section-panel:first-of-type {
    margin-top: 10px;
}


.section-description {
    font-size: 12px;
    color: #555;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Form layout */
.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 220px;
}

.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 3px;
}

input[type="text"],
input[type="date"],
textarea {
    width: 100%;
    font-size: 13px;
    padding: 7px 9px;
    border-radius: 6px;
    border: 1px solid #c7cedd;
    box-sizing: border-box;
    background-color: #ffffff;
}

textarea {
    min-height: 60px;
    resize: vertical;
}

/* Grade select dropdown */
select.grade-select {
    width: 100%;
    padding: 7px 9px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #c7cedd;
    background-color: #ffffff;
    box-sizing: border-box;
}

/* Date of birth input */
input.dob-input {
    cursor: pointer;
}

/* Multi-select dropdown */
select.multi-select {
    width: 100%;
    min-height: 120px;
    padding: 8px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #c7cedd;
    background-color: #ffffff;
    box-sizing: border-box;
}

select.multi-select option {
    padding: 3px 8px;
    margin: 1px 0;
    border-radius: 4px;
}

select.multi-select option:checked {
    background: #2e7dd7 linear-gradient(0deg, #2e7dd7 0%, #2e7dd7 100%);
    color: #ffffff;
}

/* Preferred time of day select - smaller height */
select.pref-time-select {
    min-height: auto;
}

/* Preferred time row layout - 1/3 and 2/3 split */
.pref-time-row {
    flex-wrap: nowrap !important;
}

.pref-time-group {
    flex: 0 0 33% !important;
    min-width: 0 !important;
}

.pref-time-notes-group {
    flex: 0 0 66% !important;
    min-width: 0 !important;
}

/* Range slider */
input.slider-input {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #d7e5ff;
    outline: none;
    margin-top: 10px;
    margin-bottom: 10px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

input.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2e7dd7;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

input.slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2e7dd7;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

input.slider-input:hover::-webkit-slider-thumb {
    background: #2564ac;
}

input.slider-input:hover::-moz-range-thumb {
    background: #2564ac;
}

.slider-value {
    font-weight: 600;
    color: #2e7dd7;
}

/* Misc */
.small-muted {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
}

/* Save bar */
.save-bar {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Basic responsive tweak */
@media (max-width: 768px) {
    .selector-bar {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .page {
        padding: 0 10px 20px 10px;
    }

    .form-group {
        min-width: 100%;
    }

    .header-inner {
        padding: 0 16px;
    }

    .logo-placeholder {
        position: static;
        margin-right: 10px;
    }

    .header-inner {
        justify-content: flex-start;
    }

    .header-text {
        text-align: left;
    }
}

/* Auth panel styles */
.auth-panel {
    max-width: 400px;
    margin: 40px auto;
}

/* When showing auth panel, make page background white */
.page:has(.auth-panel) {
    background: #ffffff;
}

body:has(.auth-panel) {
    background: #ffffff;
}

.auth-panel .auth-forms {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-panel form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-panel label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1f3a5f;
    margin-bottom: 5px;
}

.auth-panel input[type="email"],
.auth-panel input[type="password"],
.auth-panel input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid #c7cedd;
    border-radius: 8px;
    background-color: #fdfdff;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-panel input[type="email"]:focus,
.auth-panel input[type="password"]:focus,
.auth-panel input[type="text"]:focus {
    outline: none;
    border-color: #2e7dd7;
    box-shadow: 0 0 0 3px rgba(46, 125, 215, 0.15);
}

.auth-panel .form-actions {
    margin-top: 6px;
    display: flex;
    gap: 10px;
}

.auth-welcome {
    margin-left: auto;
    padding: 8px 0;
    text-align: right;
    font-size: 14px;
    color: #555;
}

.auth-welcome a {
    color: #2e7dd7;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background-color 0.15s ease;
}

.modal-close:hover {
    background: #e0e0e0;
}

.modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #1f3a5f;
    padding-right: 30px;
}

.modal-content h4 {
    margin: 16px 0 8px 0;
    font-size: 14px;
    color: #1f3a5f;
}

.modal-content ul {
    margin: 0;
    padding-left: 20px;
}

.modal-content li {
    margin-bottom: 4px;
    font-size: 13px;
    color: #444;
}

/* Info Button Styles */
.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2e7dd7;
    color: #ffffff;
    border: none;
    font-size: 12px;
    font-weight: bold;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1;
    padding: 0;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.info-btn:hover {
    background: #2564ac;
    transform: scale(1.1);
}

/* Info Modal Styles */
.info-modal-content {
    max-width: 600px;
}

.info-modal-content h3 {
    color: #1f3a5f;
    margin-bottom: 16px;
}

.info-definition {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #f7faff;
    border-radius: 6px;
    border-left: 3px solid #2e7dd7;
}

/* Other Classes Section */
.other-class-section {
    background: #f7faff;
    border-radius: 8px;
    border: 1px solid #d7e5ff;
    padding: 16px;
    margin-bottom: 20px;
}

.other-class-section h4 {
    color: #1f3a5f;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.other-class-section .class-citation {
    font-weight: normal;
    font-size: 12px;
    color: #666;
}

.other-class-section .section-description {
    margin-bottom: 16px;
}

.other-class-section .form-group .small-muted {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.4;
}

.info-definition strong {
    color: #1f3a5f;
    display: block;
    margin-bottom: 4px;
}

.info-definition p {
    margin: 0;
    font-size: 13px;
    color: #444;
    line-height: 1.5;
}

/* Math Profile Two-Column Layout */
.math-two-column {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.math-left-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.math-right-column {
    flex: 1;
    background: #f7faff;
    border-radius: 8px;
    border: 1px solid #d7e5ff;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.math-right-column .form-group {
    margin-bottom: 12px;
}

.math-right-column .form-group:last-child {
    margin-bottom: 0;
}

.math-dropdown-panel {
    background: #f7faff;
    border-radius: 8px;
    border: 1px solid #d7e5ff;
    padding: 14px;
}

.math-dropdown-panel .form-group {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .math-two-column {
        flex-direction: column;
    }
}

/* Log Section Styles */
.log-section {
    position: relative;
}

.log-add-form {
    background: #f7faff;
    border-radius: 8px;
    border: 1px solid #d7e5ff;
    padding: 14px;
}

.log-textarea {
    min-height: 80px;
}

.log-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.btn-add-entry {
    background: #34a853;
    color: #ffffff;
}

.btn-add-entry:hover {
    background: #27823f;
}

.btn-history {
    background: #e8f0fe;
    color: #1f3a5f;
    border: 1px solid #c7d4e8;
}

.btn-history:hover {
    background: #d4e3fc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.history-count {
    font-weight: 600;
}

/* History Modal Styles */
.history-modal-content {
    max-width: 600px;
}

.history-entries {
    max-height: 400px;
    overflow-y: auto;
}

.history-loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

.history-empty {
    text-align: center;
    color: #888;
    padding: 30px;
    font-style: italic;
}

.history-entry {
    background: #f7faff;
    border: 1px solid #d7e5ff;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.history-entry:last-child {
    margin-bottom: 0;
}

.history-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
}

.history-date {
    font-weight: 600;
    color: #1f3a5f;
}

.history-author {
    color: #555;
}

.history-content {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Tab Navigation Styles */
.ilp-tabs {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0;
    background: transparent;
    padding: 0 8px 0 0;
    margin-bottom: 0;
    border-bottom: 2px solid #ccc;
}

.tab-btn {
    flex: 0 0 auto;
    min-width: 70px;
    padding: 10px 16px;
    border: 1px solid #ccc;
    border-bottom: none;
    background: #ffffff;
    color: #2e7dd7;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: background-color 0.15s ease, color 0.15s ease;
    text-align: center;
    white-space: nowrap;
    margin-right: -1px;
    margin-bottom: -2px;
    position: relative;
}

.tab-btn:hover {
    background: #e8f0fe;
    color: #2564ac;
}

.tab-btn.active {
    background: #2e7dd7;
    color: #ffffff;
    border-color: #2e7dd7;
    border-bottom: 2px solid #2e7dd7;
    font-weight: 600;
    z-index: 1;
}

.tab-btn.active:hover {
    background: #2564ac;
    color: #ffffff;
}

/* Save button - positioned top right of panel */
.btn-tab-save {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: auto;
    height: auto;
    min-height: auto;
    padding: 4px;
    border-radius: 0;
    z-index: 10;
}

.btn-tab-save .btn-icon {
    font-size: 32px !important;
    color: #b0b0b0 !important;
    width: auto !important;
    transition: color 0.2s ease;
}

.btn-tab-save.has-changes .btn-icon {
    color: #2e7dd7 !important;
}

.btn-tab-save:hover {
    background: transparent !important;
    transform: scale(1.15);
    box-shadow: none !important;
}

.btn-tab-save:hover .btn-icon {
    color: #888 !important;
}

.btn-tab-save.has-changes:hover .btn-icon {
    color: #2564ac !important;
}

/* Tab Content Styles */
.tab-content {
    display: none;
    border: 1px solid #ccc;
    border-top: none;
    padding: 16px;
    background: #ffffff;
    border-radius: 0 0 6px 6px;
}

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

/* Responsive tab adjustments */
@media (max-width: 768px) {
    .tab-btn {
        min-width: 55px;
        padding: 8px 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .ilp-tabs {
        flex-wrap: wrap;
        border-bottom: none;
    }

    .tab-btn {
        flex: 1 1 calc(33.33% - 2px);
        min-width: 60px;
        border-radius: 4px;
        margin-bottom: 2px;
        border-bottom: 1px solid #ccc;
    }

    .tab-btn.active {
        border-bottom: 1px solid #2e7dd7;
        background: #2e7dd7;
        color: #ffffff;
    }

    .tab-content {
        border-radius: 6px;
        border: 1px solid #ccc;
    }
}

