/* ===========================
   Root Variables
   =========================== */
:root {
    --primary-color: rgb(250, 40, 65);
    --secondary-color: rgb(214, 42, 61);
    --dark-tertiary: rgb(33, 41, 54);
    --darkest: rgb(29, 32, 37);
    --text-gray: #6B7280;
    --light-bg: #F9FAFB;
}

/* ===========================
   Reset & Base Styles
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', 'Segoe UI', Tahoma, sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.8;
    overflow-x: hidden;
}

/* ===========================
   Navigation Bar
   =========================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    padding: 0.75rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 3rem;
    height: 64px;
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    height: 40px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.logo-text:hover {
    opacity: 0.8;
}

.logo-edna {
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    list-style: none;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
}

/* Fallback for browsers without gap support */
@supports not (gap: 2.5rem) {
    .nav-menu li {
        margin-left: 2.5rem;
    }
    .nav-menu li:first-child {
        margin-left: 0;
    }
}

.nav-menu li {
    line-height: 1;
}

.nav-link {
    color: #000000;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s ease;
    display: inline-block;
    padding: 0.5rem 0.75rem;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    margin-top: 75px;
    background-color: #fff;
    min-height: calc(100vh - 75px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-container {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    width: 100%;
    padding: 0 2rem;
    gap: 2rem;
}

.hero-content {
    flex: 1;
    text-align: center;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1rem;
    color: #6B7280;
    margin-bottom: 2rem;
    font-weight: 400;
    line-height: 1.8;
}

.hero-buttons {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 1rem;
}

/* Fallback for browsers without gap support */
@supports not (gap: 1rem) {
    .hero-buttons a {
        margin: 0 0.5rem;
    }
}

.hero-image {
    flex: 1;
    background-image: url('/static/images/edna-character.jpg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    width: 100%;
    min-height: 400px;
    aspect-ratio: 1 / 1;
    border-radius: 30px;
    overflow: hidden;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 1 / 1) {
    .hero-image {
        height: 0;
        padding-bottom: 100%;
        min-height: 0;
    }
}

.btn {
    padding: 0.85rem 2rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--dark-tertiary);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--darkest);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: white;
    color: var(--dark-tertiary);
    border: 2px solid #E5E7EB;
}

.btn-secondary:hover {
    background: var(--light-bg);
    border-color: #D1D5DB;
    transform: translateY(-2px);
}

/* ===========================
   Features Gallery Section
   =========================== */
.features-gallery {
    padding: 6rem 3rem;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.features-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.features-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.features-subtitle {
    font-size: 1.125rem;
    color: #6B7280;
}

.features-grid {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 1.5rem 1fr 1.5rem 1fr 1.5rem 1fr;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    grid-gap: 1.5rem;
}

.feature-card {
    background: #ffffff;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #E5E7EB;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    cursor: pointer;
    -webkit-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    display: block;
}

.feature-card:hover {
    -webkit-transform: translateY(-0.5rem);
    -moz-transform: translateY(-0.5rem);
    -ms-transform: translateY(-0.5rem);
    -o-transform: translateY(-0.5rem);
    transform: translateY(-0.5rem);
    -webkit-box-shadow: 0 20px 60px rgba(239, 68, 68, 0.15);
    box-shadow: 0 20px 60px rgba(239, 68, 68, 0.15);
    border-color: #EF4444;
}

.feature-card-vip:hover {
    box-shadow: 0 20px 60px rgba(239, 68, 68, 0.15);
    border-color: #EF4444;
}

.feature-image {
    height: 16rem;
    position: relative;
    overflow: hidden;
}

.feature-image img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    -webkit-transition: -webkit-transform 0.7s ease;
    -moz-transition: -moz-transform 0.7s ease;
    -o-transition: -o-transform 0.7s ease;
    transition: transform 0.7s ease;
}

.feature-card:hover .feature-image img {
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
    -o-transform: scale(1.1);
    transform: scale(1.1);
}

.feature-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(2px);
    transform: scale(1.1);
    transition: all 0.7s ease;
}

.feature-card:hover .feature-bg {
    filter: blur(0);
    transform: scale(1);
}

