/**
 * Ферратный дневник — стили фронтенда
 */

/* === Обёртка === */
.fc-lb-wrap {
    width: 100%;
    max-width: 1170px;
    margin: 0 auto;
    padding-left: 3px;
    padding-right: 3px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1d2327;
}

/* Neve: колонка контента на полную ширину внутри контейнера темы */
body.fc-logbook-page .neve-main > .container > .row > [class*="col"],
body.fc-logbook-page .nv-single-page-wrap,
body.fc-logbook-page .nv-single-page-wrap.col,
body.fc-logbook-page .nv-index-posts.col,
body.fc-logbook-page .nv-content-wrap {
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

.fc-lb-notice {
    padding: 20px;
    background: #fef8e7;
    border: 1px solid #f0c36d;
    border-radius: 6px;
    text-align: center;
    font-size: 15px;
}

/* === Тулбар === */
.fc-lb-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* === Профиль === */
.fc-lb-profile-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.fc-lb-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.fc-lb-profile-info {
    flex: 1;
    min-width: 0;
}

.fc-lb-profile-name {
    margin: 0 0 4px;
    font-size: 22px;
    line-height: 1.2;
}

.fc-lb-profile-rank {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.fc-lb-profile-bio {
    margin: 6px 0;
    font-size: 14px;
    color: #444;
    line-height: 1.5;
}

.fc-lb-profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.fc-lb-profile-link {
    color: #2271b1;
    text-decoration: none;
    font-size: 13px;
}

.fc-lb-profile-link:hover {
    text-decoration: underline;
}

.fc-lb-profile-field {
    font-size: 13px;
    color: #444;
}

/* Звание в карточке участника клуба */
.fc-lb-member-rank {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.fc-lb-hidden-toggle {
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.fc-lb-public-link {
    font-size: 12px;
    color: #888;
}

.fc-lb-public-link a {
    color: #2271b1;
}

/* === Кнопки === */
.fc-lb-btn {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all .15s;
}

.fc-lb-btn:hover {
    border-color: #999;
    background: #f6f7f7;
}

.fc-lb-btn-primary {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.fc-lb-btn-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.fc-lb-btn-danger {
    color: #d63638;
    border-color: #d63638;
}

.fc-lb-btn-danger:hover {
    background: #d63638;
    color: #fff;
}

.fc-lb-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* === Вкладки === */
.fc-lb-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.fc-lb-tab {
    padding: 10px 24px;
    border: none !important;
    background: transparent !important;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666 !important;
    border-bottom: 2px solid transparent !important;
    margin-bottom: -2px;
    transition: all .15s;
    border-radius: 0 !important;
}

.fc-lb-tab:hover {
    color: #333 !important;
    background: #f6f7f7 !important;
}

.fc-lb-tab.active {
    color: #2271b1 !important;
    background: transparent !important;
    border-bottom: 2px solid #2271b1 !important;
}

/* === Панели === */
.fc-lb-panel {
    display: none;
}

.fc-lb-panel.active {
    display: block;
}

.fc-lb-loading {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 14px;
}

/* === Таблица дневника === */
.fc-lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fc-lb-table th {
    background: #f6f7f7;
    text-align: left;
    padding: 8px 10px;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    color: #50575e;
    letter-spacing: .03em;
}

.fc-lb-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.fc-lb-table tr:hover td {
    background: #f9f9fb;
}

.fc-lb-diff-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
}

.fc-lb-insta-link {
    color: #c13584;
    text-decoration: none;
}

.fc-lb-insta-link:hover {
    text-decoration: underline;
}

/* Мобильная подстрока — на десктопе скрыта */
.fc-lb-row-mobile,
.fc-lb-row-comment {
    display: none;
}

/* Десктоп-комментарий — на десктопе виден */
.fc-lb-row-desktop-comment .fc-lb-comment-cell {
    padding: 2px 8px 8px !important;
    font-size: 13px;
    color: #50575e;
    border-top: none !important;
}

.fc-lb-mobile-cell {
    padding: 4px 8px 6px !important;
    font-size: 12px;
    color: #555;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.fc-lb-mobile-cell > span {
    display: inline;
}

.fc-lb-mobile-right {
    float: right;
}

.fc-lb-comment-cell {
    padding: 6px 8px !important;
    font-size: 13px;
    font-style: italic;
    color: #555;
    background: #f5f5f0;
    border-bottom: 1px solid #ddd;
}

.fc-lb-expand-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 0 6px;
    font-size: 11px;
    cursor: pointer;
    color: #666;
    vertical-align: middle;
    line-height: 1.4;
}

.fc-lb-expand-btn:hover {
    background: #eee;
}

.fc-lb-comment-text {
    font-style: italic;
    color: #666;
}

/* Inline-редактирование */
.fc-lb-editable {
    cursor: pointer;
    border-bottom: 1px dashed #ccc;
}

.fc-lb-editable:hover {
    background: #fffde7;
}

.fc-lb-inline-input {
    width: 100%;
    padding: 3px 5px;
    font-size: 13px;
    border: 1px solid #2271b1;
    border-radius: 3px;
    outline: none;
}

/* === Статистика === */
.fc-lb-stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.fc-lb-stat-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.fc-lb-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #2271b1;
    line-height: 1.2;
}

.fc-lb-stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Бейджи */
.fc-lb-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.fc-lb-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
}

.fc-lb-badge-icon {
    font-size: 18px;
}

.fc-lb-section-title {
    font-size: 15px;
    margin: 0 0 10px;
    color: #333;
}

/* Любимые ферраты */
.fc-lb-favorites {
    margin-bottom: 24px;
}

.fc-lb-favorites h4 {
    margin: 0 0 10px;
    font-size: 15px;
}

.fc-lb-fav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fc-lb-fav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.fc-lb-fav-count {
    margin-left: auto;
    font-weight: 700;
    color: #e67e22;
    font-size: 15px;
}

/* Графики */
.fc-lb-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.fc-lb-chart-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
}

