/* ============================================
   Основные стили для сайта Мой Риф
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #0a0f1e;
    color: #e2e8f0;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, #0b1a2e, #102a41);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border-left: 5px solid #00a8ff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.header::after {
    content: "🐠";
    font-size: 120px;
    position: absolute;
    bottom: -20px;
    right: 20px;
    opacity: 0.1;
    transform: rotate(5deg);
}

h1 {
    font-size: 3em;
    background: linear-gradient(135deg, #7dd3fc, #a5f3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
}

.stat-item {
    background: rgba(0, 168, 255, 0.1);
    border: 1px solid #1e3a5f;
    border-radius: 30px;
    padding: 8px 20px;
    backdrop-filter: blur(5px);
}

/* ===== СВОРАЧИВАЕМЫЕ РАЗДЕЛЫ ===== */
.collapsible {
    background: transparent;
    border: none;
    margin-bottom: 30px;
}

.collapsible-summary {
    list-style: none;
    cursor: pointer;
    font-size: 2em;
    margin: 40px 0 20px;
    padding-left: 15px;
    border-left: 5px solid #00a8ff;
    color: #7dd3fc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.collapsible-summary::-webkit-details-marker {
    display: none;
}

.collapsible-summary::after {
    content: '▼';
    font-size: 0.8em;
    color: #00a8ff;
    transition: transform 0.3s;
    margin-left: 15px;
}

details[open] .collapsible-summary::after {
    transform: rotate(180deg);
}

.collapsible-content {
    margin-top: 20px;
}

/* ===== ОБОРУДОВАНИЕ ===== */
.equipment-card {
    background: #111c2e;
    border: 1px solid #1f3a5f;
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s;
}

.equipment-card:hover {
    border-color: #00a8ff;
    box-shadow: 0 10px 20px rgba(0, 168, 255, 0.2);
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.equipment-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.equipment-label {
    color: #9ca3af;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.equipment-value {
    color: #7dd3fc;
    font-size: 1.2em;
    font-weight: 600;
}

.equipment-note {
    color: #9ae6b4;
    font-size: 0.85em;
}

/* ===== ДОБАВКИ ===== */
.additives-card {
    background: #111c2e;
    border: 1px solid #1f3a5f;
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s;
    margin-bottom: 30px;
}

.additives-card:hover {
    border-color: #00a8ff;
    box-shadow: 0 10px 20px rgba(0, 168, 255, 0.2);
}

.additives-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px dashed #1f3a5f;
}

.additives-item:last-child {
    border-bottom: none;
}

.additives-name {
    color: #7dd3fc;
    font-weight: 600;
    min-width: 150px;
}

.additives-desc {
    color: #9ae6b4;
}

/* ===== ОБИТАТЕЛИ ===== */
.inhabitants-card {
    background: #111c2e;
    border: 1px solid #1f3a5f;
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s;
}

.inhabitants-card:hover {
    border-color: #00a8ff;
    box-shadow: 0 10px 20px rgba(0, 168, 255, 0.2);
}

.inhabitants-group-title {
    color: #7dd3fc;
    font-size: 1.3em;
    margin: 20px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #1f3a5f;
}

.inhabitants-group-title:first-of-type {
    margin-top: 0;
}

.inhabitants-list {
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
}

.inhabitants-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px dashed #1f3a5f;
}

.inhabitants-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

/* Статусы */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

