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

:root {
    --primary-color: #2c5f2d;
    --secondary-color: #97be5a;
    --accent-color: #d4af37;
    --text-color: #2d3748;
    --light-bg: #f7fafc;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(44, 95, 45, 0.1);
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.8;
    color: var(--text-color);
    background-color: var(--light-bg);
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Language Selector */
.language-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: var(--white);
    color: var(--primary-color);
    border-color: var(--white);
    font-weight: 600;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,106.7C1248,96,1344,96,1392,96L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') bottom center no-repeat;
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.main-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.95;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    display: inline-block;
    background: var(--white);
    color: var(--primary-color);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    text-align: center;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-outline {
    display: inline-block;
    background: transparent;
    color: var(--primary-color);
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Section Title */
.section-title {
    color: var(--primary-color);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 100px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Book and Resources Section */
.book-section {
    padding: 4rem 0;
    background: linear-gradient(to bottom, var(--white) 0%, var(--light-bg) 100%);
}

.book-showcase {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

/* Book Cover Display */
.book-cover-display {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cover-wrapper {
    position: relative;
    max-width: 350px;
    width: 100%;
}

.featured-cover {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.4s ease;
    display: block;
}

.featured-cover:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.cover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 1.5rem;
    border-radius: 0 0 15px 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cover-wrapper:hover .cover-overlay {
    opacity: 1;
}

.zoom-hint {
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
    text-align: center;
}

/* Book Info */
.book-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.book-main-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 0;
    font-weight: 700;
}

.book-subtitle {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
    margin: -1rem 0 0 0;
    line-height: 1.8;
}

/* Action Buttons */
.book-actions-grid {
    display: grid;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.action-btn svg {
    flex-shrink: 0;
}

.primary-action {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow);
}

.primary-action:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.secondary-action {
    background: var(--accent-color);
    color: var(--white);
    box-shadow: var(--shadow);
}

.secondary-action:hover {
    background: #c4a028;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.outline-action {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.outline-action:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Guide Link */
.guide-link-section {
    padding-top: 1rem;
    border-top: 2px solid var(--light-bg);
}

.guide-quick-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.guide-quick-link:hover {
    gap: 1rem;
    color: var(--secondary-color);
}

.guide-quick-link svg {
    transition: transform 0.3s ease;
}

.guide-quick-link:hover svg {
    transform: scale(1.1);
}

/* Table of Contents Section */
.toc-section {
    padding: 4rem 0;
    background: linear-gradient(to bottom, var(--white) 0%, var(--light-bg) 100%);
}

.chapter-list {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    gap: 1rem;
}

.chapter-link {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: var(--white);
    border-radius: 10px;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.chapter-link:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-lg);
    background: var(--light-bg);
}

.chapter-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 600;
}

.chapter-title {
    flex: 1;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 500;
}

.chapter-arrow {
    color: var(--primary-color);
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.chapter-link:hover .chapter-arrow {
    transform: translateX(-5px);
}

.chapter-link:hover .chapter-number {
    background: var(--secondary-color);
}

/* Video Section */
.video-section {
    padding: 5rem 0;
    background: var(--white);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.video-card,
.video-placeholder {
    background: var(--light-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover,
.video-placeholder:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.video-thumbnail-link {
    display: block;
    text-decoration: none;
}

.video-thumbnail {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    cursor: pointer;
    background: #000;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.video-thumbnail:hover img {
    opacity: 0.8;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: transform 0.3s ease;
}

.video-thumbnail:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-card h3,
.video-placeholder h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    padding: 1.5rem;
    padding-bottom: 0.5rem;
    text-align: center;
}

.video-card h4 {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
    padding: 1rem 1.5rem 1.5rem;
    margin: 0;
    text-align: center;
    line-height: 1.6;
}

.video-card p,
.video-placeholder p {
    color: var(--text-color);
    padding: 0 1.5rem 0.5rem;
    opacity: 0.8;
}

.video-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem 1.5rem;
    margin: 0 1.5rem 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.video-link:hover {
    background: var(--primary-color);
    color: var(--white);
}

.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.placeholder-content {
    text-align: center;
    padding: 2rem;
}

.coming-soon {
    display: inline-block;
    background: var(--accent-color);
    color: var(--white);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

footer p {
    opacity: 0.9;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000;
    line-height: 1;
    -webkit-user-select: none;
    user-select: none;
}

.close-modal:hover {
    color: var(--accent-color);
    transform: rotate(90deg);
}

/* About Modal Dialog */
.modal-dialog {
    background: var(--white);
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 2px solid var(--light-bg);
}

.modal-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: 0;
}

.modal-header .close-modal {
    position: static;
    color: var(--text-color);
    font-size: 2rem;
}

.modal-body {
    padding: 2rem;
}

.modal-body p {
    font-size: 1.05rem;
    line-height: 2;
    text-align: justify;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* PDF Modal Dialog */
.pdf-modal-dialog {
    background: var(--white);
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease;
}

.pdf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    flex-shrink: 0;
}

.pdf-modal-header h2 {
    color: var(--white);
    font-size: 1.3rem;
    margin: 0;
    font-weight: 600;
}

.pdf-modal-header .close-modal {
    position: static;
    color: var(--white);
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pdf-modal-header .close-modal:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.pdf-modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    position: relative;
    background: #525659;
}

.pdf-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-title {
        font-size: 3rem;
    }

    .book-resources-grid {
        grid-template-columns: 1fr;
    }
}

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

    .main-title {
        font-size: 2.2rem;
        letter-spacing: 1px;
    }

    .hero-section {
        padding: 2.5rem 0;
    }

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

    .video-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .video-section,
    .book-section,
    .toc-section {
        padding: 2.5rem 0;
    }

    .video-link {
        display: block;
        width: calc(100% - 3rem);
        text-align: center;
        margin: 1rem 1.5rem;
    }

    /* Book Showcase Responsive */
    .book-showcase {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .cover-wrapper {
        max-width: 280px;
        margin: 0 auto;
    }

    .book-main-title {
        font-size: 2rem;
        text-align: center;
    }

    .book-subtitle {
        font-size: 1rem;
        text-align: center;
    }

    .action-btn {
        padding: 0.9rem 1.3rem;
        font-size: 0.95rem;
    }

    .guide-link-section {
        text-align: center;
    }

    .book-cover-img {
        max-width: 180px;
    }

    .chapter-link {
        padding: 1.2rem 1.5rem;
        gap: 1rem;
    }

    .chapter-number {
        min-width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .chapter-title {
        font-size: 1.05rem;
    }

    .chapter-arrow {
        font-size: 1.3rem;
    }

    .modal-dialog {
        width: 95%;
    }

    .modal-header {
        padding: 1.5rem;
    }

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

    .modal-body {
        padding: 1.5rem;
    }

    .pdf-modal-header {
        padding: 0.8rem 1rem;
    }

    .pdf-modal-header h2 {
        font-size: 1.1rem;
    }

    .pdf-modal-header .close-modal {
        font-size: 2rem;
    }

    footer {
        margin-top: 2rem;
        padding: 1.5rem 0;
    }

    footer p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.8rem;
    }

    .main-title {
        font-size: 1.8rem;
        letter-spacing: 0.5px;
    }

    .hero-section {
        padding: 2rem 0;
    }

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

    .section-title::after {
        width: 80px;
    }

    .video-card h3,
    .video-placeholder h3 {
        font-size: 1.3rem;
        padding: 1.2rem;
        padding-bottom: 0.5rem;
    }

    .video-card h4 {
        font-size: 1.15rem;
        padding: 0.8rem 1.2rem 1.2rem;
    }

    .video-card p,
    .video-placeholder p {
        font-size: 0.9rem;
        padding: 0 1.2rem 0.5rem;
    }

    .video-link {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
        margin: 1rem 1.2rem;
    }

    .video-grid {
        gap: 1.5rem;
    }

    .video-section,
    .book-section,
    .toc-section {
        padding: 2rem 0;
    }

    .coming-soon {
        font-size: 0.85rem;
        padding: 0.4rem 1.2rem;
    }

    .video-placeholder {
        min-height: 280px;
    }

    /* Book Showcase Responsive */
    .book-showcase {
        gap: 2rem;
    }

    .cover-wrapper {
        max-width: 220px;
    }

    .featured-cover {
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    }

    .book-main-title {
        font-size: 1.7rem;
    }

    .book-subtitle {
        font-size: 0.95rem;
        margin-top: -0.5rem;
    }

    .action-btn {
        padding: 0.85rem 1.2rem;
        font-size: 0.9rem;
        gap: 0.6rem;
    }

    .action-btn svg {
        width: 18px;
        height: 18px;
    }

    .guide-quick-link {
        font-size: 0.95rem;
    }

    .book-cover-img {
        max-width: 150px;
    }

    .book-title {
        font-size: 1.3rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }

    .btn-outline {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .guide-card h3 {
        font-size: 1.3rem;
    }

    .guide-card p {
        font-size: 0.9rem;
    }

    .chapter-link {
        padding: 1rem 1.2rem;
        gap: 0.8rem;
    }

    .chapter-number {
        min-width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .chapter-title {
        font-size: 0.95rem;
    }

    .chapter-arrow {
        font-size: 1.2rem;
    }

    .close-modal {
        top: 10px;
        right: 15px;
        font-size: 40px;
    }

    .modal-content {
        max-width: 95%;
        max-height: 95vh;
    }

    .modal-dialog {
        width: 98%;
    }

    .modal-header {
        padding: 1.2rem;
    }

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

    .modal-header .close-modal {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 1.2rem;
    }

    .modal-body p {
        font-size: 0.95rem;
    }

    .pdf-modal-header {
        padding: 0.7rem 0.8rem;
    }

    .pdf-modal-header h2 {
        font-size: 1rem;
    }

    .pdf-modal-header .close-modal {
        font-size: 1.8rem;
    }

    footer {
        margin-top: 1.5rem;
        padding: 1.2rem 0;
    }

    footer p {
        font-size: 0.85rem;
        padding: 0 0.5rem;
    }
}

@media (max-width: 360px) {
    .main-title {
        font-size: 1.6rem;
    }

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

    /* Book Showcase Responsive */
    .cover-wrapper {
        max-width: 180px;
    }

    .book-main-title {
        font-size: 1.5rem;
    }

    .book-subtitle {
        font-size: 0.9rem;
    }

    .action-btn {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }

    .action-btn svg {
        width: 16px;
        height: 16px;
    }

    .book-cover-img {
        max-width: 130px;
    }

    .chapter-number {
        min-width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .chapter-title {
        font-size: 0.9rem;
    }

    .modal-body p {
        font-size: 0.9rem;
    }

    .container {
        padding: 0 0.6rem;
    }

    .book-resources-grid {
        gap: 2rem;
    }
}

/* Print Styles */
/* LTR Language Adjustments */
[dir="ltr"] .chapter-arrow {
    transform: rotate(180deg);
}

[dir="ltr"] body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

[dir="ltr"] .video-grid,
[dir="ltr"] .book-showcase,
[dir="ltr"] .book-actions-grid,
[dir="ltr"] .chapter-list {
    flex-direction: row;
}

[dir="ltr"] .chapter-link {
    flex-direction: row;
}

[dir="ltr"] .book-info {
    text-align: left;
}

@media print {
    .video-section,
    footer {
        display: none;
    }

    body {
        background: white;
    }

    .content-text {
        box-shadow: none;
    }
}
