:root {
    --primary: #30f4e0;
    --primary-dark: #d8a91b;
    --primary-light: #f5d678;
    --accent: #e8b923;
    --black: #1a1a1a;
    --light: #f8f8f8;
    --gray: #888;
    --success: #28a745;
    --error: #dc3545;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ================= HERO SECTION ================= */
.packages-hero {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.7)), url('/static/lessons/images/range-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    padding: 120px 20px 80px;
    text-align: center;
    margin-top: 84px;
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 84px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.packages-hero .container {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

.packages-hero h1 {
    font-size: 4rem;
    color: var(--light);
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out;
}

.packages-hero h1 span {
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.packages-hero p {
    font-size: 1.4rem;
    max-width: 700px;
    margin: 0 auto 32px;
    line-height: 1.8;
    color: var(--light);
    opacity: 0.9;
    animation: fadeInUp 1.2s ease-out 0.2s;
}

.package-btn {
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    transition: all 0.4s ease;
    text-decoration: none;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--black);
    border: none;
    display: inline-block;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.package-btn::before {
    content: '\f05b';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    font-size: 1.5rem;
    color: var(--primary-light);
    opacity: 0;
    top: -20px;
    left: 50%;
    transform: translateX(-50%) scale(1.5);
    transition: all 0.4s ease;
}

.package-btn:hover::before {
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: crosshairFade 0.6s ease forwards;
}

.package-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(232, 185, 35, 0.5);
}

@keyframes crosshairFade {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ================= PACKAGE CARDS ================= */
.packages-container {
    padding: 80px 15px;
    background: linear-gradient(to bottom, rgba(18, 18, 18, 0.95), rgba(26, 26, 26, 0.9));
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 40px;
    text-transform: uppercase;
    font-weight: 700;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, var(--primary), transparent);
    margin: 10px auto;
    border-radius: 2px;
}

.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    max-width: 1280px;
    margin: 0 auto;
}

.package-card {
    background: rgba(40, 40, 40, 0.85);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.4s ease;
    border: 1px solid rgba(232, 185, 35, 0.3);
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 480px; /* ارتفاع یکسان برای همه کارت‌ها */
    box-sizing: border-box; /* اطمینان از محاسبه صحیح ابعاد */
}

.package-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
    background: rgba(40, 40, 40, 0.9);
}

.package-highlight {
    border: 2px solid var(--primary);
    background: rgba(40, 40, 40, 0.9);
    box-shadow: 0 0 20px rgba(232, 185, 35, 0.4);
    min-height: 480px; /* همسان با سایر کارت‌ها */
}

.package-highlight::before {
    content: 'Most Popular';
    position: absolute;
    top: 10px; /* تنظیم موقعیت برای جلوگیری از جابجایی */
    right: 20px;
    background: var(--primary);
    color: var(--black);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.package-header {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(232, 185, 35, 0.4);
    flex: 0 0 auto; /* ارتفاع ثابت برای هدر */
}

.package-title {
    font-size: 1.8rem;
    margin-bottom: 16px;
    color: var(--light);
    font-weight: 600;
}

.package-price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--light);
    margin: 12px 0;
}

.package-price span {
    font-size: 1.1rem;
    color: var(--gray);
    opacity: 0.8;
}

.package-features {
    padding: 20px 0;
    flex: 1 1 auto; /* توزیع فضای باقی‌مانده */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.package-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.package-features li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 48px; /* ارتفاع یکسان برای آیتم‌ها */
}

.package-features li:hover {
    background: rgba(232, 185, 35, 0.1);
    color: var(--primary-light);
}

.package-features li:last-child {
    border-bottom: none;
}

.package-features i {
    color: var(--primary);
    margin-right: 12px;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.package-features i.fa-check {
    color: var(--success);
}

.package-features i.fa-times {
    color: var(--error);
}

.package-features li:hover i {
    transform: scale(1.2);
}

.package-meta {
    margin-top: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
    color: var(--gray);
    opacity: 0.9;
    flex: 0 0 auto; /* ارتفاع ثابت برای متا */
}

.package-meta small {
    display: block;
    margin-bottom: 5px;
}

.package-cta {
    margin-top: auto;
    padding-top: 16px;
    flex: 0 0 auto; /* ارتفاع ثابت برای CTA */
}

/* ================= COMPARISON TABLE ================= */
.comparison-section {
    padding: 80px 15px;
    background: linear-gradient(to bottom, rgba(18, 18, 18, 0.95), rgba(26, 26, 26, 0.9));
}

.comparison-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 15px;
}

.comparison-title {
    text-align: center;
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 48px;
    text-transform: uppercase;
    font-weight: 700;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.comparison-title::after {
    content: '';
    display: block;
    width: 120px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), transparent);
    margin: 16px auto 0;
    border-radius: 2px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(40, 40, 40, 0.85);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(232, 185, 35, 0.3);
    backdrop-filter: blur(5px);
    table-layout: fixed;
}

.comparison-table th {
    background: rgba(232, 185, 35, 0.2);
    color: var(--primary-light);
    font-size: 1.1rem;
    padding: 14px 10px;
    text-align: center;
    font-weight: 600;
    min-width: 120px;
    max-width: 160px;
}

.comparison-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.95rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tr:hover {
    background: rgba(232, 185, 35, 0.1);
}

.comparison-table .feature-name {
    font-weight: 600;
    color: var(--light);
    text-align: left;
    padding-left: 16px;
    min-width: 200px;
}

.comparison-table .yes::before {
    content: '\f00c';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 8px;
}

.comparison-table .no::before {
    content: '\f00d';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 8px;
}

