/* ==========================================
   متغیرهای رنگی - تم روشن و قرمز
========================================== */
:root {
    --primary-red: #DC2626;
    --primary-dark: #B91C1C;
    --primary-light: #FCA5A5;
    --secondary-red: #EF4444;
    --accent-gold: #D97706;
    --light-bg: #FFFFFF;
    --light-card: #F8FAFC;
    --cream-bg: #FFFBEB;
    --text-dark: #1E293B;
    --text-gray: #475569;
    --text-light: #64748B;
    --border-light: #E2E8F0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-red: 0 10px 40px rgba(220, 38, 38, 0.2);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   ریست و پایه
========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.8;
    overflow-x: hidden;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ==========================================
   پس‌زمینه
========================================== */
.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.bg-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at top right, rgba(220, 38, 38, 0.03) 0%, transparent 50%),
                radial-gradient(ellipse at bottom left, rgba(217, 119, 6, 0.02) 0%, transparent 50%);
}

.bg-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23DC2626' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ==========================================
   دکمه بازگشت
========================================== */
.back-button {
    position: fixed;
    top: 30px;
    right: 30px;
    background: white;
    border: 2px solid var(--border-light);
    color: var(--text-dark);
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.back-button:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
    transform: translateX(5px);
}

.back-button.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* ==========================================
   هدر
========================================== */
.page-header {
    position: relative;
    padding: 140px 0 100px;
    text-align: center;
    z-index: 1;
    background: linear-gradient(180deg, var(--cream-bg) 0%, var(--light-bg) 100%);
}

.header-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    background: white;
    border-radius: 50%;
    padding: 15px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.header-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.header-subtitle {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 30px;
}

.header-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header-divider span {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-red));
}

.header-divider span:last-child {
    background: linear-gradient(90deg, var(--primary-red), transparent);
}

.header-divider i {
    color: var(--primary-red);
    font-size: 1rem;
}

/* ==========================================
   محتوای اصلی
========================================== */
.main-content {
    position: relative;
    z-index: 1;
    padding: 60px 0;
}

.animate-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   عنوان بخش‌ها
========================================== */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--primary-red), var(--secondary-red));
    color: white;
    padding: 14px 35px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: var(--shadow-red);
}

/* ==========================================
   بخش معرفی
========================================== */
.intro-section {
    margin-bottom: 100px;
}

.intro-card {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 50px;
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 24px;
    padding: 50px;
    box-shadow: var(--shadow-lg);
}

.intro-image {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.intro-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.intro-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.intro-content p {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--text-gray);
    margin-bottom: 20px;
    text-align: justify;
}

.intro-founder {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--light-card);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    margin-top: 30px;
}

.intro-founder img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-red);
}

.founder-label {
    font-size: 0.85rem;
    color: var(--primary-red);
    font-weight: 600;
}

.founder-info h4 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-top: 5px;
}

/* ==========================================
   تایم‌لاین تاریخچه
========================================== */
.history-section {
    margin-bottom: 100px;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-right: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-red), var(--primary-light));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding: 0 40px 50px 0;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    right: -10px;
    top: 5px;
    width: 24px;
    height: 24px;
    background: white;
    border: 4px solid var(--primary-red);
    border-radius: 50%;
    z-index: 1;
    transition: var(--transition);
}

.timeline-item.active .timeline-dot {
    background: var(--primary-red);
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.2);
}

.timeline-content {
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 16px;
    padding: 25px 30px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.timeline-item:hover .timeline-content {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.timeline-year {
    display: inline-block;
    background: var(--primary-red);
    color: white;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.timeline-content h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.timeline-content p {
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.8;
}

.animate-timeline {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-timeline.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================
   اهداف
========================================== */
.goals-section {
    margin-bottom: 100px;
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.goal-card {
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 16px;
    padding: 35px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.goal-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.goal-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-red), var(--secondary-red));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    box-shadow: var(--shadow-red);
    transition: var(--transition);
}

.goal-card:hover .goal-icon {
    transform: scale(1.1) rotate(10deg);
}

.goal-card h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.goal-card p {
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.8;
}

.animate-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   آمار
========================================== */
.stats-section {
    margin-bottom: 100px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-dark));
    border-radius: 24px;
    padding: 50px;
    box-shadow: var(--shadow-red);
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-item .stat-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-item .stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.stat-item .stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* ==========================================
   گالری
========================================== */
.gallery-section {
    margin-bottom: 100px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    background: var(--light-card);
}

.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay span {
    font-size: 1rem;
    font-weight: 600;
}

.animate-gallery {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-gallery.visible {
    opacity: 1;
    transform: scale(1);
}

/* ==========================================
   لایت‌باکس
========================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-close:hover {
    background: var(--primary-red);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-nav:hover {
    background: var(--primary-red);
}

.lightbox-nav.prev {
    right: 30px;
}

.lightbox-nav.next {
    left: 30px;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85%;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    color: white;
    font-size: 1.1rem;
    margin-top: 20px;
}

/* ==========================================
   درباره حکیم
========================================== */
.hakim-section {
    margin-bottom: 80px;
}

.hakim-card {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 50px;
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 24px;
    padding: 50px;
    box-shadow: var(--shadow-lg);
}

.hakim-image {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.hakim-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hakim-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.hakim-content p {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--text-gray);
    margin-bottom: 20px;
    text-align: justify;
}

.hakim-quote {
    position: relative;
    padding: 25px 30px;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05), rgba(217, 119, 6, 0.03));
    border-radius: 16px;
    border-right: 4px solid var(--primary-red);
    margin-top: 30px;
}

.hakim-quote i {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: rgba(220, 38, 38, 0.15);
}

.hakim-quote p {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-dark);
    margin: 0;
}

