/* --- 1. Сброс и База --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; line-height: 1.6; color: #333; background: #f4f7f6; }
.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* --- 2. Шапка --- */
header { background: #2c3e50; padding: 20px 0; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo { color: #fff; font-size: 1.5rem; font-weight: bold; }

/* --- 3. Кнопки (Универсальные) --- */
.btn, .btn-blue, .btn-danger {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
}

.btn { background: #d4af37; color: #fff; }
.btn:hover { background: #b8962d; }

.btn-blue { background: #007bff; color: white; }
.btn-blue:hover { background: #0056b3; }

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

/* --- 4. Секция Hero --- */
.hero { padding: 80px 0; display: flex; align-items: center; }
.hero-content { display: flex; gap: 40px; align-items: center; }
.text-block { flex: 1; }
.text-block h1 { font-size: 2.5rem; margin-bottom: 20px; color: #2c3e50; line-height: 1.2; }
.text-block p { font-size: 1.1rem; color: #555; margin-bottom: 25px; }
.photo-block { flex: 1; display: flex; justify-content: center; }
.photo-block img { width: 100%; max-width: 400px; border-radius: 10px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); object-fit: cover; }

/* --- 5. Форма записи --- */
.contact { padding: 60px 0; background: #fff; text-align: center; }
#booking-form {
    max-width: 450px;
    margin: 0 auto;
    background: #fdfdfd;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    border: 1px solid #eaeaea;
    text-align: left;
}
#booking-form h3 { margin-bottom: 20px; color: #2c3e50; font-size: 1.5rem; text-align: center; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; color: #444; font-size: 0.9rem; }
input, textarea, select { padding: 12px; border: 1px solid #ccc; border-radius: 5px; width: 100%; font-size: 1rem; background: #fff; }
input:focus, select:focus { outline: none; border-color: #d4af37; box-shadow: 0 0 5px rgba(212,175,55,0.3); }

#booking-form button { width: 100%; margin-top: 10px; }

/* Уведомления внутри формы (вместо alert) */
#form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 5px;
    font-size: 0.95rem;
    text-align: center;
    display: none;
}
#form-message.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; display: block; }
#form-message.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; display: block; }

/* --- 6. Админка --- */
.admin-container {
    max-width: 800px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.admin-container h1 { 
    font-size: 1.5rem; 
    margin-bottom: 20px; 
    border-bottom: 2px solid #eee; 
    padding-bottom: 10px; 
}

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

.slot {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    transition: 0.2s;
}

.slot:hover { background: #e9ecef; }
.slot.active { background: #28a745; color: #fff; border-color: #28a745; }

/* --- 7. Адаптивность --- */
@media (max-width: 768px) {
    .hero { padding: 40px 0; }
    .hero-content { flex-direction: column; text-align: center; }
    .text-block h1 { font-size: 2rem; }
    #booking-form { padding: 25px 20px; }
}

/* Фиксируем высоту контейнера админки, чтобы календарь всегда имел пространство */
.admin-container {
    max-width: 1200px;
    margin: 30px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}


/* Растягиваем внутренний флекс-контейнер */
.fc-forma-dl1:nth-last-child {
    height: auto !important;
    flex-direction: column !important; /* Выстраиваем время и текст друг под другом */
    align-items: flex-start !important;
    white-space: normal !important;
}

/* Разрешаем тексту переноситься */
.fc-forma-TZ4 {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* Цвет для занятых слотов (с именем клиента) */
.fc-v-event.event-booked {
    background-color: #d9534f !important;
    border-color: #d9534f !important;
}

/* Цвет для свободных слотов */
.fc-v-event.event-free {
    background-color: #5cb85c !important;
    border-color: #5cb85c !important;
}

/* Компактная шапка календаря в один ряд */
.fc .fc-toolbar.fc-header-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* Убираем лишние отступы у блоков кнопок в тулбаре */
.fc .fc-toolbar-chunk {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Делаем кнопки переключения видов (Week/Day) и навигации аккуратными */
.fc .fc-button {
    padding: 6px 12px;
    font-size: 14px;
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    color: #333;
    box-shadow: none !important;
}

.fc .fc-button-active {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: #fff !important;
}


/* Принудительно возвращаем горизонтальное направление для шапки календаря */
.fc .fc-toolbar.fc-header-toolbar,
.fc .fc-toolbar-chunk,
div[class*="fc-forma-yi0"] {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

/* Фиксируем размеры элементов управления внутри */
.fc .fc-toolbar button {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    height: 36px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    background: #f8f9fa !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    color: #333 !important;
    box-shadow: none !important;
}