
:root {
    --swim-gradient: linear-gradient(90deg, #0052d4, #4364f7, #6fb1fc);
    --swim-blue: #0088ff;
    --dark-blue: #0055aa;
    --light-bg: #f4f7f6;
    --white: #ffffff;
    --error-red: #ff6b6b;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-bg);
    color: #333;
    min-height: 100vh;
}

.app-header {
    background: var(--swim-gradient);
    color: var(--white);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
}


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

nav a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-weight: bold;
    font-size: 0.95rem;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}


.btn-logout, #logout-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.btn-logout:hover, #logout-btn:hover {
    background: var(--error-red);
    border-color: var(--error-red);
    transform: scale(1.05);
}


.container {
    max-width: 900px;
    width: 90%;
    margin: 40px auto;
}

.glass-card {
    background: var(--white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-top: 6px solid var(--swim-blue); 
    text-align: center;
}

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

main#content {
    animation: fadeIn 0.4s ease-out;
}





input:focus {
    outline: none;
    border-color: var(--swim-blue);
}

button[type="submit"] {
    padding: 14px;
    background: var(--swim-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

button[type="submit"]:hover {
    background: var(--dark-blue);
    box-shadow: 0 4px 12px rgba(0, 136, 255, 0.3);
}


ul {
    list-style: none;
    padding: 0;
}

.pool-item, li {
    background: white;
    border: 1px solid #eee;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pool-item:hover, li:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-left: 5px solid var(--swim-blue);
}

.price {
    font-weight: bold;
    color: var(--swim-blue);
}


#pool-search, #pool-search-main {
    width: 100%;
    padding: 12px;
    margin-bottom: 25px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}


.hidden {
    display: none !important;
}

.error-msg {
    color: var(--error-red);
    font-weight: bold;
    margin: 10px 0;
}


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

.card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    text-align: left;
}

.user-status {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    font-size: 0.9em;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.online {
    background-color: #00d1ff; /* Ярко-синий, как вода в бассейне */
    box-shadow: 0 0 8px #00d1ff;
}

.status-dot.offline {
    background-color: #bbb;
}

.user-name {
    font-weight: bold;
    color: #2c3e50;
}

/* Стили для поиска (Пункт 3) */
.search-container {
    margin: 25px 0;
    display: flex;
    justify-content: center;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
    filter: grayscale(1);
}

.search-input {
    width: 100% !important; /* Перебиваем старый инпут */
    padding: 12px 20px 12px 45px !important;
    border: 2px solid #ddd !important;
    border-radius: 30px !important;
    font-size: 1rem !important;
    transition: all 0.3s ease;
    margin-bottom: 0 !important;
}

.search-input:focus {
    border-color: var(--swim-blue) !important;
    box-shadow: 0 4px 12px rgba(0, 136, 255, 0.15);
}

/* Сетка для бассейнов */
.pools-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

/* Кнопка избранного (чтобы была красивой) */
.fav-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ccc;
    transition: transform 0.2s, color 0.2s;
}

.fav-btn.active {
    color: #f1c40f;
    transform: scale(1.1);
}

.fav-btn:hover {
    transform: scale(1.2);
}

/* Креативные кнопки для админки */
.btn-save, .btn-delete {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-save {
    background: #27ae60; /* Приятный зеленый */
}

.btn-save:hover {
    background: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
}

.btn-delete {
    background: #e74c3c; /* Насыщенный красный */
}

.btn-delete:hover {
    background: #ff5e4d;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

.admin-item {
    background: #fff;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    transition: border-color 0.3s;
}

.admin-item:hover {
    border-color: var(--swim-blue);
}

/* Стили для инпутов внутри списка админки */
.admin-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.9rem;
}

.admin-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

/* Кнопки вкладок по умолчанию */
.btn-tab {
    background: transparent;
    color: var(--swim-blue);
    border: 2px solid var(--swim-blue);
    padding: 10px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-tab:hover {
    background: rgba(0, 136, 255, 0.05);
}

/* Активная вкладка */
.btn-tab.active {
    background: var(--swim-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 85, 170, 0.2);
}

/* --- ОБЩИЕ ПРАВКИ ДЛЯ ФОРМЫ --- */
/* --- [ИСПРАВЛЕННЫЙ БЛОК: АДМИНКА + ВХОД] --- */

/* --- ОБЩИЕ ПРАВКИ И СИНХРОНИЗАЦИЯ РАЗМЕРОВ --- */

/* 1. ФОРМЫ (Вход, Регистрация, Сброс) — ТЕПЕРЬ КАК В АДМИНКЕ */
#login-form, #register-form, #reset-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;            /* Компактный отступ */
    max-width: 350px !important;      /* Узкая аккуратная форма */
    margin: 30px auto !important;
    text-align: left;
}

#login-form input, 
#register-form input, 
#reset-form input, 
#register-form select {
    width: 100% !important;
    padding: 10px !important;         /* Размер как в админке */
    font-size: 0.9rem !important;     /* Шрифт как в админке */
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    height: 40px !important;          /* Высота как в админке */
    box-sizing: border-box !important;
}

