/* =====================================================
   Download Page Styles
   ===================================================== */

:root {
    --dl-header-offset: calc(64px + env(safe-area-inset-top, 0px));
    --dl-tabs-height: 52px;
}

/* ----- Download Hero ----- */
.dl-hero {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: #0a0a0a;
    padding-top: var(--dl-header-offset);
}

.dl-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,82,217,0.35) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(99,102,241,0.2) 0%, transparent 60%),
        linear-gradient(135deg, #0a0a0a 0%, #111827 100%);
    animation: heroBgShift 12s ease-in-out infinite alternate;
}

@keyframes heroBgShift {
    0%   { opacity: 1; }
    100% { opacity: 0.85; }
}

/* Subtle grid overlay */
.dl-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.dl-hero-content {
    position: relative;
    z-index: 2;
    padding: 60px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.dl-hero-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.dl-hero-title {
    font-size: 52px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    margin-bottom: 16px;
    line-height: 1.15;
}

.dl-hero-desc {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 36px;
}

.dl-platform-nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.dl-platform-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dl-platform-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.7);
    transform: translateY(-2px);
    color: #fff;
}

.dl-platform-btn i {
    font-size: 16px;
}

/* ----- Trust Bar ----- */
.trust-bar {
    background: #111827;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 14px 20px;
}

.trust-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 0;
}

.trust-item {
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 24px;
}

.trust-item i {
    color: #60a5fa;
    font-size: 13px;
}

.trust-divider {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,0.15);
}

/* ----- Sticky Platform Tabs ----- */
.platform-tabs-wrap {
    position: sticky;
    top: var(--dl-header-offset);
    z-index: 900;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.platform-tabs-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.platform-tabs-inner::-webkit-scrollbar { display: none; }

.platform-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 14px 22px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
    font-family: inherit;
}

.platform-tab:hover {
    color: #111827;
    border-bottom-color: #d1d5db;
}

.platform-tab.active {
    color: #0052d9;
    border-bottom-color: #0052d9;
    font-weight: 600;
}

.platform-tab i {
    font-size: 15px;
}

/* ----- Platform Sections ----- */
.platform-section {
    background: #f9fafb;
    padding: 60px 0 80px;
    /* header + sticky tabs — keeps native #hash jumps aligned */
    scroll-margin-top: calc(var(--dl-header-offset) + var(--dl-tabs-height));
}

.platform-section-alt {
    background: #fff;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Platform section header */
.platform-section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 36px;
}

.platform-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
}

