/* === Download Page Styles === */

/* --- Hero --- */
.dl-hero {
    padding: 84px 0 60px;
    min-height: 40vh;
    display: flex;
    align-items: center;
}

.dl-hero-inner {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* --- Main download button --- */
.dl-main-action {
    margin: 2rem 0 1.5rem;
}

.dl-btn-win {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    border-radius: 12px;
    text-decoration: none;
    background: var(--primary);
    color: #000;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 30px rgba(0, 217, 126, 0.4);
}

.dl-btn-win:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 50px rgba(0, 217, 126, 0.6), 0 8px 24px rgba(0,0,0,0.4);
}

.dl-btn-icon {
    font-size: 2rem;
    line-height: 1;
}

.dl-btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.dl-btn-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.dl-btn-sub {
    font-size: 0.78rem;
    font-weight: 500;
    opacity: 0.75;
}

.dl-free-note {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    gap: 0.35rem;
}

.dl-free-note .cta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* --- Platform icons row --- */
.dl-platforms {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.dl-platform {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: default;
    transition: transform 0.2s ease;
}

.dl-platform:hover {
    transform: translateY(-4px);
}

.dl-platform-icon {
    font-size: 2rem;
    line-height: 1;
}

.dl-platform-icon img {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.dl-platform-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dl-platform-status {
    font-size: 1.05rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.dl-status-ready {
    background: rgba(0, 217, 126, 0.15);
    color: var(--primary);
    border: 1px solid rgba(0, 217, 126, 0.4);
}

.dl-status-soon {
    background: rgba(255, 255, 255, 0.05);
    color: #6b7280;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dl-platform-active .dl-platform-icon {
    filter: drop-shadow(0 0 8px rgba(0, 217, 126, 0.6));
}

.dl-platform-soon {
    opacity: 0.5;
}

/* --- Platform cards grid --- */
.dl-cards-section {
    padding: 80px 0 100px;
}

.dl-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
    padding-bottom: 8px; /* чтобы тени/рамки не обрезались */
}

/* --- Base card --- */
.dl-card {
    background: rgba(26, 31, 46, 0.7);
    border: 1px solid rgba(0, 217, 126, 0.15);
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: visible; /* было hidden — это и обрезало рамки снизу */
    min-height: 420px;
}

/* --- Active card (Windows) --- */
.dl-card-active {
    border-color: rgba(0, 217, 126, 0.4);
    box-shadow: 0 0 30px rgba(0, 217, 126, 0.1);
}

.dl-card-active:hover {
    transform: translateY(-6px);
    box-shadow: 0 0 50px rgba(0, 217, 126, 0.2), 0 12px 40px rgba(0,0,0,0.4);
    border-color: rgba(0, 217, 126, 0.6);
}

/* --- Stub card --- */
.dl-card-stub {
    opacity: 0.7;
}

.dl-card-stub:hover {
    opacity: 1;
}

/* --- Stub overlay (shown on hover) --- */
.dl-stub-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 20, 0.93);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly; /* равномерно распределяем по высоте */
    gap: 0;
    padding: 2rem 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.dl-card-stub:hover .dl-stub-overlay {
    opacity: 1;
    pointer-events: auto;
}

.dl-stub-badge {
    display: inline-block;
    padding: 4px 16px;
    border: 1px solid rgba(0, 217, 126, 0.4);
    border-radius: 20px;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(0, 217, 126, 0.08);
}

.dl-stub-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* --- Notify form inside stub --- */
.dl-notify-form {
    display: flex;
    flex-direction: column; /* кнопка на следующей строке */
    gap: 0.6rem;
    width: 100%;
    max-width: 240px;
}

.dl-notify-input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(0, 217, 126, 0.25);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.dl-notify-input:focus {
    border-color: var(--primary);
}

.dl-notify-input::placeholder {
    color: #4a5568;
}

.dl-notify-btn {
    width: 100%;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    font-family: inherit;
}

.dl-notify-btn:hover {
    background: #00f090;
    transform: scale(1.02);
}

/* --- Card header --- */
.dl-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dl-card-header-muted {
    opacity: 0.6;
}

.dl-card-platform-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.dl-card-platform-icon img {
    width: 105px;
    height: 105px;
    object-fit: contain;
}

.dl-card-platform-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.dl-version-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(0, 217, 126, 0.15);
    color: var(--primary);
    border: 1px solid rgba(0, 217, 126, 0.3);
}