.status-badge.alive { background: #1f4a3a; color: #9ae6b4; }
.status-badge.dead { background: #4a2a2a; color: #fcb5b5; }
.status-badge.away { background: #4a3a4a; color: #d8b4fe; }
.status-badge.warning { background: #4a3a1a; color: #fbd38d; }

.price-badge {
    background: #2a4a6a;
    color: #7dd3fc;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.note-text {
    color: #9ca3af;
    font-size: 0.85em;
    font-style: italic;
}

/* ===== ГРАФИКИ И КАРТОЧКИ ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: #111c2e;
    border: 1px solid #1f3a5f;
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s;
}

.card:hover {
    border-color: #00a8ff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 168, 255, 0.2);
}

.card-title {
    color: #7dd3fc;
    font-size: 1.3em;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1f3a5f;
}

/* ===== ТАБЛИЦЫ ===== */
.table-container {
    overflow-x: auto;
    margin: 20px 0 30px;
    background: #111c2e;
    border-radius: 15px;
    border: 1px solid #1f3a5f;
    padding: 5px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th {
    background: #1f3a5f;
    color: #e2e8f0;
    padding: 15px 10px;
    font-weight: 600;
    white-space: nowrap;
}

td {
    padding: 10px;
    border-bottom: 1px solid #1f3a5f;
    text-align: center;
}

tr:hover {
    background: #1a2a3f;
}

/* Цвета параметров */
.param-good { color: #68d391; font-weight: bold; }
.param-high { color: #fbbf24; font-weight: bold; }
.param-low { color: #f87171; font-weight: bold; }

/* ===== ХРОНОЛОГИЯ ===== */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-item {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: #0f1a2c;
    border-radius: 10px;
    border-left: 3px solid #00a8ff;
    flex-wrap: wrap;
}

.timeline-date {
    min-width: 100px;
    color: #7dd3fc;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-time {
    font-size: 0.8em;
    color: #9ca3af;
    font-weight: normal;
}

.timeline-event {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.timeline-icon {
    font-size: 1.1em;
}

/* ===== ЛАЙТБОКС ===== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.92);
    backdrop-filter: blur(5px);
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: calc(100% - 120px);
    max-height: 85vh;
}

.lightbox-content {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 10px;
    border: 2px solid #00a8ff;
    box-shadow: 0 0 30px rgba(0,168,255,0.5);
    transition: opacity 0.15s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 1001;
    line-height: 1;
    background: none;
    border: none;
}

.lightbox-close:hover {
    color: #00a8ff;
    transform: scale(1.1);
}

/* Стрелки навигации */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,168,255,0.15);
    border: 1px solid rgba(0,168,255,0.3);
    color: #fff;
    font-size: 28px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0,168,255,0.4);
    border-color: #00a8ff;
    transform: translateY(-50%) scale(1.1);
}

/* Счётчик фото */
.lightbox-counter {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    color: #9ca3af;
    font-size: 0.95em;
    background: rgba(0,0,0,0.5);
    padding: 4px 14px;
    border-radius: 20px;
}

.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 1.1em;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    padding: 30px 60px 20px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .lightbox-prev { left: 8px; width: 40px; height: 40px; font-size: 20px; }
    .lightbox-next { right: 8px; width: 40px; height: 40px; font-size: 20px; }
    .lightbox-inner { max-width: calc(100% - 80px); }
    .lightbox-caption { font-size: 0.9em; padding: 20px 40px 15px; }
}

/* ===== ГАЛЕРЕЯ: ВИДЕО-ПРЕВЬЮ ===== */
.gallery-thumb-wrap {
    position: relative;
    line-height: 0;
    border-radius: 10px;
    overflow: hidden;
}

.gallery-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    background: rgba(0, 168, 255, 0.75);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    pointer-events: none;
    transition: background 0.2s;
}

.gallery-thumb-wrap:hover .gallery-play-icon {
    background: rgba(0, 168, 255, 1);
}

.gallery-video-badge {
    display: inline-block;
    background: #1f3a5f;
    color: #7dd3fc;
    font-size: 0.8em;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Видео в лайтбоксе */
#lightbox-video {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 10px;
    border: 2px solid #00a8ff;
    box-shadow: 0 0 30px rgba(0,168,255,0.5);
    background: #000;
    transition: opacity 0.15s ease;
}

/* ===== ФУТЕР ===== */
.footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px;
    border-top: 1px solid #1f3a5f;
    color: #718096;
}

/* ===== КНОПКА ДЛЯ ГРАФИКОВ ===== */
.chart-btn {
    background: #00a8ff;
    color: #0a0f1e;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
}

.chart-btn:hover {
    background: #7dd3fc;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 168, 255, 0.3);
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .stats {
        gap: 10px;
    }
    
    .stat-item {
        padding: 5px 12px;
        font-size: 0.9em;
    }
    
    .collapsible-summary {
        font-size: 1.5em;
        margin: 30px 0 15px;
    }
    
    .equipment-grid {
        grid-template-columns: 1fr;
    }
    
    .additives-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .additives-name {
        min-width: auto;
    }
    
    .inhabitants-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .inhabitants-item-right {
        align-items: flex-start;
    }
    
    .timeline-item {
        flex-direction: column;
        gap: 8px;
    }
    
    .timeline-date {
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
}