.feature-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
}

.feature-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    backdrop-filter: blur(4px);
}

.feature-badge-vip {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: linear-gradient(to left, #EAB308, #FACC15);
    color: #000;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.4);
}

.feature-face-circle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    border: 2px solid #EC4899;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
    z-index: 10;
}

.feature-face-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feature-content {
    padding: 1.25rem;
    position: relative;
}

.feature-icon {
    position: absolute;
    top: -2.5rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    color: white;
    font-size: 1.25rem;
}

.feature-card:hover .feature-icon {
    transform: rotate(6deg);
}

.feature-icon-vip {
    background: linear-gradient(to bottom right, #FACC15, #EAB308);
    color: #1F2937;
}

.feature-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1F2937;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.feature-card:hover .feature-name {
    color: #3B82F6;
}

.feature-name-vip {
    color: #1F2937;
}

.feature-card:hover .feature-name-vip {
    color: #EAB308;
}

.feature-description {
    color: #6B7280;
    font-size: 0.875rem;
    line-height: 1.5;
}

.features-slider-dots {
    display: none;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.slider-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #D1D5DB;
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.slider-dot.active {
    width: 1.5rem;
    background: #3B82F6;
    border-radius: 0.25rem;
}

/* ===========================
   Templates Section
   =========================== */
.templates {
    padding: 6rem 3rem;
    background: var(--light-bg);
}

.templates-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 3.5rem;
    position: relative;
}

.section-title::before,
.section-title::after {
    content: '—';
    color: var(--primary-color);
    font-size: 2rem;
    margin: 0 1.25rem;
    font-weight: 400;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.template-item {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    cursor: pointer;
    aspect-ratio: 4/5;
}

/* Fallback for aspect-ratio */
@supports not (aspect-ratio: 4/5) {
    .template-item {
        height: 0;
        padding-bottom: 125%; /* 5/4 * 100 = 125% */
        position: relative;
    }
    .template-item img {
        position: absolute;
        top: 0;
        left: 0;
    }
}

.template-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.template-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===========================
   FAQ Section
   =========================== */
.faq {
    padding: 6rem 3rem;
    background: #ffffff;
}

.faq-container {
    max-width: 1200px;
    margin: 0 auto;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.faq-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    text-align: right;
    border: 1px solid #f3f4f6;
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.faq-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.faq-card-center {
    background: var(--dark-tertiary);
    color: white;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: none;
}


.faq-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 1.75rem;
}

.faq-card-center .faq-title {
    color: white;
    margin-bottom: 2rem;
}

.faq-list {
    list-style: none;
    padding: 0;
    flex-grow: 1;
}

.faq-list li {
    color: var(--text-gray);
    font-size: 0.98rem;
    margin-bottom: 1.5rem;
    line-height: 1.9;
}

.faq-list li:last-child {
    margin-bottom: 0;
}

.faq-list li::before {
    content: "۱.  ";
    color: var(--primary-color);
    font-weight: 600;
}

.faq-list li:nth-child(2)::before {
    content: "۲.  ";
}

.faq-text {
    color: var(--text-gray);
    font-size: 0.98rem;
    line-height: 2;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.faq-footer {
    margin-top: auto;
    padding-top: 1.75rem;
    border-top: 2px solid #f3f4f6;
}

.faq-footer p {
    color: #9CA3AF;
    font-size: 0.88rem;
    line-height: 1.6;
}

.telegram-icon {
    width: 75px;
    height: 75px;
    color: white;
    margin-top: 0.5rem;
}

.telegram-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.15));
}

/* ===========================
   Footer
   =========================== */
