/* Los Cielos Timetable Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* ========== Login Page ========== */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-logo {
    max-width: 200px;
    margin-bottom: 30px;
}

.login-logo-placeholder {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-box h1 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.8rem;
}

.login-box p {
    color: #666;
    margin-bottom: 25px;
}

.login-box input[type="password"] {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.login-box input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.login-box button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.1s, box-shadow 0.1s;
}

.login-box button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.error-message {
    color: #e53e3e;
    margin-top: 15px;
    font-size: 0.9rem;
}

/* ========== Grade Selection Page ========== */
.grades-container {
    padding: 40px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.grades-header {
    text-align: center;
    margin-bottom: 40px;
}

.grades-header h1 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 10px;
}

.grades-header p {
    color: #666;
}

.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.grade-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.grade-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.grade-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.grade-card.disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.grade-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.grade-card h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: #333;
}

.grade-card p {
    font-size: 0.9rem;
    color: #666;
}

.grade-card .coming-soon {
    font-style: italic;
    color: #999;
}

.logout-link {
    display: block;
    text-align: center;
    margin-top: 30px;
    color: #666;
    text-decoration: none;
}

.logout-link:hover {
    color: #333;
    text-decoration: underline;
}

/* ========== Timetable Page ========== */
.timetable-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.timetable-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.timetable-header h1 {
    color: #333;
    font-size: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.timetable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    table-layout: fixed;
}

.timetable th,
.timetable td {
    border: 2px solid #333;
    padding: 15px 10px;
    text-align: center;
    vertical-align: middle;
    width: 20%;
}

.timetable th {
    background-color: #f0f0f0;
    font-weight: bold;
    font-size: 1.1rem;
}

.timetable td {
    height: 80px;
    font-weight: 500;
}

.time-slot {
    background-color: #f0f0f0 !important;
    font-weight: bold;
    min-width: 120px;
}

/* Subject-Teacher colors */
.history-scarlett { background-color: #da70d6; }
.magazine-gem { background-color: #ff9966; }
.spanish-standalone { background-color: #ff6b6b; }
.maths-gem { background-color: #ffff00; }
.biology-vanessa { background-color: #ffffcc; }
.spanish-tessa { background-color: #ffd700; }
.spanish-gem { background-color: #98fb98; }
.english-tessa { background-color: #8080ff; }
.science-inma { background-color: #9370db; }
.pshe-bee { background-color: #a05070; color: white; }
.art-helen { background-color: #4169e1; color: white; }
.empty { background-color: #d3d3d3; }

.break-row td {
    height: 30px !important;
    padding: 4px 10px !important;
    font-size: 0.8rem;
}

.break {
    background-color: #e8e8e8;
    color: #666;
}

/* Clickable cells */
.timetable td a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    padding: 10px;
}

.timetable td:not(.time-slot):not(.empty):not(.break) {
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.timetable td:not(.time-slot):not(.empty):not(.break):hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1;
    position: relative;
}

.subject {
    font-weight: bold;
    font-size: 1rem;
}

.teacher {
    font-size: 0.9rem;
    margin-top: 5px;
}

.start-time {
    font-size: 0.8rem;
    margin-top: 3px;
    font-style: italic;
}

.section-break {
    height: 20px;
    background-color: white;
}

.section-break td {
    border: none;
    height: 20px;
    padding: 0;
}

/* Spanish Level Selector */
.spanish-selector {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.spanish-selector h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

.level-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.level-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s;
}

.level-option:hover {
    border-color: #ff6b6b;
    background-color: #fff5f5;
}

.level-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.level-option input[type="radio"]:checked + span {
    color: #ff6b6b;
}

.level-option:has(input:checked) {
    border-color: #ff6b6b;
    background-color: #fff5f5;
}

.spanish-cell {
    cursor: pointer;
}

.in-person {
    cursor: default !important;
    padding: 10px;
}

.in-person:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* ========== Teacher Edit Mode ========== */
.edit-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.3);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-with-edit:hover .edit-btn {
    opacity: 1;
}

.edit-btn:hover {
    background: rgba(255,255,255,0.95);
}

.cell-with-edit {
    position: relative;
}

.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.edit-modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
}

.edit-modal-content h3 {
    margin-bottom: 20px;
}

.edit-modal-content input {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 20px;
}

.edit-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.edit-modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.edit-modal-buttons .save-btn {
    background: #667eea;
    color: white;
}

.edit-modal-buttons .cancel-btn {
    background: #e0e0e0;
}

/* Spanish edit modal */
.spanish-edit-modal {
    max-width: 550px;
}

.spanish-link-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.spanish-link-row label {
    min-width: 120px;
    font-weight: 500;
    color: #333;
}

.spanish-link-row input {
    flex: 1;
    margin-bottom: 0 !important;
}

/* ========== Coming Soon Page ========== */
.coming-soon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px;
}

.coming-soon-container h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
}

.coming-soon-container p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}
