/* ==========================================================================
    BASE UI COMPONENTS (shared)
    Общие компоненты интерфейса
    Используются в travel и photos
========================================================================== */
/* Стили для заголовка */
.travel-title {
    text-align: center;
    margin-top: 20px;
}

/* Стили для пагинации */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
    background: #a1c2bf;
    padding: 10px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Стили для карты */
.map-widget {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
}

/* Стили для фотографий */
.photo-description {
    text-align: center;
    font-size: 14px;
    margin-top: 5px;
    color: #444;
}

/* кнопка фильтрации */
.filter-btn {
    background: #e4f5dc;
    border: 1px solid #b8d8a7;
    padding: 6px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s ease;
}

.filter-btn:hover {
    background: #8fb4ae;
}

/* Вторичный стиль кнопки */
.filter-btn--secondary {
    background-color: #eef7e6;
    color: #2f6f3e;
    border: 1px solid #b7d7b0;
    font-weight: 600;
    text-decoration: none;
}

.filter-btn--secondary:hover {
    background-color: #8fb4ae;
    text-decoration: none;
}

/* Формы */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Группа формы */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 6px;
    color: #222;
}

/* Форма ввода */
.form-input,
.form-textarea,
.form-file {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 15px;
    background-color: #fff;
    box-sizing: border-box;
}

/* Форма ввода текста */
.form-textarea {
    resize: vertical;
}

.form-input:focus,
.form-textarea:focus,
.form-file:focus {
    outline: none;
    border-color: #7fb6a6;
    box-shadow: 0 0 0 2px rgba(127, 182, 166, 0.3);
}

/* Ошибка ввода */
.form-error {
    color: #b00020;
    font-size: 14px;
    margin-top: 4px;
}

/* Красивый file input */
.file-field {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Название файла */
.file-name {
    font-size: 14px;
    color: #333;
    opacity: 0.9;
    min-width: 220px;
}

/* прячем file input, который хотим заменить */
.file-input-hidden {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* Подсказка */
.form-help {
    font-size: 14px;
    color: #4f6f52;
    margin: 6px 0 10px;
    opacity: 0.9;
}

/* Кнопка с иконкой */
.btn-icon{
    width: 44px;
    padding: 8px 0;
    text-align: center;
}

/* Информация о странице */
.page-info{
    font-size: 14px;
    opacity: 0.9;
}

/* Опасная зона (edit travel) */
.danger-zone {
    margin-top: 48px;
    padding: 24px;
    border-radius: 12px;
    background: #fff6f6;
    border: 1px solid #f1c4c4;
}

/* Заголовок опасной зоны */
.danger-title {
    margin: 0 0 8px;
    color: #a31212;
    font-size: 18px;
}

/* Текст опасной зоны */
.danger-text {
    margin-bottom: 16px;
    color: #6f1a1a;
    font-size: 14px;
    line-height: 1.4;
}

/* Кнопка удаления путешествия */
.danger-zone a.btn-danger-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 6px 12px;          /* меньше и аккуратнее */
    font-size: 13px;            /* компактный текст */
    border-radius: 6px;

    border: 1px solid #d43c3c;
    color: #d43c3c;
    background: transparent;

    text-decoration: none !important;  /* ← ГЛАВНОЕ */
    font-weight: 500;

    transition: background 0.2s ease, color 0.2s ease;
}

.danger-zone a.btn-danger-outline:hover,
.danger-zone a.btn-danger-outline:focus,
.danger-zone a.btn-danger-outline:visited {
    text-decoration: none !important;
    background: #d43c3c;
    color: #fff;
}

.pagination a.filter-btn,
.pagination a.filter-btn:hover,
.pagination a.filter-btn:focus,
.pagination a.filter-btn:visited {
    text-decoration: none;
    text-decoration-line: none;
    border-bottom: none;
    box-shadow: none;
}

/* ==========================================================================
    TRAVEL: list, filters, cards
    Страницы: travel.html
========================================================================== */
/* Стили для главной страницы */
.travel-filters {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Стили для фильтров */
.travel-filters select,
.travel-filters button {
    padding: 5px 10px;
    font-size: 16px;
}

/* стили для фильтрации travel */
.filter-select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 15px;
    background: #fff;
}

.filter-select:focus {
    outline: none;
    border-color: #7fb6a6;
    box-shadow: 0 0 0 2px rgba(127, 182, 166, 0.3);
}

/* стили для подсказки travel */
.travel-hint {
    max-width: 900px;
    margin: 15px auto;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(127, 182, 166, 0.2);
    font-size: 15px;
}

/* Карточки путешествий */
.travel-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin: 30px;
}

