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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    cursor: default;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    cursor: default;
}

/* Заголовок */
header {
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-section {
    flex: 0 0 auto;
}

.logo-link {
    display: block;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo {
    height: 90px;
    width: auto;
    max-width: 250px;
}

.title-section {
    flex: 1;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin: 0;
    text-align: center;
}

nav {
    flex: 0 0 auto;
    text-align: right;
}

nav a {
    color: #e09807;
    text-decoration: none;
    margin: 0 1rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
    background-color: rgba(224, 152, 7, 0.1);
    border: 1px solid rgba(224, 152, 7, 0.3);
}

nav a:hover {
    background-color: #e09807;
    color: #ffffff;
}

/* Основной контент */
main {
    flex: 1;
    padding: 2rem 0;
}

/* Секции */
.welcome-section {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.welcome-section h2 {
    color: #667eea;
    margin-bottom: 1rem;
}

/* Сетка услуг */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.service-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.service-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.service-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.service-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.info-item {
    background: #f8f9fa;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    color: #666;
}

/* Формы */
.booking-section {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: default;
}

.booking-form {
    margin-top: 1.5rem;
    cursor: default;
}

.form-group {
    margin-bottom: 1.5rem;
    cursor: default;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    cursor: default;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    cursor: default;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

/* Курсор text только для текстовых полей */
input[type="text"],
input[type="tel"],
textarea {
    cursor: text;
}

/* Курсор pointer для элементов выбора */
select,
input[type="date"],
input[type="file"] {
    cursor: pointer;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #051e45;
    color: #ffffff;
}

.btn-secondary:hover {
    filter: brightness(0.95);
}

.btn-danger {
    background: #e09807;
    color: #ffffff;
}

.btn-danger:hover {
    filter: brightness(0.95);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Уведомления */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Администрирование */
.admin-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-tabs {
    margin-top: 2rem;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #e1e5e9;
    margin-bottom: 2rem;
}

.tab-button {
    padding: 1rem 2rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-button:hover {
    color: #667eea;
    background-color: #f8f9fa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Таблицы */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* Секции экспорта/импорта */
.export-section,
.import-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.cleanup-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.import-info {
    background: #e3f2fd;
    padding: 1.5rem;
    border-radius: 5px;
    margin-bottom: 2rem;
}

.import-info h3 {
    color: #1976d2;
    margin-bottom: 1rem;
}

.import-info ol {
    margin-left: 1.5rem;
}

.import-info li {
    margin-bottom: 0.5rem;
}

/* Подвал */
footer {
    background: #051e45;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Стили для занятых времен */
.text-muted {
    color: #6c757d;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: block;
    text-align: center;
}

/* Стили для полностью занятых дат в календаре */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

/* Стиль для предупреждения о полностью занятой дате */
.date-fully-booked-warning {
    color: #dc3545;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0.5rem;
    display: block;
    background-color: #ffe6e6;
    padding: 0.7rem;
    border-radius: 5px;
    border-left: 5px solid #dc3545;
    animation: pulseWarning 2s ease-in-out infinite;
    text-align: center;
}

/* Анимация для предупреждения */
@keyframes pulseWarning {
    0%, 100% {
        border-left-color: #dc3545;
    }
    50% {
        border-left-color: #ff1a1a;
    }
}

/* Стиль для поля даты с полностью занятой датой */
input[type="date"].fully-booked {
    border-color: #dc3545 !important;
    background-color: #ffe6e6 !important;
    border-width: 3px !important;
}

/* Стиль для успешного сообщения о доступных временах */
.text-muted.available {
    color: #28a745;
    font-weight: 600;
}

/* Модальное окно успешной записи */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideUp 0.4s ease;
    position: relative;
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 1rem;
}

.modal-code {
    font-size: 2.5rem;
    font-weight: 900;
    color: #051e45;
    background: #f0f8ff;
    padding: 1rem;
    border-radius: 10px;
    margin: 1.5rem 0;
    letter-spacing: 3px;
    border: 3px dashed #e09807;
}

.modal-text {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.modal-warning {
    font-size: 0.95rem;
    color: #dc3545;
    font-weight: 600;
    background: #ffe6e6;
    padding: 0.8rem;
    border-radius: 8px;
    margin-top: 1rem;
    border-left: 4px solid #dc3545;
}

.modal-button {
    background: #e09807;
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.3s;
}

.modal-button:hover {
    background: #c98606;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(224, 152, 7, 0.4);
}

.modal-email-info {
    font-size: 0.9rem;
    color: #28a745;
    margin-top: 1rem;
    padding: 0.7rem;
    background: #d4edda;
    border-radius: 8px;
}

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

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

/* Адаптивность модального окна */
@media (max-width: 768px) {
    .modal-content {
        padding: 2rem 1.5rem;
    }
    
    .modal-code {
        font-size: 2rem;
        letter-spacing: 2px;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem 1rem;
        max-width: 95%;
    }
    
    .modal-icon {
        font-size: 3rem;
    }
    
    .modal-code {
        font-size: 1.8rem;
        padding: 0.8rem;
        letter-spacing: 1px;
    }
    
    .modal-button {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
}

/* Согласие на обработку персональных данных */
.privacy-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.5rem 0;
}

.privacy-consent input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #e09807;
}

.privacy-label {
    margin: 0 !important;
    font-weight: 500 !important;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.privacy-consent input[type="checkbox"]:checked + .privacy-label {
    color: #051e45;
}

/* Google reCAPTCHA */
.captcha-container {
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
    min-height: 78px;
    overflow: visible;
}

.captcha-container .g-recaptcha {
    display: inline-block !important;
}

.captcha-container > div {
    margin: 0 auto;
}

/* Индикатор загрузки */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Админ-заголовок */
.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.header-content h1 {
    margin-bottom: 1rem;
    width: 100%;
}

/* Админ-навигация */
.admin-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 100%;
    margin-top: 0.5rem;
}

.admin-nav a {
    color: #e09807;
    text-decoration: none;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
    white-space: nowrap;
    background-color: rgba(224, 152, 7, 0.1);
    border: 1px solid rgba(224, 152, 7, 0.3);
}

.admin-nav a:hover {
    background-color: #e09807;
    color: #ffffff;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .privacy-label {
        font-size: 0.95rem;
    }
    
    .admin-nav {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .admin-nav a {
        width: auto;
        text-align: center;
        max-width: 200px;
        margin: 0.25rem 0;
    }
    
    nav a {
        display: block;
        margin: 0.5rem 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-button {
        text-align: center;
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .booking-section {
        padding: 1rem;
    }
    
    .admin-section {
        padding: 1rem;
    }
    
    .service-card {
        padding: 1rem;
    }
    
    .captcha-container {
        transform: scale(0.85);
        transform-origin: center;
    }
}

/* Стили для таблицы печати */
.bookings-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.bookings-table th,
.bookings-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.bookings-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.bookings-table .number {
    width: 40px;
    text-align: center;
}

.bookings-table .time {
    width: 60px;
    text-align: center;
}

.bookings-table .phone {
    width: 120px;
}

.bookings-table .email {
    width: 150px;
}

/* Стили для админ-таблицы */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.data-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.data-table .phone {
    width: 120px;
    font-family: monospace;
}

.data-table .email {
    width: 180px;
    font-family: monospace;
    font-size: 0.85rem;
}

.data-table .service-point {
    width: 200px;
    font-size: 0.85rem;
    font-weight: 500;
}

.filter-section {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-form label {
    font-weight: 500;
    margin: 0;
}

.filter-form select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    min-width: 300px;
}

/* Специальные стили для поля email */
.email-input-wrapper {
    position: relative;
    cursor: default;
}

.email-input-wrapper::before {
    content: "✉";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 1;
    line-height: 1;
    display: flex;
    align-items: center;
    height: 100%;
}

input[type="email"] {
    padding-left: 40px;
    background-image: none;
    cursor: text;
}

input[type="email"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="email"]:invalid {
    border-color: #e1e5e9;
}

input[type="email"]:valid {
    border-color: #e1e5e9;
}

/* Стили для placeholder */
input[type="email"]::placeholder {
    color: #999;
    font-style: italic;
}

/* Состояния валидации email */
.email-input-wrapper.email-valid::before {
    color: #27ae60;
    content: "✓";
}

.email-input-wrapper.email-invalid::before {
    color: #e74c3c;
    content: "✗";
}

.email-input-wrapper.email-valid input[type="email"] {
    border-color: #e1e5e9;
    background-color: transparent;
}

.email-input-wrapper.email-invalid input[type="email"] {
    border-color: #e1e5e9;
    background-color: transparent;
}

/* Анимация для изменений состояния */
.email-input-wrapper {
    transition: all 0.3s ease;
}

.email-input-wrapper::before {
    transition: all 0.3s ease;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .logo-section {
        order: 1;
    }
    
    .title-section {
        order: 2;
    }
    
    nav {
        order: 3;
        text-align: center;
    }
    
    .logo {
        height: 70px;
        max-width: 200px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    nav a {
        margin: 0 0.5rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* --- Блок кастомизации фирменных цветов и градиента --- */
:root {
    --brand-1: #e09807; /* основной акцент */
    --brand-2: #051e45; /* глубокий фон */
    --brand-gradient: linear-gradient(135deg, var(--brand-2) 0%, var(--brand-2) 100%);
    --on-brand: #ffffff;
}

/* Шапка с градиентом бренда */
header {
    background: var(--brand-2) !important;
    background-image: var(--brand-gradient) !important;
    color: var(--on-brand) !important;
}

/* Основная кнопка с градиентом бренда */
.btn-primary {
    background: #e09807 !important;
    background-image: none !important;
    color: #ffffff !important;
    border-color: transparent !important;
}

.btn-primary:hover {
    filter: brightness(0.95);
    box-shadow: 0 5px 15px rgba(224, 152, 7, 0.35);
}

/* Акцентные заголовки в фирменном цвете */
.welcome-section h2,
.service-card h3 {
    color: var(--brand-2);
}

/* Фокус форм и активные вкладки в фирменном цвете */
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
    border-color: var(--brand-1);
}

input[type="email"]:focus {
    box-shadow: 0 0 0 3px rgba(224, 152, 7, 0.15);
}

.tab-button.active {
    color: var(--brand-2);
    border-bottom-color: var(--brand-2);
}

.tab-button:hover {
    color: var(--brand-2);
}
/* --- конец блока кастомизации --- */

@media (max-width: 480px) {
    .header-content {
        padding: 0 10px;
    }
    
    .logo {
        height: 60px;
        max-width: 170px;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    nav a {
        margin: 0 0.3rem;
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}