.platform-icon-windows { background: linear-gradient(135deg, #0078d4, #00b4d8); }
.platform-icon-macos   { background: linear-gradient(135deg, #555, #1c1c1e); }
.platform-icon-android { background: linear-gradient(135deg, #3ddc84, #00a86b); }
.platform-icon-ios     { background: linear-gradient(135deg, #007aff, #5ac8fa); }
.platform-icon-linux   { background: linear-gradient(135deg, #e95420, #dd4814); }

.platform-header-text h2 {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.platform-header-text p {
    font-size: 14px;
    color: #6b7280;
}

/* ----- Client Cards ----- */
.client-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    padding: 28px;
    position: relative;
    transition: box-shadow 0.3s ease;
}

.client-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

/* Main Featured Card */
.main-card {
    margin-bottom: 24px;
    border-color: #dbeafe;
    background: linear-gradient(to bottom right, #fff 0%, #eff6ff 100%);
}

.main-card-body {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.main-card-info {
    flex: 1;
    min-width: 0;
}

.main-card-downloads {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 260px;
    flex-shrink: 0;
}

/* Secondary Cards Row */
.secondary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.secondary-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.archived-card {
    background: #fafafa;
    border-color: #e5e7eb;
    opacity: 0.85;
}

/* iOS Cards */
.ios-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.ios-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    align-items: center;
}

/* ----- Badges ----- */
.card-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-main     { background: #d1fae5; color: #065f46; }
.badge-active   { background: #dbeafe; color: #1e40af; }
.badge-beginner { background: #e0e7ff; color: #3730a3; }
.badge-archived { background: #fff7ed; color: #92400e; }
.badge-closed   { background: #f3f4f6; color: #6b7280; }
.badge-dev      { background: #1f2937; color: #d1d5db; }

/* ----- Card Content Elements ----- */
.card-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.secondary-card .card-title {
    font-size: 17px;
}

.card-desc {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.65;
    margin-bottom: 12px;
}

.card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #374151;
    background: #f3f4f6;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.feature-chip i {
    color: #10b981;
    font-size: 10px;
}

.sys-req {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sys-req i { color: #60a5fa; }
.sys-req .fa-exclamation-triangle { color: #f59e0b; }

.arch-guide {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #78350f;
    line-height: 1.5;
}

.arch-guide i {
    color: #f59e0b;
    margin-top: 2px;
    flex-shrink: 0;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    margin-top: 4px;
    transition: color 0.2s;
}

.github-link:hover { color: #111827; }

.github-link-deleted {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    cursor: default;
    font-style: italic;
}

.github-link-closed {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* ----- Download Buttons ----- */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.btn-download:hover {
    background: #1f2937;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    color: #fff;
}

.btn-download i {
    font-size: 16px;
    flex-shrink: 0;
}

.btn-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.btn-text strong { font-size: 14px; font-weight: 600; }
.btn-text small   { font-size: 11px; opacity: 0.7; }

/* Primary pulse button */
.btn-download-pulse {
    background: #0052d9;
    position: relative;
    overflow: hidden;
}

.btn-download-pulse:hover {
    background: #0047c2;
    box-shadow: 0 4px 20px rgba(0,82,217,0.4);
}

.btn-download-pulse::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(0,82,217,0.6);
    animation: btnPulse 2.5s ease-out infinite;
}

@keyframes btnPulse {
    0%   { box-shadow: 0 0 0 0 rgba(0,82,217,0.5); }
    70%  { box-shadow: 0 0 0 10px rgba(0,82,217,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,82,217,0); }
}

/* Secondary download button */
.btn-download-sec {
    background: #fff;
    color: #111827;
    border: 1px solid #d1d5db;
}

.btn-download-sec:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* Archived button */
.btn-download-archived {
    background: #fff;
    color: #92400e;
    border: 1px solid #fde68a;
}

.btn-download-archived:hover {
    background: #fffbeb;
    color: #92400e;
    box-shadow: none;
}

/* Button group (multiple download options stacked) */
.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-group .btn-download {
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

/* ----- iOS Specific ----- */
.ios-notice {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 28px;
    font-size: 14px;
    color: #1e40af;
    line-height: 1.6;
}

.ios-notice i {
    font-size: 18px;
    color: #3b82f6;
    margin-top: 1px;
    flex-shrink: 0;
}

.ios-app-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.ios-icon-blue   { background: linear-gradient(135deg, #007aff, #5ac8fa); }
.ios-icon-orange { background: linear-gradient(135deg, #ff9f0a, #ff6b00); }
.ios-icon-purple { background: linear-gradient(135deg, #af52de, #5e5ce6); }

.ios-price-tag {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ios-price-tag i { color: #f59e0b; }

.btn-appstore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #000;
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.btn-appstore:hover {
    background: #1c1c1e;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    color: #fff;
}

.btn-appstore i { font-size: 18px; }

/* iOS Apple ID Tutorial */
.ios-tutorial {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 32px;
    margin-top: 8px;
}

.tutorial-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tutorial-title i { color: #6b7280; }

.tutorial-intro {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
    line-height: 1.6;
}

.tutorial-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.tutorial-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 5px;
}

.step-content p {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

.step-content a {
    color: #0052d9;
    text-decoration: underline;
}

/* ----- Linux Terminal ----- */
.linux-terminal {
    background: #1e1e2e;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 24px;
    font-family: 'Courier New', 'Consolas', monospace;
}

.terminal-header {
    background: #2a2a3d;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.t-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.t-dot-red    { background: #ff5f57; }
.t-dot-yellow { background: #febc2e; }
.t-dot-green  { background: #28c840; }

.terminal-title {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    font-family: inherit;
    margin-left: 4px;
}

.terminal-body {
    padding: 20px 24px;
}

.t-line {
    font-size: 14px;
    line-height: 1.8;
    color: #cdd6f4;
}

.t-prompt { color: #89dceb; margin-right: 6px; }
.t-cmd    { color: #a6e3a1; }
.t-comment { color: #6c7086; font-style: italic; }
.t-output  { color: #bac2de; padding-left: 14px; }
.t-active  { color: #a6e3a1; }

/* ----- Platform Tip ----- */
.platform-tip {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 13px;
    color: #166534;
    line-height: 1.6;
}

.platform-tip i {
    color: #22c55e;
    font-size: 16px;
    margin-top: 1px;
    flex-shrink: 0;
}

/* ----- Quick Start Section ----- */
.qs-section {
    background: #111827;
    padding: 80px 0;
}

.qs-title {
    text-align: center;
    font-size: 34px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.qs-subtitle {
    text-align: center;
    font-size: 16px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 56px;
}

.qs-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
    justify-content: center;
    margin-bottom: 48px;
}

.qs-step {
    flex: 1;
    max-width: 280px;
    text-align: center;
    padding: 0 20px;
}

.qs-num {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.3);
    margin-bottom: 12px;
}

.qs-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #60a5fa;
    margin: 0 auto 16px;
    background: rgba(96,165,250,0.08);
}

.qs-step h3 {
    font-size: 16px;
    font-weight: 600;
    color: #f9fafb;
    margin-bottom: 10px;
}

.qs-step p {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    line-height: 1.7;
}

.qs-divider {
    color: rgba(255,255,255,0.2);
    font-size: 18px;
    margin-top: 38px;
    flex-shrink: 0;
    padding: 0 8px;
}

.qs-cta {
    text-align: center;
}

.btn-qs-docs {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 28px;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    background: rgba(255,255,255,0.06);
}

.btn-qs-docs:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

/* ----- FAQ Section ----- */
.faq-section {
    background: #f9fafb;
    padding: 80px 0;
}

.faq-heading {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 10px;
}

.faq-sub {
    text-align: center;
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 48px;
}

.faq-list {
    max-width: 840px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-item[open] {
    border-color: #bfdbfe;
}

.faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.2s;
}

.faq-q::-webkit-details-marker { display: none; }
.faq-q::marker { display: none; }

.faq-q:hover { background: #f9fafb; }

.faq-q span { flex: 1; }

.faq-chevron {
    font-size: 13px;
    color: #9ca3af;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
    color: #0052d9;
}

.faq-a {
    padding: 0 22px 18px;
    border-top: 1px solid #f3f4f6;
}

.faq-a p {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.75;
    padding-top: 14px;
}

.faq-a code {
    font-family: 'Courier New', monospace;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #be185d;
}

/* =====================================================
   Responsive Styles
   ===================================================== */

@media (max-width: 1024px) {
    .secondary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .ios-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .tutorial-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dl-hero-title { font-size: 34px; }
    .dl-hero-desc  { font-size: 15px; }

    .dl-platform-nav {
        gap: 8px;
    }

    .dl-platform-btn {
        padding: 7px 14px;
        font-size: 13px;
    }

    .trust-bar-inner {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .trust-divider { display: none; }

    .platform-section { padding: 40px 0 60px; }

    .platform-section-header {
        gap: 14px;
        margin-bottom: 24px;
    }

    .platform-header-text h2 { font-size: 22px; }

    .main-card-body {
        flex-direction: column;
        gap: 24px;
    }

    .main-card-downloads {
        min-width: auto;
        width: 100%;
    }

    .secondary-cards {
        grid-template-columns: 1fr;
    }

    .ios-cards {
        grid-template-columns: 1fr;
    }

    .ios-card { align-items: flex-start; }

    .qs-steps {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .qs-divider {
        transform: rotate(90deg);
        margin: 0;
        padding: 0;
    }

    .qs-step {
        max-width: 100%;
        width: 100%;
    }

    .qs-title { font-size: 26px; }
    .faq-heading { font-size: 24px; }

    .ios-tutorial { padding: 20px; }

    .linux-terminal { font-size: 12px; }
    .terminal-body  { padding: 14px 16px; }
    .t-line { font-size: 12px; }

    .platform-tabs-inner {
        padding: 0 16px;
    }

    .platform-tab {
        padding: 12px 16px;
        font-size: 13px;
        gap: 6px;
    }

    .platform-tab i {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .dl-hero-title { font-size: 28px; }

    .section-container { padding: 0 16px; }

    .client-card { padding: 20px; }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn-download {
        min-width: 0;
    }

    .tutorial-steps { gap: 16px; }
}
