@import "./global.css";

:root {
    --bg-color: #0a1020;
    --surface-color: #16213a;
    --surface-elevated: #1e2944;
    --border-color: #ffffff;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --accent-color: #ffffff;
    --text-primary: #f1f5fa;
    --text-secondary: #d8d8d8;
    --text-muted: #6b7fa7;
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
    --radius: 0.8rem;

    --image-background-color: rgb(45, 61, 87);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(180deg, #1a237e 0%, #0a1020 100%);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    min-width: 350px;
}

/* ========================================= */
/* ============== HEADER =================== */
/* ========================================= */

header {
    background-color: var(--surface-color);
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 0.5rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 50;
    height: auto;
    transition: padding-top 0.3s ease;
}

body.tg-fullscreen header {
    padding-top: 25px;
}

.header-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.header-icon-main {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

/* ========================================= */
/* ============== MAIN Layout ============== */
/* ========================================= */

main {
    display: flex;
    flex-direction: column; /* Выстраиваем блоки друг под другом */
    align-items: center;    /* Центрируем их */
    justify-content: flex-start;
    padding: 1rem;
    padding-top: 100px;
    padding-bottom: 40px;
    width: 100%;
}

.main-container {
    width: 100%;
    max-width: 950px;
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 1rem;
    margin-top: 0;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ========================================= */
/* ========= HERO SECTION ================== */
/* ========================================= */

.hero-section {
    position: relative;
    padding: 0 1rem 1rem 1rem;
    text-align: center;
    margin-bottom: 0;
    z-index: 10;
}

.top-carousel-container {
    width: 100%;
    max-width: 950px;
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 5px 1rem; /* Небольшой отступ внутри */
    margin-bottom: 1rem; /* Отступ до главного контейнера */
    position: relative;
    overflow: hidden;
    z-index: 10;
}

/* --- CAROUSEL STYLES --- */
.hero-carousel-wrapper {
    position: relative;
    width: 100%;
    height: 70px;
    overflow: hidden;
    margin-bottom: 0; /* Убрали старый отступ */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    opacity: 1;
    transition: opacity 0.5s ease;
}

.hero-carousel-wrapper.hidden {
    visibility: hidden;
    opacity: 0;
}

.hero-carousel-track {
    display: flex;
    align-items: center;
    gap: 15px;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    cursor: grab;
    touch-action: pan-x;
    will-change: transform;
}

.hero-carousel-track:active {
    cursor: grabbing;
}

.carousel-card {
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    user-select: none;
    -webkit-user-select: none;
}

.carousel-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
    pointer-events: none;
}

.carousel-card img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.2));
    pointer-events: none;
}

/* --- СВЕЧЕНИЕ (Опущено ниже и осветлено) --- */
.glow-effect {
    display: block;
    position: absolute;
    top: 140px;
    width: 30px;
    height: 250px;
    background: #60a5fa;
    /* Более светлый голубой */
    filter: blur(45px);
    opacity: 0.6;
    /* Снижена яркость */
    pointer-events: none;
    z-index: 0;
}

.glow-left {
    left: -20px;
}

.glow-right {
    right: -20px;
}


/* --- Контент внутри Hero --- */
.hero-content {
    position: relative;
    z-index: 10;
    max-width: 700px;
    margin: 0 auto;
}

/* Простая картинка на всю ширину без скруглений и теней */
.hero-main-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    margin: 0;
}

/* ========================================= */
/* ====== TOOLS SECTION (Wrapper) ========== */
/* ========================================= */

.tools-wrapper-styled {
    position: relative;
    padding: 2rem 0.5rem 1rem 0.5rem;
}

.tools-wrapper-styled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    border-radius: 24px;
    border: 2px solid #6b7fa7;
    -webkit-mask-image: linear-gradient(to bottom, black 0px, black 1px, transparent 25px);
    mask-image: linear-gradient(to bottom, black 0px, black 1px, transparent 25px);
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

.tools-header-label {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--surface-color);
    padding: 0 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6b7fa7;
    white-space: nowrap;
    z-index: 2;
}


/* ========================================= */
/* ====== FEATURE CARDS (3 IN ROW) ========= */
/* ========================================= */

.features-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

