/* --- Google Font --- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap');

/* --- CSS Variables for Theme Support --- */
:root {
    /* Dark theme (default) */
    --bg-primary: #1a202c;
    --bg-card: #2d3748;
    --bg-input: #1a202c;
    --bg-item: #4a5568;

    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-heading: #63b3ed;
    --text-heading-alt: #f56565;

    --border-color: #4a5568;
    --border-focus: #63b3ed;

    --accent-gold: #fbbf24;
    --accent-gold-hover: #f59e0b;
    --accent-blue: #63b3ed;
    --accent-blue-hover: #90cdf4;
    --accent-green: #48bb78;
    --accent-green-hover: #38a169;
    --accent-red: #e53e3e;
    --accent-red-hover: #c53030;
    --accent-purple: #9f7aea;
    --accent-purple-hover: #805ad5;
    --accent-orange: #fd7e14;
    --accent-teal: #20c997;

    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] {
    /* Light theme - improved contrast and readability */
    --bg-primary: #f5f7fa;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-item: #e8ecf1;

    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-heading: #2563eb;
    --text-heading-alt: #d97706;

    --border-color: #cbd5e0;
    --border-focus: #3b82f6;

    --accent-gold: #f59e0b;
    --accent-gold-hover: #d97706;
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --accent-green: #10b981;
    --accent-green-hover: #059669;
    --accent-red: #ef4444;
    --accent-red-hover: #dc2626;
    --accent-purple: #8b5cf6;
    --accent-purple-hover: #7c3aed;
    --accent-orange: #f97316;
    --accent-teal: #14b8a6;

    --shadow-color: rgba(0, 0, 0, 0.12);
}

/* --- General Body Styles --- */
body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* --- Main Container --- */
.container {
    width: 100%;
    max-width: 1000px;
    text-align: center;
}

/* --- Header --- */
header h1 {
    color: var(--text-heading);
    font-size: 2.8em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px var(--shadow-color);
}

/* --- User Role Badge --- */
.user-role-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: var(--accent-green);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: bold;
}

/* --- Stats Container --- */
.stats-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

/* --- XP/Practice Hours Display --- */
.xp-display {
    background-color: var(--accent-gold);
    color: var(--bg-primary);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 1.2em;
    font-weight: bold;
}

/* --- Assignments Display --- */
.assignments-display {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--accent-gold);
}

/* --- Card Style for Sections --- */
.card {
    background-color: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px var(--shadow-color);
    text-align: left;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px var(--shadow-color);
}

