/* Responsive Lessons Navigation */
.week-day-nav.responsive-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.day-display {
    font-weight: 600;
    font-size: 1.1em;
}

@media (max-width: 900px) {
    .container {
        padding: 8px;
    }
    .header {
        padding: 16px 0;
        margin-bottom: 18px;
    }
    .main-section {
        padding: 0 2px;
    }
    .week-day-nav.responsive-nav {
        gap: 0.5rem;
        font-size: 1em;
    }
    .day-display {
        font-size: 1em;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 2px;
    }
    .header {
        padding: 10px 0;
        margin-bottom: 10px;
        border-radius: 0 0 8px 8px;
    }
    .main-section {
        padding: 0 1px;
    }
    .week-day-nav.responsive-nav {
        gap: 0.2rem;
        font-size: 0.98em;
    }
    .day-display {
        font-size: 0.98em;
    }
}

/* Lessons container grid responsive */
.lessons-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 200px;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 12px 8px;
    margin-bottom: 18px;
}

@media (max-width: 600px) {
    .lessons-container {
        padding: 6px 2px;
        border-radius: 6px;
        margin-bottom: 8px;
    }
}
/* To-Do List Section Styles */
.todo-section {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    min-height: 100px;
    max-height: 100px;
    overflow-y: auto;
    transition: background 0.2s;
    font-size: 0.92em;
}
.todo-section.drag-over {
    background: #e0f2fe;
}
.todo-list {
    list-style: none;
    margin: 6px 0 0 0;
    padding: 0;
    font-size: 0.92em;
}
.todo-item {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 4px;
    margin-bottom: 2px;
    padding: 2px 6px;
    cursor: grab;
    transition: box-shadow 0.2s;
    font-size: 0.92em;
}
.todo-item.dragging {
    opacity: 0.5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.todo-remove-btn {
    color: #888;
    font-size: 1em;
    border: none;
    background: transparent;
    cursor: pointer;
    margin-left: 6px;
}
.todo-input {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.95em;
    margin-bottom: 2px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f3f4f6;
    --surface-color: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.visually-hidden-file-input {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: white;
    padding: 24px 0;
    margin-bottom: 32px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
}

.header-controls {
    font-size: 11px;
    margin-bottom: 2px;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
}

.header-controls .btn i {
    margin-right: 6px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.user-email {
    font-size: 14px;
    opacity: 0.9;
}

/* Authentication Section */
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    padding: 40px 20px;
}

.auth-container {
    background: var(--surface-color);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.auth-container h2 {
    margin-bottom: 24px;
    font-size: 24px;
    text-align: center;
}

.auth-input-group {
    margin-bottom: 16px;
}

.auth-input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.auth-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-note {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 16px;
}

/* Main Section */
.main-section {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Week Navigation */
.week-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
}

.week-display {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 250px;
    text-align: center;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: nowrap;
    align-items: center;
    flex-direction: row;
    width: 100%;
}
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--surface-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Admin Panel */
.admin-panel {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 24px;
}

.admin-panel-header h3 {
    margin: 0;
    font-size: 18px;
}

.admin-panel-header p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.admin-panel-controls {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.members-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fafafa;
}

.member-email {
    font-size: 14px;
    color: var(--text-primary);
}

.member-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Range Clear Panel */
.range-clear-panel {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 12px;
    margin-bottom: 20px;
}

.range-clear-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.range-clear-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.range-date-input {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    background: var(--surface-color);
    color: var(--text-primary);
}

.range-clear-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Range-clear toggle button moved to header controls */

/* Timetable Lessons Container */
.timetable-wrapper {
    display: flex;
    gap: 0;
    background: var(--surface-color);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    margin-bottom: 40px;
}

.timetable-wrapper.compressed .time-slot {
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    background: inherit;
}

.timetable-wrapper.compressed .lesson-card {
    padding: 8px;
    font-size: 12px;
}

.time-column {
    flex: 0 0 100px;
    min-width: 100px;
    background: var(--background-color);
    border-right: 2px solid var(--border-color);
}

.time-bar {
    display: flex;
    flex-direction: column;
}

.time-header {
    flex: 0 0 80px;
    padding: 12px 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: white;
}

.time-slot {
    flex: 0 0 120px;
    padding: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-column {
    flex: 1 1 auto;
    min-width: 200px;
    border-right: 1px solid var(--border-color);
    transition: opacity 0.3s ease;
}

.day-column:last-child {
    border-right: none;
}

.day-column-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 80px;
}

.day-name {
    font-size: 14px;
    font-weight: 700;
}

.day-date {
    font-size: 11px;
    opacity: 0.9;
}

.timeline-wrapper {
    display: grid;
    grid-template-rows: repeat(auto-fit, 120px);
    grid-auto-rows: 120px;
}

.timetable-wrapper.compressed .timeline-wrapper {
    grid-template-rows: repeat(auto-fit, 30px);
    grid-auto-rows: 30px;
}

.timeline-slot {
    display: contents;
}

.lesson-in-slot {
    padding: 6px;
    font-size: 11px;
    border-left-width: 3px;
    box-shadow: var(--shadow-sm);
    overflow: visible;
    grid-column: 1;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.lesson-in-slot .lesson-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
}

.lesson-in-slot .lesson-meta-item {
    font-size: 11px;
    display: block;
    word-wrap: break-word;
    line-height: 1.2;
}

.lesson-in-slot .lesson-status {
    display: none;
}

.lesson-in-slot .lesson-card-header {
    margin-bottom: 2px;
}

.lesson-in-slot .lesson-title {
    font-size: 13px;
    line-height: 1.3;
}

.lesson-plan-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-word;
}

.lesson-notes {
    margin-top: 4px;
    max-height: 80px;
    overflow-y: auto;
    overflow-x: hidden;
        margin-top: 2px;
        max-height: 50px;
        padding: 2px;
        font-size: 11px;
        line-height: 1.2;
}

.lesson-notes-content {
    word-wrap: break-word;
    white-space: pre-wrap;
    word-break: break-word;
}

.lesson-notes::-webkit-scrollbar {
    width: 4px;
}

.lesson-notes::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.lesson-notes::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.lesson-notes::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}
}