.fc-lb-chart-box h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: #333;
}

.fc-lb-chart-box canvas {
    max-height: 280px;
}

.fc-lb-chart-full {
    grid-column: 1 / -1;
}

/* === Карта дневника === */
#fc-lb-map-container {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    width: 100% !important;
    min-height: 500px;
}

#fc-lb-map {
    width: 100%;
}

/* === Модалка === */
.fc-lb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fc-lb-modal-inner {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.fc-lb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.fc-lb-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.fc-lb-modal-close {
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.fc-lb-modal-body {
    padding: 20px;
}

.fc-lb-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Поля формы */
.fc-lb-field {
    margin-bottom: 16px;
}

.fc-lb-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.fc-lb-optional {
    font-weight: normal;
    color: #888;
}

.fc-lb-field input[type="text"],
.fc-lb-field input[type="url"],
.fc-lb-field input[type="date"],
.fc-lb-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.fc-lb-field input:focus,
.fc-lb-field textarea:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Autocomplete dropdown */
.fc-lb-dropdown {
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0 0 4px 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 10;
    width: calc(100% - 2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    display: none;
}

.fc-lb-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.fc-lb-dropdown-item:hover {
    background: #f0f7ff;
}

.fc-lb-dropdown-item small {
    color: #888;
}

.fc-lb-field {
    position: relative;
}

/* Выбранная феррата */
.fc-lb-selected {
    background: #f0f7ff;
    border: 1px solid #2271b1;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fc-lb-selected-remove {
    cursor: pointer;
    color: #d63638;
    font-weight: 700;
    padding: 0 4px;
}

/* === Страница клуба === */
.fc-lb-club {
    max-width: 1170px;
    margin: 0 auto;
}

.fc-lb-members-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 960px) {
    .fc-lb-members-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .fc-lb-members-grid {
        grid-template-columns: 1fr;
    }
}

.fc-lb-member-card {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s, border-color .15s;
}

.fc-lb-member-card:hover {
    border-color: #2271b1;
    box-shadow: 0 4px 12px rgba(34,113,177,.15);
}

.fc-lb-member-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.fc-lb-member-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fc-lb-member-info strong {
    font-size: 15px;
}

.fc-lb-member-count {
    font-size: 13px;
    color: #666;
}

.fc-lb-member-diff {
    font-size: 12px;
    color: #888;
}

.fc-lb-member-badges {
    display: flex;
    gap: 4px;
    font-size: 16px;
    margin-top: 2px;
}

/* === Адаптив === */
@media (max-width: 768px) {
    .fc-lb-charts {
        grid-template-columns: 1fr;
    }

    .fc-lb-stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .fc-lb-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Компактная таблица без скролла */
    .fc-lb-table {
        font-size: 12px;
    }

    .fc-lb-table th,
    .fc-lb-table td {
        padding: 5px 4px;
    }

    /* На мобиле: скрываем №, Высоту, Дату, Действия из основной строки */
    .fc-lb-table th:nth-child(1),
    .fc-lb-row-main > td:nth-child(1),
    .fc-lb-table th:nth-child(5),
    .fc-lb-row-main > td:nth-child(5),
    .fc-lb-table th:nth-child(6),
    .fc-lb-row-main > td:nth-child(6),
    .fc-lb-table th:nth-child(7),
    .fc-lb-row-main > td:nth-child(7) {
        display: none;
    }

    /* Показываем мобильную подстроку, скрываем десктоп-комментарий */
    .fc-lb-row-mobile {
        display: table-row !important;
    }

    .fc-lb-row-desktop-comment {
        display: none !important;
    }

    /* Комментарий тоже может быть показан */
    .fc-lb-row-comment td {
        display: table-cell !important;
    }

    .fc-lb-tabs {
        overflow-x: auto;
    }

    .fc-lb-tab {
        padding: 8px 16px !important;
        font-size: 14px;
        white-space: nowrap;
    }

    /* Профиль компактнее */
    .fc-lb-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 14px;
    }

    .fc-lb-profile-links {
        justify-content: center;
    }

    #fc-lb-map-container {
        min-height: 350px;
    }
}