.card h2 {
    color: var(--text-heading-alt);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-top: 0;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.card h2:hover {
    color: var(--accent-blue);
}

/* --- Dashboard Sections --- */
.dashboard-section {
    display: none; /* Hidden by default, shown based on auth/role */
}

.dashboard-section.visible {
    display: block;
}

.admin-only {
    border-left: 5px solid var(--accent-gold);
}

/* --- Assignments List --- */
.assignments-list {
    display: grid;
    gap: 15px;
}

.assignment-item {
    background-color: var(--bg-item);
    border-radius: 12px;
    padding: 20px;
    border-left: 5px solid var(--accent-teal);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.assignment-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.assignment-item.completed {
    border-left-color: var(--accent-green);
    opacity: 0.8;
}

.assignment-item.overdue {
    border-left-color: var(--accent-red);
}

.assignment-title {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.assignment-description {
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.assignment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.assignment-actions {
    margin-top: 15px;
}

.assignment-video,
.assignment-document {
    display: inline-block;
    background-color: var(--accent-gold);
    color: var(--bg-primary);
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    margin-right: 10px;
    margin-bottom: 5px;
}

.assignment-video:hover,
.assignment-document:hover {
    background-color: var(--accent-gold-hover);
}

/* --- Practice Log --- */
.practice-entries {
    margin-bottom: 20px;
}

.practice-entry {
    background-color: var(--bg-item);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid var(--accent-purple);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.practice-entry:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.practice-entry .practice-date {
    color: var(--text-heading);
    font-weight: bold;
}

.practice-entry .practice-time {
    color: var(--accent-gold);
    font-size: 1.1em;
}

.practice-entry .practice-notes {
    color: var(--text-primary);
    margin-top: 5px;
    font-style: italic;
}

/* Weekly Summary Section */
.weekly-summary-section {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid var(--border-color);
}

.weekly-summary-section h3 {
    color: var(--text-heading);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.weekly-summary-item {
    background-color: var(--bg-item);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 4px solid var(--accent-blue);
}

.weekly-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.weekly-date-range {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 1.05em;
}

.weekly-hours {
    font-weight: bold;
    font-size: 1.1em;
    padding: 4px 10px;
    border-radius: 6px;
}

.weekly-hours.met-goal {
    color: var(--accent-green);
    background-color: rgba(72, 187, 120, 0.15);
}

.weekly-hours.near-goal {
    color: var(--accent-gold);
    background-color: rgba(251, 191, 36, 0.15);
}

.weekly-hours.below-goal {
    color: var(--accent-red);
    background-color: rgba(229, 62, 62, 0.15);
}

.weekly-summary-details {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* --- Students List (Admin) --- */
.students-list {
    display: grid;
    gap: 10px;
}

.student-item {
    background-color: var(--bg-item);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.student-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.student-info h3 {
    margin: 0;
    color: var(--text-heading);
}

.student-stats {
    text-align: right;
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* --- Enhanced Form Styles --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95em;
}

.form-group.required label::after {
    content: " *";
    color: var(--accent-red);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 1em;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.1);
}

.field-hint {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 6px;
    font-style: italic;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Form Validation States */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.form-group.error .field-hint {
    color: var(--accent-red);
}

.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1);
}

/* --- Action Buttons --- */
.action-btn {
    background-color: var(--accent-green);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn:hover:not(:disabled) {
    background-color: var(--accent-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.action-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn:disabled {
    background-color: var(--bg-item);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

/* --- Resources Section --- */
.resources-content,
.resource-manager-content,
.students-content,
.attendance-content,
.assignment-manager-content {
    transition: all 0.3s ease;
}

/* --- Resources List --- */
#resources-list {
    list-style-type: none;
    padding-left: 0;
}

#resources-list li {
    background-color: var(--bg-item);
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 8px;
    border-left: 5px solid var(--accent-orange);
    font-size: 1.1em;
    color: var(--text-primary);
}

/* --- Link Styles --- */
a {
    color: #63b3ed; /* Lighter blue for links */
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
    color: #90cdf4; /* Even lighter blue on hover */
}

/* --- Footer --- */
footer {
    margin-top: 30px;
    color: #a0aec0; /* Lighter gray for footer */
    font-size: 0.9em;
}

.link-button {
    background: none;
    border: none;
    color: #63b3ed;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9em;
}

/* --- Theme Switcher --- */
#theme-switcher {
    position: absolute;
    top: 20px;
    right: 120px; /* Position left of language switcher with more space */
}

#theme-toggle {
    background-color: var(--bg-item);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    border-color: var(--accent-gold);
}

.theme-icon-light {
    display: none;
}

[data-theme="light"] .theme-icon-dark {
    display: none;
}

[data-theme="light"] .theme-icon-light {
    display: inline;
}

/* --- Language Switcher Styles --- */
#language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
}

#language-switcher button {
    background-color: #4a5568;
    border: none;
    border-radius: 8px; /* Rounded corners */
    padding: 5px 10px;
    font-weight: bold; /* Bolder text */
    color: #e2e8f0; /* Light text color for contrast */
}

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

.modal-content {
    position: relative;
    margin: auto;
    padding: 25px;
    width: 90%;
    max-width: 500px;
}

.close-btn {
    color: #a0aec0;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
    color: #e2e8f0;
    text-decoration: none;
    cursor: pointer;
}

/* --- Login Button --- */
.login-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    background-color: #48bb78;
    color: white;
    transition: background-color 0.2s;
}

.login-btn:hover {
    background-color: #38a169;
}

/* --- Login Page Styles --- */
.login-card {
    max-width: 500px;
    margin: 40px auto;
    text-align: center;
}

.tab-container {
    display: flex;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background-color: #4a5568;
    color: #e2e8f0;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tab-btn.active {
    background-color: #63b3ed;
    color: #1a202c;
}

.tab-btn:hover:not(.active) {
    background-color: #2d3748;
}

.login-card h1 {
    color: #63b3ed;
    margin-bottom: 10px;
}

.login-card p {
    color: #a0aec0;
    margin-bottom: 20px;
}

.form-container input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 2px solid #4a5568;
    background-color: #1a202c;
    color: #e2e8f0;
    font-size: 1em;
    box-sizing: border-box;
}

.form-container input:focus {
    outline: none;
    border-color: #63b3ed;
}

/* --- Monthly Assignment Sections --- */
.monthly-section {
    margin-bottom: 20px;
    border: 2px solid #4a5568;
    border-radius: 12px;
    overflow: hidden;
}

.monthly-header {
    background-color: #2d3748;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.monthly-header:hover {
    background-color: #1a202c;
}

.monthly-title {
    margin: 0;
    color: #63b3ed;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.monthly-stats {
    font-size: 0.9em;
    color: #a0aec0;
    font-weight: normal;
}

.toggle-btn {
    background: none;
    border: none;
    color: #63b3ed;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
}

.monthly-content {
    padding: 0;
    max-height: 2000px;
    transition: all 0.3s ease;
}

.monthly-content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.monthly-assignments {
    padding: 20px;
    background-color: #1a202c;
}

/* --- Resource Management (Admin) --- */
.resource-admin-item {
    background-color: var(--bg-item);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.resource-info {
    flex: 1;
}

.resource-info strong {
    color: var(--text-heading);
    font-size: 1.1em;
}

.resource-info small {
    color: var(--text-secondary);
}

.resource-info a {
    color: var(--accent-blue);
    word-break: break-all;
}

.delete-resource-btn {
    background-color: #e53e3e;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.delete-resource-btn:hover {
    background-color: #c53030;
}

/* --- Progress Bars Section --- */
.progress-section {
    margin-top: 20px;
    margin-bottom: 30px;
}

.progress-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.progress-bar-item {
    background-color: var(--bg-item);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.progress-bar-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #e2e8f0;
}

.progress-label span:first-child {
    font-weight: bold;
    color: #63b3ed;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background-color: #4a5568;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    border-radius: 6px;
}

/* Weekly practice bar gets special color */
#weekly-practice-bar {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

/* --- Practice Timer Styles --- */
.practice-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.timer-btn {
    background-color: #9f7aea;
}

.timer-btn:hover {
    background-color: #805ad5;
}

.timer-modal {
    max-width: 600px;
    width: 90%;
}

.timer-display {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.timer-circle {
    position: relative;
    width: 200px;
    height: 200px;
}

.timer-progress {
    transform: rotate(-90deg);
}

.timer-progress-bg {
    fill: none;
    stroke: #4a5568;
    stroke-width: 8;
}

.timer-progress-fill {
    fill: none;
    stroke: #48bb78;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 0.3s ease;
}

.timer-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5em;
    font-weight: bold;
    color: #63b3ed;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.timer-control-btn {
    padding: 12px 25px;
    font-size: 1.1em;
}

.timer-presets {
    background-color: #2d3748;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.timer-presets h3 {
    color: #63b3ed;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.preset-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.preset-btn {
    background-color: #4a5568;
    border: 2px solid #63b3ed;
    color: #63b3ed;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    min-width: 70px;
}

.preset-btn:hover,
.preset-btn.active {
    background-color: #63b3ed;
    color: #1a202c;
}

.custom-timer {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.custom-timer input {
    width: 150px;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #4a5568;
    background-color: #1a202c;
    color: #e2e8f0;
    font-size: 1em;
}

.custom-timer input:focus {
    border-color: #63b3ed;
    outline: none;
}

.metronome-section {
    background-color: #2d3748;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.metronome-section h3 {
    color: #fbbf24;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.metronome-controls {
    text-align: center;
}

.metronome-display {
    font-size: 1.5em;
    font-weight: bold;
    color: #fbbf24;
    margin-bottom: 15px;
}

.bpm-slider {
    margin: 20px 0;
}

.bpm-slider input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #4a5568;
    outline: none;
    -webkit-appearance: none;
}

.bpm-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fbbf24;
    cursor: pointer;
}

.bpm-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fbbf24;
    cursor: pointer;
    border: none;
}

.bpm-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.9em;
    color: #a0aec0;
}