/* Old day-based styles (kept for reference) */
.lessons-container.flex {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 40px;
}

.day-section {
    transition: opacity 0.3s ease;
}

.day-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.day-header h3 {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
}

.day-lessons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.empty-day {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    background: var(--background-color);
    border-radius: 8px;
    grid-column: 1 / -1;
}

.lesson-card {
    background: var(--surface-color);
    padding: 10px 12px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid var(--primary-color);
    position: relative;
    overflow: hidden;
    font-size: 13px;
    border-radius: 7px;
    max-width: 320px;
}

.lesson-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.lesson-card.practical {
    border-left-color: var(--secondary-color);
}

.lesson-card.meeting {
    border-left-color: var(--warning-color);
}

.lesson-card.assembly {
    border-left-color: #8b5cf6;
}

.lesson-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 6px;
}

.lesson-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    word-break: break-word;
}

.lesson-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 8px;
}

.badge-practical {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.badge-meeting {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-assembly {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.lesson-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.lesson-meta-item {
    display: flex;
    align-items: start;
    gap: 4px;
}

.lesson-meta-item strong {
    color: var(--text-primary);
    min-width: 60px;
}

.lesson-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.lesson-status {
    font-size: 12px;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border-radius: 4px;
    margin-top: 8px;
}

.lesson-status.planned {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-nav {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-nav:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-google {
    background: white;
    color: #1f2937;
    border: 1px solid var(--border-color);
    width: 100%;
}

.btn-google:hover {
    background: #f9fafb;
    border-color: var(--primary-color);
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    background: var(--text-primary);
    color: white;
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.show {
    display: block;
}

.toast.success {
    background: var(--secondary-color);
}

.toast.error {
    background: var(--danger-color);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 16px;
    }

    .header h1 {
        font-size: 22px;
    }

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

    .header-controls button {
        width: 100%;
    }

    .week-navigation {
        flex-direction: column;
        gap: 12px;
    }

    .week-display {
        min-width: auto;
    }

    .filter-controls {
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .filter-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .day-lessons {
        grid-template-columns: 1fr;
    }

    .time-column {
        flex: 0 0 60px;
    }

    .time-slot {
        font-size: 11px;
        flex: 0 0 50px;
    }

    .day-column {
        min-width: 180px;
    }

    .day-column-header {
        padding: 8px 4px;
    }

    .day-column-header div:first-child {
        font-size: 14px;
    }

    .day-date {
        font-size: 10px;
    }

    .timeline-slot {
        flex: 0 0 50px;
    }

    .lesson-in-slot {
        padding: 4px;
        font-size: 11px;
    }

    .lesson-title {
        font-size: 12px;
    }

    .toast {
        right: 10px;
        left: 10px;
    }
}

/* Mobile View Styles */
.mobile-day-nav {
    display: none;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--surface-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.mobile-nav-btn {
    padding: 10px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.mobile-nav-btn:hover {
    background: #2563eb;
}

.mobile-nav-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    color: var(--text-secondary);
}

.mobile-day-display {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
}

.mobile-lessons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--surface-color);
    border-radius: 8px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

.mobile-time-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-time-header {
    padding: 8px 12px;
    background: var(--background-color);
    border-left: 4px solid var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-time-header.current-time {
    background: rgba(59, 130, 246, 0.15);
    border-left-color: var(--primary-color);
}

.mobile-time-header.current-time::before {
    content: '● ';
    color: var(--primary-color);
    font-weight: bold;
}

.mobile-lesson-card {
    padding: 12px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-lesson-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.mobile-lesson-card.practical {
    border-left-color: var(--secondary-color);
}

.mobile-lesson-card.meeting {
    border-left-color: var(--warning-color);
}

.mobile-lesson-card.assembly {
    border-left-color: #8b5cf6;
}

.mobile-lesson-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.mobile-plan-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    word-break: break-word;
}

.mobile-lesson-meta {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.mobile-lesson-status {
    font-size: 11px;
    color: var(--secondary-color);
    margin-top: 6px;
    font-weight: 500;
}

/* Show mobile view on small screens */
@media (max-width: 768px) {
    .timetable-wrapper,
    .lessons-container {
        display: none;
    }

    .mobile-day-nav {
        display: flex;
    }

    #mobileViewContainer {
        display: block !important;
    }
}