/* Карточка путешествия */
.travel-card {
    display: block;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.travel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

/* Картинка путешествия */
.travel-card-image {
    aspect-ratio: 3 / 2;        /* ← КЛЮЧ */
    background: #eee;
    overflow: hidden;
}

.travel-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Тело путешествия */
.travel-card-body {
    padding: 12px 14px;
}

/* Заголовок путешествия */
.travel-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Метаданные путешествия */
.travel-card-meta {
    font-size: 12px;
    color: #666;
}

/* ==========================================================================
    TRAVEL: add / edit pages
    Страницы: travel_add.html, travel_edit.html
========================================================================== */
/* Контейнер кнопки "Назад" */
.travel-back {
    text-align: center;
    margin: 10px 0 20px;
}

/*  Обложка путешествия */
.cover-preview {
    width: 100%;
    max-width: 600px;
    height: 240px;
    object-fit: cover;
    border-radius: 14px;
    margin: 12px 0 20px;
    display: block;
}

/* Обложка путешествия (редактирование) */
.cover-preview--edit {
    width: 100%;
    max-height: 420px;
    object-fit: contain;   /* ключевая строка */
    background: var(--bg-light);   /* мягкий фон для пустых полей */
    border-radius: 12px;
}

/* Фотографии обложки */
.cover-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-bottom: 30px;
}

.cover-photo-item {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.cover-photo-item img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    display: block;
}

.cover-photo-item:hover {
    transform: scale(1.03);
}

.cover-photo-item.active {
    border-color: #4caf50;
}

/* ==========================================================================
    PHOTOS / ALBUM
    Страницы: travel_add_photos.html, photos.html
========================================================================== */
/* Стили для галереи */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);  /* 8 колонок равной ширины */
    gap: 10px;
    padding: 20px;
    width: 100%;          /* растягиваем на всю ширину */
    max-width: 100%;      /* убираем ограничение */
    margin: 0 auto;       /* центрируем, если будет меньше */
    box-sizing: border-box;
}

/* Стили для фотографий в галерее */
.gallery-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    object-fit: cover;
}

/* Стили для фотографий в галерее при наведении */
.gallery-item img:hover {
    transform: scale(1.05);
}

/* Стили для модального окна */
.photo-modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

/* Стили для изображения в модальном окне */
.photo-modal img.photo-full {
    max-width: 90%;
    max-height: 90%;
}

/* Стили для кнопки закрытия модального окна */
.photo-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 32px;
    cursor: pointer;
}

/* стили форм rotate */
.travel-photos-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

/* стили для карточки фотографии */
.travel-photo-card{
    background: rgba(255,255,255,0.35);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.travel-photo-img{
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
}

.travel-photo-meta{
    margin-top: 8px;
    font-size: 14px;
}

.travel-photo-actions{
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.travel-photo-actions form{
    margin: 0;
}

/* ==========================================================================
    CONFIRM & DESTRUCTIVE ACTIONS
    Страницы: travel_delete_confirm.html
========================================================================== */
/* стили для (Confirm delete travel) */
.confirm-delete {
    max-width: 520px;
    margin: 40px auto;
    padding: 32px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    text-align: center;
}

/* стили для заголовка */
.confirm-title {
    margin-bottom: 16px;
    color: #a31212;
}

/* стили для текста */
.confirm-text {
    font-size: 15px;
    margin-bottom: 12px;
}

/* стили для предупреждения */
.confirm-warning {
    font-size: 14px;
    color: #b00020;
    margin-bottom: 24px;
}

/* стили для кнопок */
.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* Кнопки */
.btn-danger {
    background: #d43c3c;
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-danger:hover {
    background: #b83232;
}

.btn-secondary {
    padding: 10px 22px;
    border-radius: 8px;
    background: #f3f3f3;
    color: #333;
    text-decoration: none;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e6e6e6;
}

/* ==========================================================================
    VIDEO: modal player
========================================================================== */

.inline-video-player {
    max-width: 960px;
    margin: 40px auto;
}

.inline-video-player.hidden {
    display: none;
}

.inline-video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    position: relative;
}

.inline-video-wrapper video {
    width: 100%;
    height: 100%;
    display: block;
}

.inline-video-info {
    margin-top: 12px;
}

.inline-video-title {
    font-size: 18px;
    font-weight: 600;
}

.inline-video-meta {
    font-size: 14px;
    opacity: 0.7;
}

.video-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.25);
    cursor: pointer;
    pointer-events: auto;
}

