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

/* --- Hero --- */
.dl-hero {
    padding-top: calc(var(--nav-height) + 80px);
    padding-bottom: 80px;
    position: relative;
    background: radial-gradient(ellipse at 60% 0%, #F0F4FF 0%, #FFFFFF 65%);
    overflow: hidden;
    text-align: center;
}

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

.dl-hero-title {
    font-size: 52px;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    color: var(--text-title);
    line-height: 1.15;
}

.dl-hero-title span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dl-hero-desc {
    font-size: 18px;
    color: var(--text-body);
    margin-bottom: 40px;
    line-height: 1.75;
}

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

.dl-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-title);
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.dl-pill:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(51, 112, 255, 0.18);
}

/* --- Quick Start --- */
.dl-quickstart {
    padding: 80px 0;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.dl-quickstart .section-header {
    margin-bottom: 56px;
}

.qs-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.qs-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--brand-primary);
    flex-shrink: 0;
    padding-top: 72px;
    opacity: 0.4;
    width: 48px;
}

.qs-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 16px;
}

.qs-num {
    font-size: 11px;
    font-weight: 800;
    color: var(--brand-primary);
    letter-spacing: 2px;
    margin-bottom: 16px;
    text-transform: uppercase;
    font-family: monospace;
}

.qs-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    margin-bottom: 20px;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.qs-text h3 {
    font-size: 17px;
    margin-bottom: 10px;
    color: var(--text-title);
}

.qs-text p {
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.7;
}

/* --- Sticky Platform Tabs --- */
.dl-tabs-sticky {
    position: sticky;
    top: var(--nav-height);
    z-index: 900;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(31, 35, 41, 0.06);
}

.dl-tabs-inner {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.dl-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 16px 22px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-body);
    border-bottom: 2.5px solid transparent;
    transition: all 0.22s ease;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}

.dl-tab:hover { color: var(--brand-primary); background: rgba(51, 112, 255, 0.04); }

.dl-tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
    background: rgba(51, 112, 255, 0.04);
}

/* --- Platform Sections --- */
.dl-section {
    padding: 80px 0;
    background: #fff;
}

.dl-section-alt {
    background: var(--bg-light);
}

.dl-section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 48px;
}

