/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: url('images/fon.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    padding: 10px;
    position: relative;
}

/* Добавляем полупрозрачный слой поверх фона */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 0;
}

/* Все содержимое выше затемняющего слоя */
.header, .cards-container, .scroll-top, .modal, .social-links, .counter-container {
    position: relative;
    z-index: 1;
}

/* Контейнер для социальных ссылок */
.social-links {
    position: fixed;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1001;
}

/* Общие стили для всех социальных ссылок */
.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    padding: 8px 15px 8px 10px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    width: fit-content;
    border-width: 2px;
}

.social-link:hover {
    transform: translateY(-2px);
    background: rgba(0, 0, 0, 0.8);
}

.social-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-width: 2px;
}

.social-link:hover .social-icon {
    transform: rotate(360deg);
}

.social-text {
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

/* Специфичные стили для Telegram */
.telegram-link {
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.telegram-link:hover {
    border-color: gold;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.telegram-link .social-icon {
    border: 2px solid gold;
}

/* Специфичные стили для VK */
.vk-link {
    border: 2px solid rgba(0, 100, 255, 0.3);
}

.vk-link:hover {
    border-color: #4a76a8;
    box-shadow: 0 6px 20px rgba(74, 118, 168, 0.3);
}

.vk-link .social-icon {
    border: 2px solid #4a76a8;
}

/* Контейнер для счетчика */
.counter-container {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1001;
}

/* Стили счетчика */
.counter {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    padding: 8px 15px;
    border-radius: 50px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.counter:hover {
    transform: translateY(-2px);
    border-color: gold;
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.counter-label {
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.counter-number {
    color: gold;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    min-width: 40px;
    text-align: center;
}

/* Шапка */
.header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    margin-top: 100px;
}

.page-title {
    color: white;
    font-size: 2em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: titleGlow 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
    50% { text-shadow: 0 0 20px rgba(255,215,0,0.5); }
}

/* Стили для иконки в заголовке */
.title-icon {
    width: 50px;
    height: 50px;
    vertical-align: middle;
    margin-right: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    border: 2px solid rgba(255, 215, 0, 0.5);
    transition: transform 0.3s ease;
}

.title-icon:hover {
    transform: rotate(5deg) scale(1.1);
    border-color: gold;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
}

/* Сетка карточек */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Стили карточки */
.card {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    background: white;
    position: relative;
    aspect-ratio: 2/3;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1));
    pointer-events: none;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 30px rgba(0,0,0,0.4);
}

.card:active {
    transform: translateY(-5px) scale(1.01);
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s;
}

.card:hover img {
    transform: scale(1.1);
}

/* Номер карты */
.card-number {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: gold;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    animation: fadeIn 0.3s;
    backdrop-filter: blur(5px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 3% auto;
    padding: 30px;
    width: 90%;
    max-width: 900px;
    border-radius: 30px;
    position: relative;
    animation: slideIn 0.4s;
    border: 3px solid rgba(255, 215, 0, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateY(-100px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 25px;
    top: 15px;
    font-size: 40px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.close:hover {
    color: gold;
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    display: flex;
    gap: 30px;
    align-items: center;
}

.modal-image {
    width: 300px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 30px rgba(0,0,0,0.3);
    border: 4px solid gold;
}

.modal-text {
    flex: 1;
    color: white;
}

#modalTitle {
    font-size: 32px;
    margin-bottom: 20px;
    color: gold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

#modalDescription {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.modal-footer {
    text-align: right;
}

.modal-close-btn {
    background: gold;
    color: #333;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.modal-close-btn:hover {
    background: #ffd700;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255,215,0,0.4);
}

/* Кнопка "Наверх" */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: gold;
    color: #333;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: none;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 99;
}

.scroll-top:hover {
    background: #ffd700;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255,215,0,0.4);
}

.scroll-top.show {
    display: flex;
}

/* Индикатор загрузки */
.loading {
    text-align: center;
    color: white;
    font-size: 20px;
    padding: 50px;
    grid-column: 1 / -1;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 3px solid white;
    border-top-color: gold;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== МОБИЛЬНЫЕ НАСТРОЙКИ ========== */

/* Планшеты (горизонтальная ориентация) */
@media (max-width: 1024px) {
    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding: 15px;
    }
}

/* Планшеты (вертикальная ориентация) и большие телефоны */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    
    .header {
        padding: 12px;
        margin-bottom: 15px;
        margin-top: 90px;
    }
    
    .page-title {
        font-size: 1.8em;
    }
    
    .title-icon {
        width: 40px;
        height: 40px;
        margin-right: 10px;
        border-radius: 12px;
    }
    
    .social-links {
        top: 10px;
        left: 10px;
        gap: 8px;
    }
    
    .social-link {
        padding: 8px 12px 8px 8px;
    }
    
    .social-icon {
        width: 25px;
        height: 25px;
    }
    
    .social-text {
        font-size: 12px;
    }
    
    .counter-container {
        top: 10px;
        right: 10px;
    }
    
    .counter {
        padding: 6px 12px;
    }
    
    .counter-label {
        font-size: 12px;
    }
    
    .counter-number {
        font-size: 16px;
        min-width: 35px;
    }
    
    .cards-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .card-number {
        top: 5px;
        right: 5px;
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .modal-body {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-image {
        width: 200px;
    }
    
    #modalTitle {
        font-size: 24px;
    }
    
    #modalDescription {
        font-size: 16px;
    }
    
    .close {
        right: 15px;
        top: 10px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
}

/* Маленькие телефоны */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .header {
        padding: 10px;
        margin-bottom: 10px;
        margin-top: 90px;
    }
    
    .page-title {
        font-size: 1.5em;
    }
    
    .title-icon {
        width: 35px;
        height: 35px;
        margin-right: 8px;
        border-radius: 10px;
        border-width: 1.5px;
    }
    
    .subtitle {
        font-size: 0.9em;
    }
    
    .social-links {
        top: 8px;
        left: 8px;
        gap: 6px;
    }
    
    .social-link {
        padding: 6px 10px 6px 6px;
    }
    
    .social-icon {
        width: 22px;
        height: 22px;
    }
    
    .social-text {
        font-size: 11px;
    }
    
    .counter-container {
        top: 8px;
        right: 8px;
    }
    
    .counter {
        padding: 5px 10px;
        border-width: 1.5px;
    }
    
    .counter-label {
        font-size: 11px;
    }
    
    .counter-number {
        font-size: 14px;
        min-width: 30px;
    }
    
    .cards-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
        padding: 5px;
    }
    
    .card {
        border-radius: 8px;
    }
    
    .card-number {
        top: 3px;
        right: 3px;
        padding: 2px 5px;
        font-size: 8px;
        border-radius: 10px;
    }
    
    .scroll-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Очень маленькие телефоны */
@media (max-width: 360px) {
    .cards-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    
    .card-number {
        font-size: 7px;
        padding: 1px 4px;
    }
    
    .title-icon {
        width: 30px;
        height: 30px;
        margin-right: 5px;
        border-radius: 8px;
    }
    
    .social-link {
        padding: 5px 8px 5px 5px;
    }
    
    .social-icon {
        width: 20px;
        height: 20px;
    }
    
    .social-text {
        font-size: 10px;
    }
    
    .counter-container {
        top: 5px;
        right: 5px;
    }
    
    .counter {
        padding: 4px 8px;
    }
    
    .counter-label {
        font-size: 10px;
    }
    
    .counter-number {
        font-size: 12px;
        min-width: 25px;
    }
}

/* Альбомная ориентация на телефонах */
@media (max-height: 480px) and (orientation: landscape) {
    .cards-container {
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
    }
    
    .header {
        margin-top: 70px;
    }
    
    .modal-content {
        margin: 1% auto;
        padding: 15px;
    }
    
    .modal-body {
        flex-direction: row;
    }
    
    .modal-image {
        width: 150px;
    }
    
    .social-links {
        top: 5px;
        left: 5px;
        gap: 5px;
    }
    
    .social-link {
        padding: 5px 10px 5px 5px;
    }
    
    .counter-container {
        top: 5px;
        right: 5px;
    }
    
    .counter {
        padding: 4px 10px;
    }
}