/* Кнопки тоже в размер админки */
#login-form button[type="submit"], 
#register-form button[type="submit"], 
#reset-form button[type="submit"] {
    height: 40px !important;
    padding: 0 20px !important;
    font-size: 0.9rem !important;     /* Текст как в админке */
    font-weight: bold !important;
    border-radius: 6px !important;
    cursor: pointer;
    background: var(--swim-blue);
    color: white;
    border: none;
    transition: 0.3s;
}

#register-form small {
    font-size: 0.85rem !important;    /* Маленькие подписи */
    color: #666;
}

/* 2. ТВОЯ РАБОЧАЯ АДМИНКА (БЕЗ ИЗМЕНЕНИЙ) */
.admin-grid-form {
    display: flex !important;
    flex-direction: row !important; 
    align-items: flex-end !important;
    gap: 10px !important;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0 !important;
}

.admin-grid-form div {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.admin-grid-form small {
    margin-bottom: 5px;
    color: #666;
    font-weight: bold;
    text-align: left;
}

.admin-grid-form input {
    padding: 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    margin: 0 !important;
    height: 40px;
    font-size: 0.9rem !important;
}

.admin-grid-form button {
    height: 40px;
    line-height: 40px;
    padding: 0 30px !important;
    margin: 0 !important;
    font-size: 0.9rem !important;
}

.admin-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.btn-tab {
    background: #ffffff;
    color: var(--swim-blue);
    border: 2px solid var(--swim-blue);
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.btn-tab.active {
    background: var(--swim-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(67, 100, 247, 0.3);
}

/* --- АДАПТИВ ДЛЯ МОБИЛОК (375px и меньше) --- */
@media (max-width: 650px) {
    /* 1. Исправляем кашу в шапке */
    .app-header {
        flex-direction: column !important; /* Логотип сверху, меню под ним */
        height: auto !important;
        padding: 15px 5% !important;
        gap: 15px !important;
    }

    nav {
        justify-content: center !important; /* Центрируем ссылки */
        gap: 8px !important;
        width: 100% !important;
    }

    nav a {
        font-size: 0.85rem !important; /* Чуть меньше шрифт для мобилки */
        padding: 6px 12px !important;
        background: rgba(255, 255, 255, 0.1); /* Делаем их похожими на кнопки */
        border-radius: 15px !important;
    }

    /* 2. Твоя рабочая админка (уже была ок, сохраняем) */
    .admin-grid-form {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }

    /* 3. Убираем лишние отступы у карточек, чтобы влезло */
    .glass-card {
        padding: 25px 15px !important;
    }

    .logo {
        font-size: 1.5rem !important;
    }
}

/* --- ИНДИКАТОР ЗАГРУЗКИ --- */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: var(--swim-blue);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

.loader-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    width: 100%;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Новые стили для техники плавания */


/* Сетка для техник с авто-подстройкой */
.techniques-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* Кнопка-ссылка на YouTube */
.video-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px 20px;
    background: #ff0000; /* Цвет YouTube */
    color: white !important;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: 0.3s ease;
    box-shadow: 0 4px 10px rgba(255, 0, 0, 0.2);
}

.video-link-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 0, 0, 0.3);
}

/* --- СТИЛИ БУРГЕРА --- */
/* --- ФИНАЛЬНЫЙ ФИКС МОБИЛЬНОГО ВИДА (НЕ ЛОМАЕТ АДМИНКУ) --- */