.footer {
    background: var(--darkest);
    padding: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.enamad-seal {
    display: inline-block;
    transition: transform 0.3s ease;
}

.enamad-seal:hover {
    transform: scale(1.05);
}

.enamad-seal img {
    max-width: 110px;
    height: auto;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 2rem;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1rem;
    }

    .hero-content {
        text-align: center;
        max-width: 100%;
    }

    .hero-image {
        background-image: url('/static/images/edna-character-mobile.jpg');
        width: 100%;
        min-height: 300px;
        aspect-ratio: 1/1;
        background-size: cover;
        background-position: center center;
        margin-top: 1rem;
        border-radius: 30px;
        overflow: hidden;
    }

    @supports not (aspect-ratio: 1/1) {
        .hero-image {
            height: 0;
            padding-bottom: 100%;
            min-height: 0;
        }
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-buttons {
        align-items: center;
        justify-content: center;
    }

    .templates {
        padding: 4rem 2rem;
    }

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

    .faq {
        padding: 4rem 2rem;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    /* Features Gallery - Tablet */
    .features-gallery {
        padding: 4rem 2rem;
    }

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

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0;
    }

    .nav-container {
        padding: 0 1.5rem;
        height: 56px;
        flex-direction: row-reverse;
        position: relative;
    }

    .logo {
        height: 34px;
    }

    .mobile-menu-btn {
        display: flex;
        margin-left: 0;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: white;
        flex-direction: column;
        padding: 0.5rem 0;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        width: 100%;
    }

    .nav-menu.active {
        max-height: 180px;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
    }

    .nav-menu li a {
        display: block;
        width: 100%;
    }

    .hero {
        margin-top: 56px;
        min-height: calc(100vh - 56px);
    }

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

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .btn {
        width: 100%;
        max-width: 280px;
    }

    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

    .faq-card {
        padding: 2rem;
    }

    /* Features Gallery - Mobile Slider */
    .features-gallery {
        padding: 3rem 0;
    }

    .features-container {
        padding: 0;
    }

    .features-header {
        padding: 0 1.5rem;
        margin-bottom: 2rem;
    }

    .features-title {
        font-size: 1.75rem;
    }

    .features-subtitle {
        font-size: 1rem;
    }

    .features-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        gap: 1rem;
        padding: 0 1.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .features-grid::-webkit-scrollbar {
        display: none;
    }

    .feature-card {
        flex: 0 0 85%;
        scroll-snap-align: center;
    }

    .features-slider-dots {
        display: flex;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
        flex-direction: row-reverse;
    }

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

    .logo-text {
        font-size: 1.25rem;
    }

    .section-title::before,
    .section-title::after {
        font-size: 1.5rem;
        margin: 0 0.75rem;
    }
}

/* ===========================
   VPN Warning Modal
   =========================== */
.vpn-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); /* Darker for browsers without backdrop-filter */
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 10000;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-animation: fadeIn 0.3s ease;
    animation: fadeIn 0.3s ease;
}

.vpn-modal.active {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.vpn-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    overflow: hidden;
}

.vpn-modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    text-align: center;
}

.vpn-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.vpn-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.vpn-modal-body {
    padding: 2rem;
}

.vpn-message {
    font-size: 1.1rem;
    line-height: 2;
    color: var(--dark-tertiary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.vpn-message strong {
    color: var(--primary-color);
}

.vpn-steps {
    background: var(--light-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.vpn-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    font-size: 1rem;
}

.vpn-step:not(:last-child) {
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 0.75rem;
    padding-bottom: 1rem;
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.step-text {
    color: var(--dark-tertiary);
    font-weight: 500;
}

.vpn-modal-footer {
    padding: 1.5rem 2rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.vpn-btn {
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Vazir', sans-serif;
}

.vpn-btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(250, 40, 65, 0.3);
}

.vpn-btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(250, 40, 65, 0.4);
}

.vpn-btn-secondary {
    background: #E5E7EB;
    color: var(--dark-tertiary);
}

.vpn-btn-secondary:hover {
    background: #D1D5DB;
    transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .vpn-modal-content {
        width: 95%;
    }

    .vpn-modal-header {
        padding: 1.5rem;
    }

    .vpn-icon {
        font-size: 3rem;
    }

    .vpn-modal-header h2 {
        font-size: 1.25rem;
    }

    .vpn-modal-body {
        padding: 1.5rem;
    }

    .vpn-message {
        font-size: 1rem;
    }

    .vpn-modal-footer {
        flex-direction: column;
        padding: 1rem 1.5rem 1.5rem;
    }

    .vpn-btn {
        width: 100%;
    }
}
