/* === Общие стили === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: auto;
    padding: 0 15px;
}

/* === Хедер === */
header {
    background-color: white;
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    height: 32px;
    margin-right: 8px;
    vertical-align: middle;
}

.logo h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #007BFF;
}

nav {
    display: flex;
    gap: 25px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

nav a:hover {
    color: #007BFF;
}

.user-greeting {
    font-size: 14px;
    color: #555;
}

/* === Кнопки === */
.btn {
    padding: 12px 24px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s, opacity 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background-color: #007BFF;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

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

/* === Баннер === */
.hero {
    background-color: #eef4ff;
    padding: 100px 0;
    text-align: center;
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 10px;
    color: #222;
}

.hero p {
    font-size: 20px;
    color: #555;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-form input {
    padding: 12px 20px;
    width: 400px;
    max-width: 100%;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.search-form button {
    padding: 12px 24px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.search-form button:hover {
    background-color: #0056b3;
}

/* === Категории === */
.categories {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.categories span {
    background-color: #007BFF;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
}

.categories span:hover {
    opacity: 0.8;
}

/* === Популярные предметы === */
.popular-subjects {
    padding: 80px 0;
    background-color: white;
    text-align: center;
}

.popular-subjects h3 {
    font-size: 26px;
    margin-bottom: 40px;
    color: #222;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    padding: 0 15px;
}

.subject-card {
    background-color: #f0f0f0;
    padding: 20px;
    border-radius: 10px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* === Почему Learnika === */
.why-us {
    padding: 80px 0;
    background-color: #f9f9f9;
    text-align: center;
}

.why-us h3 {
    font-size: 26px;
    margin-bottom: 40px;
    color: #222;
}

.why-us ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.why-us li {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-size: 16px;
    text-align: left;
}

/* === Футер === */
footer {
    background-color: #eee;
    padding: 20px 0;
    text-align: center;
    color: #666;
    font-size: 14px;
}

footer p {
    margin: 5px 0;
}

footer a {
    color: #007BFF;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* === Регистрационная форма === */
.form-page {
    padding: 80px 0;
    background-color: #f9f9f9;
    min-height: 100vh;
}

.form-page h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #222;
}

.form-page p {
    margin-bottom: 20px;
    color: #555;
}

form#registration-form {
    max-width: 500px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

form#registration-form label {
    display: block;
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 5px;
    color: #333;
}

form#registration-form input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 15px;
}

form#registration-form .captcha {
    margin-top: 10px;
}

form#registration-form .btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border-radius: 5px;
    background-color: #007BFF;
    color: white;
    border: none;
    cursor: pointer;
}

form#registration-form .btn:hover {
    background-color: #0056b3;
}

.social-login {
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.links {
    margin-top: 30px;
    font-size: 14px;
}

.links a {
    color: #007BFF;
    text-decoration: none;
}

.links a:hover {
    text-decoration: underline;
}

/* === Прочее === */

/* Улучшенные стили для формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 15px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #007BFF;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

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

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007BFF;
}

.cover-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px dashed #ccc;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* === Мои уроки === */
.my-lessons {
    margin-top: 40px;
}

.my-lessons h3 {
    font-size: 22px;
    color: #222;
    margin-bottom: 20px;
}

.lesson-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.lesson-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.lesson-card:hover {
    transform: translateY(-2px);
}

.lesson-card h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #1F50E8;
}

.lesson-card p {
    margin: 5px 0;
    color: #555;
    font-size: 14px;
}

.lesson-card .price {
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

.lesson-card .cover {
    width: 100%;
    height: 150px;
    background-color: #f0f0f0;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 10px;
}

.support-note {
    font-size: 0.95rem;
    color: #666;
    margin: 8px 0 24px;
    line-height: 1.5;
}

.support-note a {
    color: #e63946;
    font-weight: 600;
    text-decoration: none;
}

.support-note a:hover {
    text-decoration: underline;
}

/* === Стили расписания === */
.schedule-table .schedule-cell {
    border-radius: 4px;
    transition: all 0.2s;
}
.schedule-table .empty {
    background: #f9f9f9;
    color: #888;
}
.schedule-table .empty:hover {
    background: #eef5ff;
    color: #1a73e8;
}
.schedule-table .free {
    background: #e6f4ea;
    color: #137333;
}
.schedule-table .booked {
    background: #fce8e6;
    color: #c5221f;
}
.schedule-table .schedule-cell:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* =================================================== */
/* === МОДАЛЬНОЕ ОКНО (УЧИТЕЛЬ и УЧЕНИК) - ОБЪЕДИНЕННЫЙ БЛОК === */
/* =================================================== */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Более темный фон для расписания */
    /* 🚨 ПОКАЗЫВАЕМ ПО УМОЛЧАНИЮ (скрываем только через класс .hidden) */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 🚨 Скрыть/Показать через JS */
.hidden {
    display: none !important;
}

.modal-dialog {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 95%;
    max-width: 1600px; /* Широкий контейнер для расписания */
    max-height: 95%;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Стиль для модалок входа (если они используют .modal-content напрямую) */
.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    width: 400px; /* Узкая ширина для форм */
    max-width: 90%;
}

/* Переопределяем для расписания, если нужно */
#schedule-modal .modal-content,
#student-schedule-modal .modal-content {
    width: 100%;
    padding: 0; /* Контент расписания внутри .modal-dialog */
    box-shadow: none;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #333;
}

.close-btn { /* Для старых модалок входа */
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}
.close-btn:hover {
    color: #000;
}
/* =================================================== */