* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Header Styles */
header {
    background: #003366;
    color: white;
    padding: 0;
}

nav {
    padding: 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

/* Logo Container */
.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.club-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin: 0;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #ffd700;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffd700;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: #003366;
        flex-direction: column;
        gap: 0;
        transition: left 0.3s ease;
        z-index: 1000;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem;
        font-size: 1.1rem;
    }
    
    .club-name {
        font-size: 1.2rem;
    }
    
    .logo {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .logo-container {
        gap: 0.5rem;
    }
    
    .club-name {
        font-size: 1rem;
    }
    
    .logo {
        width: 40px;
        height: 40px;
    }
}

/* Остальные стили остаются без изменений */
.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('/static/images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.news-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}



/* Стили для игроков */
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.player-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.player-card:hover {
    transform: none;
    box-shadow: 0 8px 20px rgba(0,51,102,0.3);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.player-card:hover .player-info h3 {
    color: #ff6b35;
}

.player-card:hover .btn {
    background: #ff6b35;
}

.player-photo img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #003366;
}

.player-info h3 {
    color: #003366;
    margin: 1rem 0 0.5rem 0;
}

.player-position {
    color: #666;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.btn {
    display: inline-block;
    background: #003366;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

footer {
    background: #003366;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-info {
    flex: 1;
    min-width: 300px;
}

.footer-info p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-link.telegram:hover {
    background: #0088cc;
    color: white;
}

.social-link.vk:hover {
    background: #0077ff;
    color: white;
}

.social-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Адаптивность для футера */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-info {
        min-width: auto;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .social-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .social-link svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .footer-content {
        padding: 0 1rem;
    }
    
    .social-links {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .social-link {
        width: 100%;
        justify-content: center;
        padding: 0.8rem;
    }
}

/* Стили для новостей */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.news-article {
    display: flex;
    gap: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.news-image img {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
}

.news-date {
    color: #666;
    font-size: 0.9rem;
}

/* Стили для таблицы архивов */
.games-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #003366;
    color: white;
}

tr:hover {
    background: #f8f9fa;
}

/* Центрирование основных секций */
.hero-content,
.latest-news,
.next-games,
.players-grid,
.player-detail,
.news-list,
.games-table {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Центрирование заголовков секций */
.latest-news h2,
.next-games h2,
.players-grid h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #003366;
    font-size: 2.5rem;
}

/* Центрирование карточек новостей */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem auto;
    justify-content: center;
}

.news-card {
    background: #f4f4f4;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.news-card h3 {
    color: #003366;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.news-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: block;
}

.news-card p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.news-card a {
    display: inline-block;
    background: #003366;
    color: white;
    padding: 0.7rem 1.5rem;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.news-card a:hover {
    background: #002244;
}

/* Центрирование списка игр */
.next-games {
    text-align: center;
}

.games-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.game-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #003366;
}

.game-date {
    font-weight: bold;
    color: #003366;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.game-opponent {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.game-tournament {
    color: #666;
    font-style: italic;
}

/* Центрирование карточек игроков */
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem auto;
    justify-content: center;
}

.player-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
    margin: 0 auto;
    max-width: 350px;
}

/* Центрирование детальной страницы игрока */
.player-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.player-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.player-header img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid #003366;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.player-main-info {
    text-align: center;
}

.player-main-info h1 {
    color: #003366;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.position {
    font-size: 1.3rem;
    color: #666;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.age {
    color: #666;
    font-size: 1.1rem;
}

.player-biography {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    line-height: 1.8;
}