.metronome-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.metronome-buttons .action-btn {
    background-color: #fbbf24;
    color: #1a202c;
}

.metronome-buttons .action-btn:hover {
    background-color: #f59e0b;
}

.session-type-section,
.session-notes-section {
    margin-bottom: 20px;
}

.session-type-section h3,
.session-notes-section h3 {
    color: #63b3ed;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.session-type-section select {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #4a5568;
    background-color: #1a202c;
    color: #e2e8f0;
    font-size: 1em;
}

.session-type-section select:focus {
    border-color: #63b3ed;
    outline: none;
}

.session-notes-section textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #4a5568;
    background-color: #1a202c;
    color: #e2e8f0;
    font-size: 1em;
    resize: vertical;
    font-family: inherit;
}

.session-notes-section textarea:focus {
    border-color: #63b3ed;
    outline: none;
}

.timer-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.complete-session-btn {
    background-color: #48bb78;
}

.complete-session-btn:hover:not(:disabled) {
    background-color: #38a169;
}

.complete-session-btn:disabled {
    background-color: #4a5568;
    opacity: 0.6;
}

.discard-session-btn {
    background-color: #e53e3e;
}

.discard-session-btn:hover {
    background-color: #c53030;
}

/* --- Attendance Manager Styles --- */
.attendance-header {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.attendance-header label {
    color: #63b3ed;
    font-weight: bold;
    font-size: 1.1em;
}

.attendance-header input[type="date"] {
    padding: 10px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 1em;
    flex: 1;
    min-width: 150px;
}

.attendance-header input[type="date"]:focus {
    border-color: var(--border-focus);
    outline: none;
}

.secondary-btn {
    background-color: #63b3ed;
}

.secondary-btn:hover {
    background-color: #4299e1;
}

.danger-btn {
    background-color: #e53e3e;
}

.danger-btn:hover {
    background-color: #c53030;
}

#attendance-students-list {
    margin-bottom: 25px;
}

