/* static/css/style.css */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f9;
    color: #333;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 900px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: #444;
}

h2 {
    text-align: center;
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 15px;
}

#booking-widget {
    display: flex;
    flex-wrap: wrap; /* Позволяет переносить элементы на новую строку на маленьких экранах */
    gap: 30px;
    margin-top: 20px;
}

#calendar-container {
    flex: 1; /* Растягивается, занимая доступное место */
    min-width: 320px; /* Минимальная ширина для календаря */
}

#time-slots-container {
    flex: 1; /* Растягивается, занимая доступное место */
    min-width: 320px; /* Минимальная ширина для блока со временем */
}

/* Стили для встроенного календаря flatpickr */
.flatpickr-calendar.inline {
    width: 100%;
    box-shadow: none;
    border: 1px solid #e0e0e0;
}

/* СЕТКА ДЛЯ ВРЕМЕННЫХ СЛОТОВ - КЛЮЧЕВОЕ ИЗМЕНЕНИЕ */
#time-slots {
    display: grid;
    /* Создаем колонки, которые автоматически заполняют пространство,
       но не могут быть уже 70px */
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px; /* Пространство между кнопками времени */
}

.time-slot {
    padding: 12px 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 0.9em;
}

.time-slot:hover {
    border-color: #007bff;
    color: #007bff;
}

.time-slot.selected {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.time-slot.disabled {
    background-color: #f8f9fa;
    color: #c0c0c0;
    cursor: not-allowed;
    text-decoration: line-through;
}

.time-slot.disabled:hover {
    border-color: #ccc;
    color: #c0c0c0;
}

/* ================================== */
/* === СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА ==== */
/* ================================== */

.modal {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
}

@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }
@keyframes slideIn { from {transform: translateY(-50px);} to {transform: translateY(0);} }

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover {
    color: #333;
}

#booking-details-form label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    font-size: 0.9em;
}

#booking-details-form input[type="text"],
#booking-details-form input[type="tel"],
#booking-details-form select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Важно для правильной ширины */
}

#booking-details-form button {
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.2s;
}

#booking-details-form button:hover {
    background-color: #0056b3;
}

.equipment-list div, .rules-agreement {
    margin-top: 10px;
}

.total-price {
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: right;
}
/* Блок оборудования - карточки */
.equipment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.equipment-list > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.equipment-list > div:hover {
  background-color: #e9ecef;
}

.equipment-list input[type="checkbox"] {
  margin: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.equipment-list label {
  margin: 0;
  font-size: 14px;
  cursor: pointer;
  flex: 1;
}

/* Согласие с правилами - та же карточка */
.rules-agreement {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-bottom: 16px;
}

.rules-agreement:hover {
  background-color: #e9ecef;
}

.rules-agreement input[type="checkbox"] {
  margin: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.rules-agreement label {
  margin: 0;
  font-size: 14px;
  cursor: pointer;
  flex: 1;
}

.rules-agreement a {
  color: #007bff;
  text-decoration: none;
}

.rules-agreement a:hover {
  text-decoration: underline;
}

}

/* Прошедшее время - серый */
.time-slot.past {
    background: #e2e3e5;
    border-color: #6c757d;
    color: #383d41;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Выбранный слот - синий */
.time-slot.selected {
    background: #007bff;
    border-color: #0056b3;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}


.time-slot.available {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.time-slot.available:hover {
    background: #28a745;
    color: white;
    transform: scale(1.03);
}

.time-slot.booked {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
    cursor: not-allowed;
    opacity: 0.7;
}

.time-slot.past {
    background: #e2e3e5;
    border-color: #6c757d;
    color: #383d41;
    cursor: not-allowed;
    opacity: 0.5;
}

.time-slot.selected {
    background: #007bff;
    border-color: #0056b3;
    color: white;
    font-weight: 500;
}

.time-slot.disabled {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Цветная индикация слотов времени */
#time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    margin-top: 15px;
}

.time-slot {
    padding: 10px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s ease;
    text-align: center;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.time-slot.available {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.time-slot.available:hover {
    background: #28a745;
    color: white;
    transform: scale(1.02);
}

.time-slot.booked,
.time-slot.disabled {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
    cursor: not-allowed;
    opacity: 0.7;
}

.time-slot.past {
    background: #e2e3e5;
    border-color: #6c757d;
    color: #383d41;
    cursor: not-allowed;
    opacity: 0.5;
}

.time-slot.selected {
    background: #007bff;
    border-color: #0056b3;
    color: white;
    font-weight: 500;
}

/* Центрирование заголовков и контента */
.booking-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.booking-header {
    text-align: center;
    margin-bottom: 30px;
}

.booking-header h1 {
    margin: 0 0 10px 0;
}

.booking-header p {
    margin: 0;
    color: #666;
}

#timeslots-wrapper {
    text-align: center;
}

#timeslots-wrapper h2 {
    text-align: center;
    margin: 20px 0 15px 0;
}

/* Центрирование календаря */
#calendar-container {
    display: flex;
    justify-content: center;
    margin: 20px auto;
}

#calendar-container .flatpickr-calendar {
    margin: 0 auto;
}

.flatpickr-calendar.inline {
    max-width: 100%;
    margin: 0 auto;
}
/* Блок адреса в стиле календаря */
.location-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 24px;
  margin: 24px auto;
  max-width: 600px;
  text-align: center;
}

.location-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
}

.location-icon {
  font-size: 28px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.location-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #2c3e50;
}

.location-body {
  padding: 0;
}

.location-address {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 8px 0;
}

.location-floor {
  font-size: 16px;
  color: #6c757d;
  margin: 0 0 16px 0;
}

.location-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
  color: #856404;
  line-height: 1.5;
}

.location-map-btn {
  display: inline-block;
  background: linear-gradient(135deg, #f5f5f5 0%, #f4f4f4 100%);
  color: rgb(0, 0, 0);
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin-top: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgb(235, 235, 235);
}

.location-map-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgb(202, 202, 202);
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
  .location-card {
    margin: 20px 16px;
    padding: 20px;
    border-radius: 12px;
  }
  
  .location-header h3 {
    font-size: 18px;
  }
  
  .location-address {
    font-size: 16px;
  }
  
  .location-floor {
    font-size: 14px;
  }
  
  .location-warning {
    font-size: 13px;
    padding: 10px 12px;
  }
  
  .location-map-btn {
    width: 70%;
    padding: 12px 20px;
  }
}
/* Единые стили для модальных окон */
.modal-inner {
    padding: var(--space-32);
}

.success-message {
    text-align: center;
    color: var(--color-success);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-20);
}

#success-summary {
    margin-bottom: var(--space-24);
}

.calendar-section {
    margin-top: var(--space-24);
    padding-top: var(--space-20);
    border-top: 1px solid var(--color-border);
}

.price-display {
    margin: var(--space-20) 0;
    padding: var(--space-16);
    background: var(--color-secondary);
    border-radius: var(--radius-base);
    border-left: var(--space-4) solid var(--color-primary);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-label {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}
/* Стили для кнопок календаря - ТОЧНО КАК КНОПКА ЗАБРОНИРОВАТЬ */
.calendar-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

.calendar-buttons button {
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #667eea 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    font-family: 'Manrope', sans-serif;
}

.calendar-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.calendar-buttons button:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .calendar-buttons {
        flex-direction: column;
    }
    
    .calendar-buttons button {
        width: 100%;
    }
}
