/* =========================================================
   programs.css — MyFit (Clean & Optimized)
========================================================= */

.programs-page {
    width: 100%;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    overflow: hidden;
}

.section-container {
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
}

/* ================= DAY / NIGHT IMAGES ================= */

.night-image { display: none; }
[data-theme="dark"] .day-image { display: none; }
[data-theme="dark"] .night-image { display: block; }

/* ================= HERO ================= */

.programs-hero {
    position: relative;
    width: 100%;
    height: 480px; /* کاهش ارتفاع هیرو برای تناسب بهتر */
    overflow: hidden;
    background: var(--bg);
}

.programs-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.programs-hero-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.programs-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        90deg,
        rgba(246, 247, 245, 0.6) 0%,
        rgba(246, 247, 245, 0.3) 40%,
        rgba(246, 247, 245, 0) 100%
    );
}

[data-theme="dark"] .programs-hero-overlay {
    background: linear-gradient(
        90deg,
        rgba(16, 20, 18, 0.65) 0%,
        rgba(16, 20, 18, 0.35) 40%,
        rgba(16, 20, 18, 0) 100%
    );
}

.programs-hero-content {
    position: relative;
    z-index: 3;
    width: min(1280px, calc(100% - 60px));
    height: 100%;
    margin: 0 auto;
    padding-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
}

.programs-hero-label {
    display: block;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
}

.programs-hero-content h1 {
    max-width: 600px;
    margin: 0 0 12px;
    color: var(--text);
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.2;
    font-weight: 900;
}

.programs-hero-content p {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

/* ================= HERO GOALS ================= */

.hero-goals {
    position: absolute;
    z-index: 5;
    right: 50%;
    bottom: 20px;
    transform: translateX(50%);
    width: min(1280px, calc(100% - 60px));
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.hero-goal {
    position: relative;
    height: 95px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.25s ease;
}

.hero-goal:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(123, 174, 63, 0.55);
}

.hero-goal-icon {
    position: relative;
    z-index: 2;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(220, 236, 203, 0.7);
    color: var(--accent);
    font-size: 16px;
    transition: all 0.25s ease;
}

.hero-goal:hover .hero-goal-icon {
    transform: scale(1.05);
    background: var(--accent);
    color: #101412;
}

.hero-goal span {
    position: relative;
    z-index: 2;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

[data-theme="dark"] .hero-goal {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(24, 32, 28, 0.55);
}

[data-theme="dark"] .hero-goal-icon {
    background: rgba(85, 124, 46, 0.3);
}

/* ================= SECTION HEADINGS ================= */

.section-heading {
    margin-bottom: 28px;
    text-align: right;
}

.section-label {
    display: block;
    margin-bottom: 6px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
}

.section-heading h2 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: clamp(24px, 2.5vw, 32px);
    line-height: 1.3;
    font-weight: 800;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

/* ================= FEATURED PROGRAM ================= */

.featured-program {
    padding: 50px 0;
}

.featured-program-box {
    position: relative;
    min-height: 360px;
    overflow: hidden;
    border-radius: 20px;
    background: var(--surface);
}

.featured-image {
    position: absolute;
    inset: 0;
}

.featured-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(16, 20, 18, 0.9) 0%,
        rgba(16, 20, 18, 0.6) 45%,
        rgba(16, 20, 18, 0.05) 100%
    );
}

.featured-content {
    position: relative;
    z-index: 2;
    max-width: 520px;
    min-height: 360px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    color: #F2F5F1;
}

.featured-label,
.finder-label {
    margin-bottom: 8px;
    color: #9BCB55;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
}

.featured-content h2,
.finder-content h2 {
    margin: 0 0 10px;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.25;
    font-weight: 800;
}

.featured-content p,
.finder-content p {
    max-width: 440px;
    margin: 0 0 18px;
    color: rgba(242, 245, 241, 0.8);
    font-size: 13px;
    line-height: 1.7;
}

.featured-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.featured-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(242, 245, 241, 0.85);
    font-size: 12px;
}

.featured-meta i { color: #9BCB55; }

.featured-button,
.finder-button,
.bottom-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    background: #9BCB55;
    color: #101412;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.25s ease;
}

.featured-button:hover,
.finder-button:hover,
.bottom-cta-button:hover {
    transform: translateY(-2px);
    background: #A9D966;
}