/* ==========================================
   فوتر
========================================== */
.page-footer {
    background: var(--light-card);
    border-top: 2px solid var(--border-light);
    padding: 50px 0;
}

.footer-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
    text-align: center;
}

.footer-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: white;
    border-radius: 50%;
    padding: 10px;
    box-shadow: var(--shadow-sm);
}

.footer-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.footer-text {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 10px;
    font-weight: 500;
}

.footer-copyright {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ==========================================
   ریسپانسیو
========================================== */
@media (max-width: 1200px) {
    .container {
        padding: 0 30px;
    }
    .intro-card {
        grid-template-columns: 350px 1fr;
        gap: 40px;
    }
    .goals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .intro-card {
        grid-template-columns: 1fr;
        padding: 35px;
    }
    .intro-image {
        max-height: 350px;
    }
    .hakim-card {
        grid-template-columns: 1fr;
        padding: 35px;
    }
    .hakim-image {
        max-height: 350px;
    }
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-item.large {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    .back-button {
        top: 20px;
        right: 20px;
        padding: 12px 18px;
    }
    .back-button span {
        display: none;
    }
    .page-header {
        padding: 120px 0 80px;
    }
    .header-title {
        font-size: 2.2rem;
    }
    .header-logo {
        width: 100px;
        height: 100px;
    }
    .intro-card {
        padding: 25px;
    }
    .intro-content h2 {
        font-size: 1.6rem;
    }
    .timeline {
        padding-right: 30px;
    }
    .timeline-content {
        padding: 20px;
    }
    .goals-grid {
        grid-template-columns: 1fr;
    }
    .stats-container {
        padding: 35px 25px;
    }
    .stat-item .stat-number {
        font-size: 2.5rem;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 250px;
    }
    .gallery-item.large {
        grid-column: span 1;
        grid-row: span 1;
    }
    .hakim-card {
        padding: 25px;
    }
    .hakim-content h2 {
        font-size: 1.6rem;
    }
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    .lightbox-nav.prev {
        right: 15px;
    }
    .lightbox-nav.next {
        left: 15px;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.8rem;
    }
    .header-subtitle {
        font-size: 1rem;
    }
    .section-badge {
        padding: 12px 25px;
        font-size: 1rem;
    }
    .intro-founder {
        flex-direction: column;
        text-align: center;
    }
    .timeline::before {
        right: 10px;
    }
    .timeline-item {
        padding-right: 30px;
    }
    .timeline-dot {
        right: 0;
        width: 20px;
        height: 20px;
    }
    .goal-card {
        padding: 25px;
    }
    .stats-container {
        grid-template-columns: 1fr;
    }
    .stat-item .stat-number {
        font-size: 2rem;
    }
    .hakim-quote {
        padding: 20px;
    }
}

/* ==========================================
   بخش تخصص‌های حکیم
========================================== */
.hakim-expertise {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05), rgba(239, 68, 68, 0.02));
    border-radius: 16px;
    padding: 30px;
    margin: 30px 0;
    border-right: 4px solid var(--primary-red);
}

.hakim-expertise h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hakim-expertise h3 i {
    color: var(--primary-red);
}

.expertise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.expertise-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.expertise-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.15);
}

.expertise-item i {
    font-size: 2rem;
    color: var(--primary-red);
    margin-bottom: 10px;
}

.expertise-item span {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 8px;
}

.expertise-item p {
    font-size: 0.85rem;
    color: #475569;
    margin: 0;
}

/* ==========================================
   بخش میراث علمی
========================================== */
.hakim-legacy {
    background: #F8FAFC;
    border-radius: 16px;
    padding: 25px;
    margin: 25px 0;
}

.hakim-legacy h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hakim-legacy h3 i {
    color: var(--primary-red);
}

.hakim-legacy p {
    color: #334155;
    line-height: 1.9;
    margin-bottom: 12px;
}

/* ==========================================
   بخش سبک زندگی
========================================== */
.hakim-lifestyle {
    margin: 25px 0;
}

.hakim-lifestyle h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hakim-lifestyle h3 i {
    color: var(--primary-red);
}

.hakim-lifestyle ul {
    list-style: none;
    padding: 0;
}

.hakim-lifestyle li {
    position: relative;
    padding-right: 30px;
    margin-bottom: 12px;
    color: #334155;
    line-height: 1.8;
}

.hakim-lifestyle li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0;
    color: var(--primary-red);
}

/* ==========================================
   نقل قول بهبود یافته
========================================== */
.hakim-quote {
    background: linear-gradient(135deg, var(--primary-red), #B91C1C);
    color: white;
    padding: 30px;
    border-radius: 16px;
    margin: 30px 0;
    position: relative;
    text-align: center;
}

.hakim-quote i {
    font-size: 2rem;
    opacity: 0.3;
    margin-bottom: 15px;
}

.hakim-quote p {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 2;
    margin: 0 0 15px 0;
}

.quote-source {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ==========================================
   پیوند با جشنواره
========================================== */
.hakim-festival-connection {
    background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
    border-radius: 16px;
    padding: 25px;
    margin-top: 25px;
    border: 2px solid rgba(220, 38, 38, 0.2);
}

.hakim-festival-connection h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hakim-festival-connection h3 i {
    color: var(--primary-red);
}

.hakim-festival-connection p {
    color: #334155;
    line-height: 1.9;
    margin-bottom: 12px;
}

.hakim-festival-connection p:last-child {
    margin-bottom: 0;
}

/* ==========================================
   ریسپانسیو
========================================== */
@media (max-width: 768px) {
    .expertise-grid {
        grid-template-columns: 1fr;
    }

    .hakim-expertise,
    .hakim-legacy,
    .hakim-festival-connection {
        padding: 20px;
    }

    .hakim-quote p {
        font-size: 1rem;
    }
}