.attendance-student-item {
    background-color: var(--bg-item);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.attendance-student-item.marked {
    border-left: 5px solid var(--accent-green);
    background-color: var(--bg-card);
}

.attendance-student-name {
    flex: 1;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text-primary);
}

.attendance-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.attendance-status-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.attendance-status-select:focus {
    border-color: var(--border-focus);
    outline: none;
}

.attendance-status-select.present {
    border-color: var(--accent-green);
    background-color: rgba(72, 187, 120, 0.1);
}

.attendance-status-select.absent {
    border-color: var(--accent-red);
    background-color: rgba(229, 62, 62, 0.1);
}

.attendance-status-select.excused {
    border-color: var(--accent-gold);
    background-color: rgba(251, 191, 36, 0.1);
}

.attendance-status-select.tardy {
    border-color: var(--accent-orange);
    background-color: rgba(246, 173, 85, 0.1);
}

.attendance-notes-btn {
    background-color: var(--accent-purple);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.attendance-notes-btn:hover {
    background-color: var(--accent-purple-hover);
}

.attendance-notes {
    margin-top: 20px;
    margin-bottom: 20px;
}

.attendance-notes label {
    display: block;
    color: var(--text-heading);
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.attendance-notes textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 1em;
    resize: vertical;
    font-family: inherit;
}

.attendance-notes textarea:focus {
    border-color: var(--border-focus);
    outline: none;
}

#save-attendance {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    margin-top: 10px;
}

/* Attendance History */
#attendance-history-section h3 {
    color: var(--text-heading);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.attendance-history-item {
    background-color: var(--bg-item);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 4px solid var(--text-heading);
}

.attendance-history-date {
    color: var(--accent-gold);
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 8px;
}

.attendance-history-summary {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.attendance-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.95em;
}

.attendance-stat.present {
    color: var(--accent-green);
}

.attendance-stat.absent {
    color: var(--accent-red);
}

.attendance-stat.excused {
    color: var(--accent-gold);
}

.attendance-stat.tardy {
    color: var(--accent-orange);
}

.attendance-stat-icon {
    font-size: 1.2em;
}

/* Attendance Badge/Icons */
.status-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-icon.present {
    background-color: #48bb78;
}

.status-icon.absent {
    background-color: #e53e3e;
}

.status-icon.excused {
    background-color: #fbbf24;
}

.status-icon.tardy {
    background-color: #f6ad55;
}

/* Student Progress Enhancement */
.student-progress {
    margin-top: 15px;
}

.student-progress .progress-bar-item {
    margin-bottom: 10px;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    /* Header controls positioning for mobile */
    #theme-switcher {
        right: 80px; /* Closer to language switcher on mobile */
    }

    #language-switcher {
        right: 20px;
    }

    .stats-container {
        flex-direction: column;
        gap: 15px;
    }

    .assignment-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .student-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .login-card {
        margin: 20px auto;
        padding: 20px;
    }

    .tab-container {
        flex-direction: column;
    }

    .resource-admin-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .progress-container {
        gap: 12px;
    }

    .progress-bar-item {
        padding: 12px;
    }

    .practice-actions {
        flex-direction: column;
        align-items: center;
    }

    .timer-controls {
        flex-direction: column;
        align-items: center;
    }

    .preset-buttons {
        justify-content: center;
    }

    .custom-timer {
        flex-direction: column;
        gap: 15px;
    }

    .timer-modal {
        width: 95%;
        padding: 20px;
    }

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

    .metronome-buttons {
        flex-direction: column;
    }

    /* Attendance responsive */
    .attendance-header {
        flex-direction: column;
        align-items: stretch;
    }

    .attendance-header input[type="date"] {
        width: 100%;
    }

    .attendance-student-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .attendance-controls {
        flex-direction: column;
        width: 100%;
    }

    .attendance-status-select {
        width: 100%;
    }

    .attendance-history-summary {
        flex-direction: column;
        gap: 10px;
    }

    /* Form responsive */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

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

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