.video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.video-overlay-play {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 32px;
    cursor: pointer;
}

.video-card {
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.video-card.active {
    outline: 3px solid #4a90e2;
    border-radius: 14px;
}

.video-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.video-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.video-card:hover .video-preview img {
    transform: scale(1.05);
}

.video-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1e1e1e, #2b2b2b);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-placeholder-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.video-info {
    padding-top: 8px;
}

.video-title {
    font-weight: 600;
    font-size: 15px;
}

.video-meta {
    font-size: 13px;
    opacity: 0.7;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 500;
}

.video-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-card:hover .video-actions {
    opacity: 1;
}

.video-actions button,
.video-actions .video-delete-btn {
    background: rgba(0,0,0,0.6);
    border: none;
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.video-actions button:hover,
.video-actions .video-delete-btn:hover {
    background: rgba(0,0,0,0.85);
}

.photo-form {
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row label {
    font-size: 14px;
    opacity: 0.7;
}

.form-row input,
.form-row select,
.custom-file-label {
    width: 100%;
    max-width: 420px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: #fff;
}

.form-row input:focus {
    outline: none;
    border-color: #7ea37e;
}

.form-actions {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.btn-primary {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: #7ea37e;
    color: #fff;
    cursor: pointer;
}

.btn-primary:hover {
    opacity: 0.9;
}

.video-add-card {
display: block;
    max-width: 520px;
    margin: 30px auto;
    transition: all 0.3s ease;
}

.video-add-card.collapsed {
    display: none;
}

.custom-file-btn {
    display: flex;
    align-items: center;
    justify-content: center;   /* центр по горизонтали */
    text-align: center;
    padding: 8px 12px;
}

/* скрываем настоящий input */
.custom-file-btn input[type="file"] {
    display: none;
}

.file-name {
    font-size: 13px;
    opacity: 0.7;
}

/* стили для кнопки назад */
.video-back {
    margin-top: 16px;
    text-align: center;
}

.error-text {
    color: #e53935;
    font-size: 14px;
    margin-top: 5px;
}

.error-text ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ==========================================================================
    MODAL WINDOW photos (edit description)
========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.modal-buttons .filter-btn {
    min-width: 100px;
}

.modal-buttons .filter-btn--secondary {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.modal-buttons .filter-btn--secondary:hover {
    background-color: #e0e0e0;
}

/* Стили для кнопки карандаша в photo-actions */
.edit-description-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.edit-description-btn:hover {
    background: rgba(0,0,0,0.1);
}

/* Стили для кнопки редактирования названия альбома */
.edit-album-title-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
    color: #666;
}

.edit-album-title-btn:hover {
    background: rgba(0,0,0,0.1);
    color: #333;
}

/* Стиль для названия города на странице путешествия */
.travel-location-title {
    text-align: center;
    margin: 20px 0 10px;
    font-size: 1.8rem;
    color: #333;
}

/* Стили для модальных окон в photos */
.photos-edit-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.photos-edit-modal .modal-content {
    background-color: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ============================================
ЦЕНТРИРОВАНИЕ ОПИСАНИЯ ПУТЕШЕСТВИЯ (ВСЕ УСТРОЙСТВА)
============================================ */
.travel-description {
    text-align: center !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 10px;
}

.travel-description * {
    text-align: center !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
}

.travel-description p,
.travel-description div,
.travel-description span,
.travel-description h1,
.travel-description h2,
.travel-description h3,
.travel-description h4,
.travel-description h5,
.travel-description h6,
.travel-description ul,
.travel-description ol,
.travel-description li,
.travel-description blockquote {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.travel-location-title {
    text-align: center !important;
}