.player-biography h2 {
    color: #003366;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

/* Центрирование списка новостей */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.news-article {
    display: flex;
    flex-direction: column;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.news-image {
    margin-bottom: 1.5rem;
}

.news-image img {
    width: 100%;
    max-width: 400px;
    height: auto;
border-radius: 8px;
    margin: 0 auto;
}

.news-content {
    text-align: center;
}

.news-content h2 {
    color: #003366;
    margin-bottom: 1rem;
}

/* Центрирование таблицы архивов */
.games-table {
    overflow-x: auto;
    margin: 2rem auto;
    max-width: 1000px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 0 auto;
}

th, td {
    padding: 1.2rem;
    text-align: center;
    border-bottom: 1px solid #eee;
}

th {
    background: #003366;
    color: white;
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .latest-news h2,
    .next-games h2,
    .players-grid h2 {
        font-size: 2rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .players-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .player-header {
        flex-direction: column;
        text-align: center;
    }
    
    .player-header img {
        width: 200px;
        height: 200px;
    }
    
    .news-article {
        flex-direction: column;
        text-align: center;
    }
    
    .news-image img {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .hero-content,
    .latest-news,
    .next-games,
    .players-grid,
    .player-detail,
    .news-list,
    .games-table {
        padding: 0 1rem;
    }
    
    .news-card,
    .game-card,
    .player-card {
        padding: 1.5rem;
    }
    
    .player-main-info h1 {
        font-size: 2rem;
    }
    
    .player-biography {
        padding: 1.5rem;
    }
}

/* Стили для страницы "О клубе" */
.about-hero {
    background: linear-gradient(rgba(0, 51, 102, 0.8), rgba(0, 51, 102, 0.9)),
                url('/static/images/about/hero-bg.jpg') center/cover;
    padding: 4rem 0;
    text-align: center;
    color: white;
}

.about-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.about-content {
    padding: 4rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.about-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
}

.about-section.reverse {
    direction: rtl;
}

.about-section.reverse > * {
    direction: ltr;
}

.about-text h2 {
    color: #003366;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #333;
}

.about-image {
    position: relative;
}

.about-image img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.about-image img:hover {
    transform: scale(1.02);
}

/* Список достижений */
.achievements-list {
    list-style: none;
    padding: 0;
}

.achievements-list li {
    padding: 0.8rem 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
    color: #333;
}

.achievements-list li:last-child {
    border-bottom: none;
}

/* Статистика тренеров */
.coach-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #003366;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* Информация о стадионе */
.arena-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
}

.arena-info p {
    margin: 0.5rem 0;
    color: #333;
}

/* Философия */
.philosophy-section {
    text-align: center;
    margin-top: 4rem;
    padding: 3rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
}

.philosophy-section h2 {
    color: #003366;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.philosophy-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.philosophy-card:hover {
    transform: translateY(-5px);
}

.philosophy-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.philosophy-card h3 {
    color: #003366;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.philosophy-card p {
    color: #666;
    line-height: 1.6;
}

/* Адаптивность */
@media (max-width: 968px) {
    .about-section {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .about-section.reverse {
        direction: ltr;
    }
    
    .about-hero h1 {
        font-size: 2.5rem;
    }
    
    .coach-stats {
        grid-template-columns: 1fr;
    }
    
    .philosophy-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .about-hero {
        padding: 3rem 0;
    }
    
    .about-hero h1 {
        font-size: 2rem;
    }
    
    .about-text h2 {
        font-size: 1.8rem;
    }
    
    .about-content {
        padding: 2rem 0;
    }
}

/* ---------------- Gallery page styles ---------------- */
.media-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

.gallery-hero {
    background: linear-gradient(rgba(0, 51, 102, 0.85), rgba(0, 51, 102, 0.85)),
                url('/static/images/gallery/hero.jpg') center/cover no-repeat;
    color: #fff;
    padding: 3rem 0;
    text-align: center;
}

.gallery-content .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0 0;
}

/* Улучшенные стили для элементов галереи */
.gallery-item {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-item-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gallery-description {
    flex-grow: 1;
    margin-bottom: 0.5rem;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* Для изображений - автоматическая высота */
.image-container {
    width: 100%;
    background: #f2f4f7;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 300px;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    object-fit: cover;
}

.gallery-item:hover .image-container img {
    transform: scale(1.03);
}

/* Для видео - центрирование и адаптивное соотношение */
.video-container {
    position: relative;
    width: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.video-container iframe,
.video-container video {
    width: 100%;
    height: 100%;
    border: 0;
    position: absolute;
    top: 0;
    left: 0;
}

/* Адаптивное соотношение для видео */
.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 соотношение */
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.image-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.0);
    color: #fff;
    transition: background 0.2s ease;
}

.gallery-item:hover .image-overlay {
    background: rgba(0,0,0,0.15);
}

.zoom-icon {
    font-size: 1.25rem;
    opacity: 0.9;
}

.gallery-item-info {
    padding: 0.9rem 1rem 1rem;
}

.gallery-item-info h3 {
    font-size: 1.05rem;
    color: #003366;
    margin: 0 0 0.4rem 0;
}

.gallery-description {
    font-size: 0.95rem;
    color: #555;
    min-height: 2.4em;
}

.gallery-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.6rem;
}

.category-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #003366;
}

.gallery-date {
    font-size: 0.8rem;
    color: #666;
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
}

.filter-btn {
    border: 1px solid #003366;
    background: #fff;
    color: #003366;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn.active, .filter-btn:hover {
    background: #003366;
    color: #fff;
}

/* Улучшенное модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.95);
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    display: block;
    margin: 0 auto;
    max-width: 90%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .gallery-content .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .image-container {
        min-height: 150px;
        max-height: 200px;
    }
    
    .video-container {
        min-height: 150px;
    }
    
    .close {
        top: 15px;
        right: 25px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .gallery-content .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        max-width: 95%;
    }
}

/* ---------------- Forms and admin consistency ---------------- */
.section {
    padding: 2rem 0;
}

form .input, form .textarea, input[type="text"], input[type="file"], textarea, select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    background: #fff;
    color: #1f2328;
}

form .textarea, textarea {
    min-height: 140px;
    resize: vertical;
}

form .btn, form button.btn, form button[type="submit"] {
    border: none;
    cursor: pointer;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Event detail page grid reuse */
.event-detail .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .gallery-content .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .gallery-content .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Recent Photos grid spacing */
.gallery-content h2 {
    color: #003366;
    margin-top: 1rem;
}

/* Carousel controls mobile tweak */
@media (max-width: 576px) {
    #prevBtn, #nextBtn {
        padding: 0.3rem 0.5rem;
    }
}

#carousel {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    height: 600px;
    background: #000;
    margin: 2rem 0;
}