.comparison-table .yes {
    color: var(--success);
    font-weight: 700;
}

.comparison-table .no {
    color: var(--error);
}

.pricing-note {
    margin-top: 24px;
    text-align: center;
    color: var(--gray);
    font-size: 0.95rem;
    opacity: 0.9;
}

/* ================= CTA SECTION ================= */
.cta-section {
    padding: 80px 15px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.75)), url('/static/lessons/images/range-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    text-align: center;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.cta-title {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cta-description {
    font-size: 1.2rem;
    color: var(--light);
    margin-bottom: 30px;
    line-height: 1.8;
    opacity: 0.9;
}

.btn-primary {
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--black);
    border: none;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    display: inline-block;
}

.btn-primary::before {
    content: '\f05b';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    font-size: 1.5rem;
    color: var(--primary-light);
    opacity: 0;
    top: -20px;
    left: 50%;
    transform: translateX(-50%) scale(1.5);
    transition: all 0.4s ease;
}

.btn-primary:hover::before {
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: crosshairFade 0.6s ease forwards;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(232, 185, 35, 0.5);
}

/* ================= RESPONSIVE STYLES ================= */
@media (max-width: 1200px) {
    .package-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 14px;
    }

    .package-card {
        min-height: 460px;
    }

    .package-highlight {
        min-height: 460px;
    }

    .comparison-table th,
    .comparison-table td {
        font-size: 0.9rem;
        padding: 10px 8px;
        min-width: 100px;
    }

    .comparison-table .feature-name {
        min-width: 180px;
    }
}

@media (max-width: 992px) {
    .package-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
    }

    .package-card {
        min-height: 440px;
    }

    .package-highlight {
        min-height: 440px;
    }

    .packages-hero h1 {
        font-size: 3rem;
    }

    .packages-hero p {
        font-size: 1.2rem;
        max-width: 90%;
    }

    .comparison-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .comparison-table th,
    .comparison-table td {
        min-width: 100px;
        max-width: 140px;
        font-size: 0.85rem;
        padding: 8px;
    }

    .comparison-table .feature-name {
        min-width: 160px;
        padding-left: 12px;
    }

    .cta-title {
        font-size: 2rem;
    }

    .cta-description {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .packages-hero {
        padding: 80px 15px 60px;
        min-height: calc(80vh - 84px);
    }

    .packages-hero h1 {
        font-size: 2.5rem;
        letter-spacing: 1.5px;
    }

    .packages-hero p {
        font-size: 1.1rem;
        max-width: 95%;
    }

    .package-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .packages-container {
        padding: 60px 10px;
    }

    .section-title {
        font-size: 2rem;
    }

    .package-card {
        padding: 16px;
        min-height: 420px;
    }

    .package-highlight {
        min-height: 420px;
    }

    .package-title {
        font-size: 1.6rem;
    }

    .package-price {
        font-size: 2.5rem;
    }

    .package-features li {
        font-size: 0.9rem;
        padding: 10px 0;
        min-height: 44px;
    }

    .package-meta {
        font-size: 0.9rem;
    }

    .comparison-section {
        padding: 60px 10px;
    }

    .comparison-title {
        font-size: 2rem;
    }

    .comparison-table th,
    .comparison-table td {
        font-size: 0.8rem;
        padding: 8px 6px;
        min-width: 90px;
    }

    .comparison-table .feature-name {
        font-size: 0.85rem;
        min-width: 140px;
    }

    .cta-section {
        padding: 60px 10px;
    }

    .btn-primary {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .packages-hero {
        padding: 60px 10px 40px;
        min-height: calc(70vh - 84px);
    }

    .packages-hero h1 {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .packages-hero p {
        font-size: 1rem;
        max-width: 100%;
    }

    .package-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        border-radius: 25px;
    }

    .package-btn::before {
        font-size: 1.2rem;
    }

    .packages-container {
        padding: 40px 10px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section-title::after {
        width: 60px;
        height: 2px;
    }

    .package-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .package-card {
        padding: 14px;
        min-height: auto; /* در موبایل ارتفاع ثابت غیرضروری است */
    }

    .package-highlight {
        min-height: auto;
    }

    .package-title {
        font-size: 1.4rem;
    }

    .package-price {
        font-size: 2.2rem;
    }

    .package-price span {
        font-size: 0.95rem;
    }

    .package-features li {
        font-size: 0.85rem;
        padding: 8px 0;
        min-height: 40px;
    }

    .package-features i {
        font-size: 1rem;
        margin-right: 8px;
    }

    .package-meta {
        font-size: 0.8rem;
    }

    .package-highlight::before {
        font-size: 0.8rem;
        padding: 6px 15px;
        right: 10px;
        top: 2px;
    }

    .comparison-section {
        padding: 40px 10px;
    }

    .comparison-title {
        font-size: 1.8rem;
    }

    .comparison-title::after {
        width: 80px;
        height: 3px;
    }

    .comparison-table th,
    .comparison-table td {
        font-size: 0.75rem;
        padding: 6px 4px;
        min-width: 80px;
    }

    .comparison-table .feature-name {
        font-size: 0.8rem;
        min-width: 120px;
        padding-left: 10px;
    }

    .pricing-note {
        font-size: 0.8rem;
    }

    .cta-section {
        padding: 40px 10px;
    }

    .cta-title {
        font-size: 1.8rem;
    }

    .cta-description {
        font-size: 1rem;
    }

    .btn-primary {
        padding: 10px 20px;
        font-size: 0.9rem;
        border-radius: 25px;
    }

    .btn-primary::before {
        font-size: 1.2rem;
    }
}