/* ================= PROGRAM FINDER ================= */

.program-finder {
    padding-bottom: 50px;
}

.finder-box {
    position: relative;
    min-height: 320px;
    overflow: hidden;
    border-radius: 20px;
}

.finder-image {
    position: absolute;
    inset: 0;
}

.finder-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.finder-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(16, 20, 18, 0.88),
        rgba(16, 20, 18, 0.45),
        rgba(16, 20, 18, 0.1)
    );
}

.finder-content {
    position: relative;
    z-index: 2;
    min-height: 320px;
    max-width: 550px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    color: #F2F5F1;
}

/* ================= ALL PROGRAMS ================= */

.all-programs {
    padding-bottom: 60px;
}

.all-programs .section-heading {
    width: 100%;
    margin-bottom: 20px;
    text-align: center;
}

.all-programs .program-filters {
    width: 100%;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid rgba(128, 140, 133, 0.2);
    border-radius: 30px;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #101412;
}

.all-programs .programs-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

/* ================= PROGRAM CARDS ================= */

.program-card {
    overflow: hidden;
    background: var(--surface);
    border-radius: 14px;
    border: 1px solid rgba(23, 33, 29, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.program-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.all-programs .program-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(155, 203, 85, 0.14);
    border: 1px solid rgba(155, 203, 85, 0.25);
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 8px;
}

.program-card-image {
    position: relative;
    display: block;
    width: 100%;
    height: 180px;
    overflow: hidden;
    text-decoration: none;
}

.program-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.program-card:hover .program-card-image img {
    transform: scale(1.04);
}

.program-level {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 16px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(6px);
}

.program-level.beginner { background: rgba(89, 149, 99, 0.85); }
.program-level.intermediate { background: rgba(222, 142, 104, 0.85); }
.program-level.advanced { background: rgba(205, 95, 227, 0.85); }

.favorite-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(16, 20, 18, 0.6);
    color: #F2F5F1;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: all 0.2s ease;
}

.favorite-btn:hover {
    background: #9BCB55;
    color: #101412;
}

.program-card-content {
    padding: 16px;
}

.program-card-content h3 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
}

.program-card-content p {
    min-height: 38px;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.program-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    margin-bottom: 12px;
    border-top: 1px solid rgba(128, 140, 133, 0.12);
}

.program-info span {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 11px;
}

.program-info i { color: var(--accent); }

.program-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    transition: color 0.2s ease;
}

.program-link:hover { color: var(--accent); }

/* ================= BOTTOM CTA ================= */

.programs-bottom-cta {
    padding-bottom: 60px;
}

.bottom-cta-box {
    position: relative;
    min-height: 280px;
    overflow: hidden;
    border-radius: 20px;
}

.bottom-cta-image {
    position: absolute;
    inset: 0;
}

.bottom-cta-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.bottom-cta-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(16, 20, 18, 0.88),
        rgba(16, 20, 18, 0.4),
        rgba(16, 20, 18, 0.1)
    );
}

.bottom-cta-content {
    position: relative;
    z-index: 2;
    min-height: 280px;
    padding: 36px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    color: #F2F5F1;
}

.bottom-cta-content h2 {
    margin: 0 0 8px;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 800;
}

.bottom-cta-content p {
    margin: 0 0 18px;
    color: rgba(242, 245, 241, 0.8);
    font-size: 13px;
}

[data-theme="dark"] .program-card {
    border-color: rgba(255, 255, 255, 0.06);
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1100px) {
    .hero-goals { grid-template-columns: repeat(3, 1fr); gap: 10px; bottom: 16px; }
    .hero-goal { height: 85px; }
    .all-programs .programs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
    .all-programs .programs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .programs-hero { height: 520px; }
    .programs-hero-content { padding-top: 40px; }
    .hero-goals { grid-template-columns: repeat(3, 1fr); gap: 6px; bottom: 12px; }
    .hero-goal { height: 75px; padding: 6px; }
    .hero-goal-icon { width: 30px; height: 30px; font-size: 13px; }
    .hero-goal span { font-size: 10px; }
    
    .all-programs .program-filters {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 6px;
    }
    
    .all-programs .programs-grid { grid-template-columns: 1fr; }
    .featured-content, .finder-content, .bottom-cta-content { padding: 24px; }
}