/* ==========================================================================
   1. Base Styles & Resets
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Define custom font for Persian text */
.gulzar-regular {
    font-family: "Gulzar", serif;
    font-weight: 400;
    font-style: normal;
}

/* Justify text for specific elements */
p, h2, h3, dt, dd {
    text-align: justify;
}

/* Base styling for the body */
body {
    background-color: #ffffff;
    color: #000000;
    line-height: 1.7;
    padding-left: 70px;
}

/* Base styling for the body */
body {
    background-color: #ffffff;
    color: #000000;
    line-height: 1.7;
    padding-left: 70px; /* Space for fixed language toggle on desktop */
}

/* Language toggle styling for desktop and tablet */
.language-toggle {
    position: fixed;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 2000;
}

/* Individual language toggle buttons */
.language-toggle button {
    width: 40px;
    height: 40px;
    border: none;
    background: #000000;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
}

/* Active state for language toggle buttons */
.language-toggle button.active {
    background: #333333;
    transform: scale(1.1);
}

/* Hover state for language toggle buttons */
.language-toggle button:hover {
    background: #333333;
    transform: scale(1.1);
}

/* Icon styling within language toggle buttons */
.lang-icon {
    font-size: 1.2rem;
}

/* Header styling */
header {
    background: #ffffff;
    text-align: center;
    padding: 2rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

/* Center header text */
header h1,
header p {
    text-align: center; /* Override justify for header */
}

/* ==========================================================================
   3. Header
   ========================================================================== */

header {
    background: #ffffff;
    text-align: center;
    padding: 2rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

header h1,h2,h3,h4,h5, header p {
    font-family: "Gulzar", serif;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
    color: #333;
}

/* Navigation bar styling */
nav {
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 1rem; /* Add padding to prevent menu hitting edges */
}

/* Hamburger menu for mobile */
.hamburger {
    display: none; /* Hidden by default on desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 1rem;
    position: absolute; /* Position relative to nav */
    top: 5px;
    right: 15px; /* Adjust position */
    z-index: 1100;
}

/* Hamburger menu lines */
.hamburger span {
    width: 100%;
    height: 3px;
    background: #000000;
    transition: background 0.3s ease;
}

/* Hamburger menu hover effect */
.hamburger:hover span {
    background: #333333;
}

/* Navigation menu container */
.nav-menu {
    display: flex;
    justify-content: center;
}

/* Navigation list */
nav ul {
    display: flex;
    list-style: none;
    padding: 0.5rem 0; /* Reduced padding for a tighter look */
    align-items: center; /* Vertically align items */
}

/* Navigation list items */
nav ul li {
    margin: 0 1.2rem; /* Default margin for desktop */
    white-space: nowrap; /* Prevent menu items from wrapping */
}

/* Navigation links */
nav ul li a {
    text-decoration: none;
    color: #000000;
    font-weight: 600;
    font-size: 1.05rem; /* Default font size for desktop */
    transition: color 0.3s ease, font-size 0.3s ease;
    padding: 0.5rem;
}

/* Navigation link hover effect */
nav ul li a:hover {
    color: #333333;
}

/* Special button styling for nav items */
nav ul li a.btn {
    background: #ffffff;
    color: #000000;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    transition: background 0.3s ease;
}

nav ul li a.btn:hover {
    background: #333333;
    color: #ffffff;
}

/* Close menu button (hidden by default) */
.close-menu {
    display: none;
}

/* Main content container */
main {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Section styling */
section {
    background: #ffffff;
    padding: 2.5rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, opacity 0.5s ease;
    opacity: 0;
    transform: translateY(20px);
}

section:hover {
    transform: translateY(-5px);
}

section.download-section {
    background: #f8f8f8;
    border-top: 4px solid #000000;
}

section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 1.2rem;
    position: relative;
    padding-bottom: 10px;
}

section h2::after {
    content: '';
    width: 50px;
    height: 3px;
    background: #000000;
    position: absolute;
    bottom: 0;
    right: 0;
}
[dir="ltr"] section h2::after {
    left: 0;
    right: auto;
}

section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
}

section p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.content-fa {
    display: block;
}

.content-en {
    display: none;
}

.website-link, .email-link {
    font-weight: 600;
    color: #000000;
    text-decoration: none;
}

.creator-info {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 8px;
}

.creator-info dt {
    font-weight: 600;
    color: #333;
}

.creator-info dd {
    margin: 0;
}

.download-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.download-card {
    background: #f0f0f0;
    padding: 1.5rem;
    border: 3px solid #000000;
    border-radius: 12px;
    text-align: center;
    width: 280px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.download-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.download-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-align: center;
}

.download-card a.btn {
    margin-bottom: 1rem;
}

.download-card img {
    width: 140px;
    height: 140px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.4rem;
    background: #ffffff;
    color: #000000;
    border: 1px solid #000000;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 6px;
    min-width: 140px;
    min-height: 48px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

footer {
    background: #ffffff;
    color: #000000;
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

footer p {
    font-size: 1rem;
    text-align: center;
}

/* ------------------------------------------------------------------ */
/* Styles for Landscape Tablets (993px to 1200px) - فونت کوچکتر      */
/* ------------------------------------------------------------------ */
@media (min-width: 993px) and (max-width: 1200px) {
    nav ul li {
        margin: 0 0.6rem; /* کاهش فاصله بین آیتم‌ها */
    }

    nav ul li a {
        font-size: 0.9rem; /* کوچک کردن فونت آیتم‌های معمولی */
    }
    
    /* کوچک کردن دکمه‌های داخل منو */
    nav ul li a.btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}


/* ---------------------------------------------------------- */
/* Hamburger Menu for Tablets & Mobiles (Screens <= 992px)    */
/* ---------------------------------------------------------- */
@media (max-width: 992px) {
    body {
        padding-left: 0;
        padding-top: 60px;
    }

    nav {
        padding: 0;
        display: flex;
        justify-content: flex-end;
    }
     [dir="rtl"] nav {
        justify-content: flex-start;
    }

    .language-toggle {
        top: 15px;
        left: 15px;
        transform: none;
        flex-direction: row;
        gap: 0.5rem;
    }
    
    [dir="ltr"] .language-toggle {
        left: auto;
        right: 70px;
    }
    
     [dir="rtl"] .language-toggle {
        right: auto;
        left: 70px;
    }

    .language-toggle button {
        width: 35px;
        height: 35px;
    }
    
    header {
        padding-top: 4rem;
    }

    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }

    .hamburger {
        display: flex;
    }
    
    [dir="rtl"] .hamburger {
        left: 15px;
        right: auto;
    }

    nav ul {
        display: none;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100%;
        background: #ffffff;
        flex-direction: column;
        justify-content: flex-start;
        padding: 4rem 1.5rem 1.5rem;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
        transition: right 0.4s ease-in-out;
        z-index: 1050;
    }
    
    [dir="ltr"] .nav-menu {
        left: -100%;
        right: auto;
        transition: left 0.4s ease-in-out;
    }
    
    .nav-menu.open {
        right: 0;
    }

    [dir="ltr"] .nav-menu.open {
        left: 0;
    }
    
    .nav-menu ul {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding-top: 1rem;
    }

    .nav-menu ul li {
        margin: 0.8rem 0;
        width: 100%;
    }

    .nav-menu ul li a {
        font-size: 1.1rem;
        padding: 0.5rem;
        display: block;
        width: 100%;
    }

    .close-menu {
        display: block;
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        background: none;
        border: none;
        font-size: 2rem;
        cursor: pointer;
        color: #000000;
    }
    
     [dir="ltr"] .close-menu {
        right: auto;
        left: 1.5rem;
    }

    section {
        padding: 1.5rem;
    }

    section h2 {
        font-size: 1.6rem;
    }
}