/* 1. Убираем горизонтальную болтанку и белые пятна */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

@media (max-width: 768px) {
    /* 2. Принудительно выстраиваем меню в столбик, чтобы ссылки не "летали" */
    .main-nav {
        display: none; /* Будет включаться через JS классом .active */
        flex-direction: column !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        width: 100% !important;
        background: var(--swim-gradient) !important;
        padding: 0 !important;
        gap: 0 !important;
        z-index: 9999;
    }

    .main-nav.active {
        display: flex !important;
    }

    /* 3. Делаем каждую ссылку/кнопку аккуратной строкой */
    .main-nav a, 
    .main-nav button, 
    #auth-links, 
    #private-links,
    .user-status {
        width: 100% !important;
        margin: 0 !important;
        padding: 15px 0 !important;
        text-align: center !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        border-radius: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-sizing: border-box !important;
        color: white !important;
    }

    /* Вложенные контейнеры ссылок тоже в столбик */
    #auth-links, #private-links {
        flex-direction: column !important;
    }

    /* 4. Корректируем шапку, чтобы лого и бургер были по краям */
    .app-header {
        height: 65px !important;
        flex-direction: row !important; /* Чтобы лого не падало под бургер */
        justify-content: space-between !important;
        padding: 0 5% !important;
    }

    /* Убираем лишние отступы у контента, чтобы не вылезали за край */
    .container {
        width: 94% !important;
        margin: 15px auto !important;
    }

    .glass-card {
        padding: 20px 10px !important;
        overflow: hidden !important; /* Чтобы таблицы не распирали карточку */
    }
}

/* --- КРЕАТИВНЫЙ ФИКС ШАПКИ И ЛОГИКИ --- */

/* Делаем бургер "сочным" и заметным */
#burger-btn {
    background: rgba(255, 255, 255, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 8px !important;
    padding: 8px !important;
    width: 44px !important;
    height: 40px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

#burger-btn span {
    width: 24px !important;
    height: 3px !important;
    background-color: #fff !important;
    box-shadow: 0 0 5px rgba(0,0,0,0.2) !important;
}

/* ЖЕСТКОЕ СКРЫТИЕ (Чтобы "Вход" не вылезал, когда ты залогинен) */
#auth-links.hidden, 
#private-links.hidden, 
.hidden {
    display: none !important; /* Перебивает любые другие стили */
}

/* Фикс для мобильного меню, чтобы элементы не слипались */
@media (max-width: 768px) {
    #nav-menu.active {
        padding-top: 20px !important;
        height: auto !important;
        min-height: 250px !important;
    }
    
    /* Убираем рамки у пустых блоков, чтобы не было лишних полосок */
    #auth-links:empty, #private-links:empty {
        display: none !important;
    }
}

#burger-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
#burger-btn.open span:nth-child(2) { opacity: 0; }
#burger-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* По умолчанию кнопка-бургер ВСЕГДА скрыта */
#burger-btn {
    display: none !important; 
}

/* Показываем её ТОЛЬКО на мобилках (до 768px) */
@media (max-width: 768px) {
    #burger-btn {
        display: flex !important; /* Или block, в зависимости от твоей верстки */
    }
}

/* Стили для дневника тренировок */
.workout-table {
    width: 100%;
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.workout-table th {
    background: var(--swim-blue);
    color: white;
    padding: 12px;
    font-size: 0.9rem;
}

.workout-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.workout-form-container {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    border: 1px dashed var(--swim-blue);
    margin-bottom: 20px;
    text-align: left;
}

.workout-grid-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.workout-grid-inputs div {
    display: flex;
    flex-direction: column;
}

.workout-grid-inputs label {
    font-size: 0.8rem;
    font-weight: bold;
    color: #666;
    margin-bottom: 5px;
}

/* Дополнительная полировка для дневника */
.workout-table tr:hover {
    background-color: rgba(0, 136, 255, 0.05); /* Легкая подсветка строки при наведении */
}

.workout-table th, .workout-table td {
    text-align: center;
    border-bottom: 1px solid #eee;
}

#workout-form-box {
    transition: all 0.3s ease; /* Чтобы смена рамки при редактировании была плавной */
}

/* Стили для иконок-кнопок в таблице */
.workout-table button {
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.workout-table button:hover {
    transform: scale(1.2);
}