.feature-card-new {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border-radius: 16px;
    overflow: hidden;
    background-color: #243049;
    background-image: linear-gradient(180deg, #243049 0%, #65CAE9 100%);
    background-size: 100% calc(100% - 40px);
    background-repeat: no-repeat;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.feature-card-new:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.card-header-title {
    background-color: transparent;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    padding: 8px 4px;
    z-index: 2;
}

.card-body-gradient {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 10px;
    background: transparent;
}

.card-body-gradient img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.2s;
}

.img-shadow {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}

.inner-blue-card {
    background: radial-gradient(circle, rgb(93, 177, 203) 0%, rgb(68, 139, 171) 100%);
    border-radius: 14px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
    width: 90%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.inner-blue-card img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.feature-card-new:hover .card-body-gradient img {
    transform: scale(1.05);
}

.card-footer-btn {
    background-color: #243049;
    color: #d1d5db;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    padding: 10px 4px;
    z-index: 2;
    position: relative;
    box-shadow: 0 -1px 0 #243049;
    transition: color 0.2s, background-color 0.2s;
}

.feature-card-new:hover .card-footer-btn {
    color: #fff;
    background-color: #2d3d57;
    box-shadow: 0 -1px 0 #2d3d57;
}


/* ========================================= */
/* ====== INFO CARDS (API & SUPPORT) ======= */
/* ========================================= */

.info-cards-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 0.5rem;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--surface-elevated);
    border-radius: 16px;
    padding: 1.2rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-card:hover {
    transform: translateY(-2px);
    background-color: #263355;
}

/* Иконки */
.info-card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: #fff;
}

.info-card-icon svg {
    width: 28px;
    height: 28px;
}

/* Текст */
.info-card-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-card-text h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.info-card-text p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* --- СТИЛИ ДЛЯ КАНАЛА (Синее) --- */
.card-channel {
    background-image: linear-gradient(90deg, rgba(37, 99, 235, 0.1) 0%, transparent 40%);
    border-left: 2px solid #3b82f6; 
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.1);
}

.card-channel .info-card-icon {
    color: #60a5fa;
    background: rgba(37, 99, 235, 0.15);
}

.card-channel:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.25);
}

/* --- СТИЛИ ДЛЯ API (Зеленое) --- */
.card-api {
    background-image: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
    border-left: 2px solid #10b981;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
}

.card-api .info-card-icon {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
}

.card-api:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}

/* --- СТИЛИ ДЛЯ ПОДДЕРЖКИ (Желтое) --- */
.card-support {
    background-image: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, transparent 40%);
    border-left: 2px solid #f59e0b;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1);
}

.card-support .info-card-icon {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.15);
}

.card-support:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
}

/* ========================================= */
/* ========= FOOTER (Thanks API) =========== */
/* ========================================= */

.footer-credits {
    margin-top: 2rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.footer-credits a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.footer-credits a:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}


/* ========================================= */
/* ============= MEDIA QUERIES ============= */
/* ========================================= */

@media (min-width: 601px) {
    .features-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .card-header-title {
        font-size: 1rem;
        padding: 12px;
    }

    .card-footer-btn {
        font-size: 1rem;
        padding: 12px;
    }

    .glow-effect {
        display: none;
    }

    .info-cards-wrapper {
        flex-direction: row;
    }

    .info-card {
        flex: 1;
    }
}

@media (max-width: 360px) {
    .features-container {
        gap: 6px;
    }

    .card-header-title {
        font-size: 0.7rem;
    }

    .card-footer-btn {
        font-size: 0.75rem;
        padding: 8px 2px;
    }
}

/* ========================================= */
/* =========== TELEGRAM GATE =============== */
/* ========================================= */

.body-gated {
    overflow: hidden !important;
}

.body-gated header,
.body-gated main {
    filter: blur(5px);
    /* Reduced blur for performance */
    pointer-events: none;
    user-select: none;
    transition: filter 0.3s ease;
}

.tg-gate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background-color: rgba(10, 16, 32, 0.5);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.tg-gate-overlay.hidden {
    display: none;
    opacity: 0;
}

.tg-gate-modal {
    background-color: var(--surface-elevated);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.tg-gate-modal h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.tg-gate-modal p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
    width: 100%;
    text-align: left;
}

.tg-gate-link {
    display: block;
    width: 100%;
    background-color: var(--primary-color);
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.tg-gate-link:hover {
    background-color: var(--primary-hover);
}

/* ============================================= */
/* ========== ШАПКА (SAFE AREA) ================ */
/* ============================================= */

header.safe-area-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 10;
    background: linear-gradient(180deg, #0a1020 20%, rgba(10, 16, 32, 0) 100%);
    pointer-events: none;
    padding: 0;
    border: none;
    backdrop-filter: none;
}

header .header-content,
header nav,
header a {
    display: none;
}