#carouselTrack {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
    width: 100%;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заполняем весь контейнер */
}

/* Для вертикальных изображений - центрируем по горизонтали */
.carousel-slide.vertical-image img {
    width: auto;
    height: 100%;
    margin: 0 auto;
}

/* Для горизонтальных изображений - центрируем по вертикали */
.carousel-slide.horizontal-image img {
    width: 100%;
    height: auto;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

#prevBtn, #nextBtn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#prevBtn:hover, #nextBtn:hover {
    background: rgba(0, 0, 0, 0.9);
}

#prevBtn {
    left: 20px;
}

#nextBtn {
    right: 20px;
}

.carousel-progress {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: white;
    transform: scale(1.2);
}

/* Адаптивность */
@media (max-width: 1024px) {
    #carousel {
        height: 500px;
    }
    
    #prevBtn, #nextBtn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    #prevBtn {
        left: 15px;
    }
    
    #nextBtn {
        right: 15px;
    }
}

@media (max-width: 768px) {
    #carousel {
        height: 400px;
    }
    
    #prevBtn, #nextBtn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    #prevBtn {
        left: 15px;
    }
    
    #nextBtn {
        right: 15px;
    }
}

@media (max-width: 600px) {
    #carousel {
        height: 350px;
    }
    
    #prevBtn, #nextBtn {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }
    
    #prevBtn {
        left: 12px;
    }
    
    #nextBtn {
        right: 12px;
    }
}

@media (max-width: 480px) {
    #carousel {
        height: 300px;
    }
    
    #prevBtn, #nextBtn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    #prevBtn {
        left: 10px;
    }
    
    #nextBtn {
        right: 10px;
    }
}

@media (max-width: 360px) {
    #carousel {
        height: 250px;
    }
    
    #prevBtn, #nextBtn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    #prevBtn {
        left: 8px;
    }
    
    #nextBtn {
        right: 8px;
    }
}