.dl-badge-soon {
    background: rgba(255,255,255,0.05);
    color: #6b7280;
    border-color: rgba(255,255,255,0.1);
    white-space: nowrap;
    font-size: 0.68rem;
}

/* --- Card meta --- */
.dl-card-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dl-meta-muted {
    opacity: 0.5;
}

.dl-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.82rem;
}

.dl-meta-row:last-child {
    border-bottom: none;
}

.dl-meta-label {
    color: var(--text-secondary);
}

.dl-meta-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* --- Changelog --- */
.dl-card-changelog {
    background: rgba(0, 217, 126, 0.04);
    border: 1px solid rgba(0, 217, 126, 0.1);
    border-radius: 10px;
    padding: 1rem;
}

.dl-changelog-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dl-changelog-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dl-changelog-list li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 3px 0 3px 1.2rem;
    position: relative;
}

.dl-changelog-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* --- Card button --- */
.dl-card-btn {
    margin-top: auto;
    text-align: center;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: block;
}

.dl-card-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* --- Sysreq table --- */
.dl-sysreq-section {
    padding: 80px 0 100px;
}

.dl-sysreq-table td:first-child {
    font-weight: 500;
}

/* --- Steps --- */
.dl-steps-section {
    padding: 80px 0 100px;
}

.dl-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.dl-step {
    background: rgba(26, 31, 46, 0.7);
    border: 1px solid rgba(0, 217, 126, 0.15);
    border-radius: 16px;
    padding: 2rem 1.75rem;
    text-align: center;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.dl-step:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 217, 126, 0.4);
    box-shadow: 0 0 25px rgba(0, 217, 126, 0.12);
}

.dl-step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 217, 126, 0.15);
    border: 2px solid var(--primary);
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 0 12px rgba(0, 217, 126, 0.3);
}

.dl-step h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.dl-step p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.dl-step p code {
    background: rgba(0, 217, 126, 0.1);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.dl-step-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 0.25rem;
    filter: drop-shadow(0 0 8px rgba(0, 217, 126, 0.6));
}

.dl-step-arrow svg {
    width: 64px;
    height: 26px;
}

.dl-steps-note {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .dl-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* FIX: compensate for 2-row fixed header (~120px) */
    .dl-hero { padding: 60px 0 40px; }

    /* Platform cards — CSS scroll-snap carousel on mobile */
    .dl-cards-grid {
        display: flex !important;
        flex-direction: row !important;
        grid-template-columns: unset !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
        padding: 0.5rem 1rem 1.5rem 1rem;
        margin: 0 -1rem;
        /* Hide scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .dl-cards-grid::-webkit-scrollbar {
        display: none;
    }

    .dl-card {
        flex: 0 0 82%;
        min-width: 82%;
        max-width: 82%;
        min-height: unset;
        scroll-snap-align: start;
        transform: none !important;
        transition: none !important;
    }

    /* FIX: Completely hide stub overlay on mobile — :hover sticks on iOS */
    .dl-stub-overlay {
        display: none !important;
    }

    .dl-platforms { gap: 1rem; }
    .dl-steps { flex-direction: column; align-items: stretch; }
    .dl-step { max-width: 100%; }
    .dl-step-arrow { transform: rotate(90deg); text-align: center; padding: 0.5rem 0; }
    .dl-btn-win { padding: 0.9rem 1.5rem; }

    /* Platform icons smaller on mobile */
    .dl-platform-icon img {
        width: 64px;
        height: 64px;
    }

    .dl-card-platform-icon img {
        width: 72px;
        height: 72px;
    }

    /* Disable hover on cards */
    .dl-card-active:hover {
        transform: none;
    }
}