.dl-section-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.dl-icon-macos { background: linear-gradient(135deg, #1a1a2e, #555); }
.dl-icon-android { background: linear-gradient(135deg, #27c93f, #0fad5c); }
.dl-icon-ios { background: linear-gradient(135deg, #007AFF, #5AC8FA); }
.dl-icon-linux { background: linear-gradient(135deg, #F59E0B, #D97706); }

.dl-section-header h2 {
    font-size: 30px;
    margin-bottom: 6px;
    color: var(--text-title);
}

.dl-section-desc {
    font-size: 14px;
    color: var(--text-muted);
}

/* --- Badges --- */
.dl-badge-wrap { margin-bottom: 14px; }

.dl-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.dl-badge-primary {
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.dl-badge-beginner {
    background: rgba(51, 112, 255, 0.1);
    color: var(--brand-primary);
    border: 1px solid rgba(51, 112, 255, 0.2);
}

.dl-badge-archived {
    background: rgba(217, 119, 6, 0.1);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

/* --- Featured Card --- */
.dl-featured-card {
    background: linear-gradient(145deg, #F8FAFF 0%, #EDF0FF 100%);
    border: 1.5px solid rgba(51, 112, 255, 0.16);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-bottom: 28px;
    position: relative;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.dl-featured-card:hover {
    box-shadow: 0 20px 56px rgba(51, 112, 255, 0.12);
    transform: translateY(-2px);
}

.dl-section-alt .dl-featured-card {
    background: linear-gradient(145deg, #fff 0%, #F4F6FF 100%);
}

.dl-featured-inner {
    display: flex;
    gap: 52px;
    align-items: flex-start;
}

.dl-featured-info { flex: 1; min-width: 0; }

.dl-featured-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 256px;
    flex-shrink: 0;
}

.dl-client-name {
    font-size: 24px;
    color: var(--text-title);
    margin-bottom: 12px;
    font-weight: 700;
}

.dl-client-desc {
    font-size: 14.5px;
    color: var(--text-body);
    line-height: 1.75;
    margin-bottom: 16px;
}

.dl-sys-req {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.045);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

/* --- Feature Chips --- */
.dl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 4px;
}

.dl-chip {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(51, 112, 255, 0.08);
    color: #2563eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.dl-chip-muted {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
}

/* --- GitHub Links --- */
.dl-github-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
    flex-wrap: wrap;
}

.dl-github-link a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.dl-github-link a:hover { color: var(--brand-primary); }

.dl-github-deleted {
    color: #b45309;
    font-style: italic;
}

.dl-github-closed {
    font-style: italic;
    color: var(--text-muted);
}

/* --- Secondary Cards Grid --- */
.dl-secondary-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}

.dl-secondary-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.dl-secondary-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.dl-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.28s ease;
    display: flex;
    flex-direction: column;
}

.dl-card:hover {
    border-color: rgba(51, 112, 255, 0.28);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.dl-section-alt .dl-card { background: #fff; }

.dl-card .dl-client-name {
    font-size: 18px;
    margin-bottom: 10px;
}

.dl-card .dl-client-desc {
    font-size: 13px;
    flex: 1;
    margin-bottom: 12px;
}

.dl-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

/* --- Archived Card --- */
.dl-card-archived {
    background: rgba(217, 119, 6, 0.04);
    border: 1.5px dashed rgba(217, 119, 6, 0.28);
    border-radius: var(--radius-lg);
    padding: 28px 36px;
    margin-bottom: 4px;
}

.dl-card-archived:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(217, 119, 6, 0.4);
}

.dl-card-archived-inline {
    background: rgba(217, 119, 6, 0.04);
    border: 1.5px dashed rgba(217, 119, 6, 0.28);
}

.dl-card-archived-inline:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(217, 119, 6, 0.4);
}

.dl-archived-inner {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.dl-archived-inner > div:first-child { flex: 1; }

.dl-archived-actions {
    min-width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 32px;
}

.dl-archived-note {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
}

/* --- Notice Box --- */
.dl-notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(51, 112, 255, 0.06);
    border: 1px solid rgba(51, 112, 255, 0.14);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.65;
    margin-top: 24px;
}

.dl-notice i {
    font-size: 20px;
    color: var(--brand-primary);
    flex-shrink: 0;
    margin-top: 1px;
}

.dl-notice-warn {
    background: rgba(217, 119, 6, 0.06);
    border-color: rgba(217, 119, 6, 0.18);
    margin-top: 0;
    margin-bottom: 32px;
}

.dl-notice-warn i { color: #d97706; }

/* --- Button Size Variants --- */
.btn-sm { padding: 10px 22px; font-size: 13px; }

/* --- Pulse Animation --- */
@keyframes btn-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(51, 112, 255, 0.5); }
    70%  { box-shadow: 0 0 0 10px rgba(51, 112, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(51, 112, 255, 0); }
}

.btn-pulse {
    animation: btn-pulse 2.5s ease-in-out infinite;
}

.btn-pulse:hover {
    animation: none;
    box-shadow: 0 12px 28px rgba(139, 92, 255, 0.4);
}

/* Download CTAs: extra horizontal room + wrapping for long translated labels */
.dl-featured-actions > .btn,
.dl-archived-actions > .btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: center;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
    padding: 14px 32px;
}

.dl-featured-actions > .btn.btn-sm,
.dl-archived-actions > .btn.btn-sm {
    padding: 10px 26px;
}

.dl-card-actions .btn {
    white-space: normal;
    justify-content: center;
    text-align: center;
    overflow-wrap: break-word;
}

.dl-card-actions .btn.btn-sm {
    padding: 10px 26px;
}

.dl-card-actions .btn:not(.btn-sm) {
    padding: 14px 30px;
}

/* --- Android Architecture Guide --- */
.dl-arch-guide {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-top: 16px;
}

.dl-arch-guide h4 {
    font-size: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-title);
}

.dl-arch-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.dl-arch-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-title);
    margin-bottom: 10px;
}

.dl-arch-recommended {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.dl-arch-item p {
    font-size: 13px;
    color: var(--text-body);
    line-height: 1.65;
}

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

.dl-card-ios { text-align: center; }
.dl-card-ios .dl-badge-wrap { text-align: left; }
.dl-card-ios .dl-card-actions { justify-content: center; }
.dl-card-ios .dl-github-link { justify-content: center; }

.dl-ios-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    margin: 8px auto 18px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

/* --- iOS Apple ID Tutorial --- */
.dl-apple-id-tutorial {
    background: linear-gradient(145deg, #F6F8FF, #ECF0FF);
    border: 1px solid rgba(51, 112, 255, 0.14);
    border-radius: var(--radius-xl);
    padding: 40px;
}

.dl-apple-id-tutorial h3 {
    font-size: 22px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-title);
}

.dl-tutorial-intro {
    font-size: 15px;
    color: var(--text-body);
    margin-bottom: 32px;
    line-height: 1.7;
}

.dl-tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.dl-tutorial-num {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.dl-tutorial-step h4 {
    font-size: 15px;
    margin-bottom: 7px;
    color: var(--text-title);
}

.dl-tutorial-step p {
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.75;
}

.dl-tutorial-step code {
    background: rgba(51, 112, 255, 0.1);
    color: var(--brand-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* --- Linux CLI Block --- */
.dl-linux-cli {
    background: var(--bg-dark);
    border-radius: var(--radius-xl);
    padding: 36px;
    margin-top: 24px;
    color: #CDD6F4;
}

.dl-linux-cli h4 {
    color: #CDD6F4;
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dl-linux-cli p {
    font-size: 14px;
    color: #8F959E;
    margin-bottom: 20px;
    line-height: 1.6;
}

.dl-code-block {
    background: #0D1117;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.dl-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 12px;
    font-weight: 600;
    color: #6E7681;
    font-family: monospace;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dl-copy-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #8F959E;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.dl-copy-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #CDD6F4;
}

.dl-code-content {
    padding: 24px;
    margin: 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.9;
    overflow-x: auto;
    color: #CDD6F4;
}

.dl-code-content code { background: none; padding: 0; }
.cli-comment { color: #6E7681; font-style: italic; }
.cli-cmd { color: #79C0FF; }

.dl-core-actions { gap: 8px; }

/* --- FAQ --- */
.dl-faq {
    padding: 80px 0;
    background: var(--bg-light);
}

.dl-faq .section-header { margin-bottom: 48px; }

.dl-faq-grid {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.dl-faq-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.dl-faq-item {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.dl-faq-item:hover { box-shadow: var(--shadow-sm); }

.dl-faq-item[open] {
    border-color: rgba(51, 112, 255, 0.24);
    box-shadow: var(--shadow-sm);
}

.dl-faq-item[open] summary { color: var(--brand-primary); }

.dl-faq-item summary {
    padding: 20px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-title);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
    line-height: 1.4;
}

.dl-faq-item summary::-webkit-details-marker { display: none; }

.faq-arrow {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--text-muted);
    font-size: 16px;
}

.dl-faq-item[open] .faq-arrow { transform: rotate(180deg); }

.dl-faq-body {
    padding: 0 24px 22px;
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.8;
    border-top: 1px solid var(--bg-section);
    padding-top: 16px;
}

.dl-faq-body p { margin-bottom: 10px; }
.dl-faq-body p:last-child { margin-bottom: 0; }
.dl-faq-body ul { margin: 10px 0; padding-left: 20px; list-style: disc; }
.dl-faq-body ul li { margin-bottom: 6px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .dl-secondary-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .dl-hero-title { font-size: 36px; }
    .dl-hero-desc { font-size: 16px; }

    .qs-steps { flex-direction: column; gap: 28px; }
    .qs-connector { display: none; }
    .qs-step { flex-direction: row; text-align: left; gap: 18px; align-items: flex-start; padding: 0; }
    .qs-icon { margin-bottom: 0; flex-shrink: 0; }
    .qs-num { margin-bottom: 6px; }

    .dl-section { padding: 60px 0; }
    .dl-faq { padding: 60px 0; }
    .dl-quickstart { padding: 60px 0; }

    .dl-tab { padding: 14px 16px; font-size: 13px; gap: 5px; }

    .dl-section-header { flex-direction: column; align-items: flex-start; gap: 12px; }

    .dl-featured-inner { flex-direction: column; gap: 28px; }
    .dl-featured-actions { min-width: unset; width: 100%; }

    .dl-secondary-grid.cols-3,
    .dl-secondary-grid.cols-2 { grid-template-columns: 1fr; }

    .dl-archived-inner { flex-direction: column; gap: 20px; }
    .dl-archived-actions { min-width: unset; padding-top: 0; }

    .dl-arch-options { grid-template-columns: 1fr; gap: 14px; }

    .dl-ios-grid { grid-template-columns: 1fr; }
    .dl-card-ios { text-align: left; }
    .dl-card-ios .dl-card-actions { justify-content: flex-start; }
    .dl-card-ios .dl-github-link { justify-content: flex-start; }

    .dl-apple-id-tutorial { padding: 28px 24px; }

    .dl-faq-grid { flex-direction: column; }
    .dl-faq-col { flex: unset; width: 100%; }

    .dl-linux-cli { padding: 24px; }
    .dl-code-content { font-size: 12px; }
}

@media (max-width: 640px) {
    .dl-hero { padding-top: calc(var(--nav-height) + 48px); padding-bottom: 56px; }
    .dl-hero-title { font-size: 28px; }
    .dl-hero-desc { font-size: 15px; }

    .dl-featured-card { padding: 24px; }
    .dl-card { padding: 20px; }
    .dl-arch-guide { padding: 20px; }
    .dl-card-archived { padding: 20px; }
}
