/* 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 {
    scroll-behavior: smooth;
    -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;
}

/* Header Top */
.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.home-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--white);
    transition: all 0.3s ease;
    text-decoration: none;
}

.home-link:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.home-link svg {
    width: 20px;
    height: 20px;
}

/* Language Selector */
.language-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    padding: 0.35rem 0.7rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--white);
    font-size: 0.8rem;
}

.lang-btn .flag-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
    border-radius: 2px;
}

.lang-btn .flag {
    font-size: 0.8rem;
    line-height: 1;
    display: block;
}

.lang-btn .lang-name {
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.lang-btn.active {
    display: none;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 1.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: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.subtitle {
    font-size: 1.1rem;
    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;
}

/* Visual Prayer Guide Section */
.visual-guide-section {
    padding: 4rem 0;
    background: var(--white);
    text-align: center;
}

.svg-slider-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.svg-slider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.svg-display {
    flex: 1;
    max-width: 700px;
    width: 100%;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: auto;
    touch-action: none;
    cursor: grab;
}

.svg-display:active {
    cursor: grabbing;
}

.svg-display.zoomed {
    cursor: move;
}

.svg-display::before {
    content: '';
    display: block;
    padding-top: 141.4%; /* A4 ratio (297/210 = 1.414) */
}

.svg-page-image {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: calc(100% - 2rem);
    height: calc(100% - 2rem);
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.2s ease;
    transform-origin: center center;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
}

.svg-nav-btn {
    background: var(--primary-color);
    border: none;
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.svg-nav-btn:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.svg-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.svg-nav-btn svg {
    pointer-events: none;
}

.svg-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: none;
}

.svg-loading-spinner.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(44, 95, 45, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.zoom-hint-icon {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    background: rgba(44, 95, 45, 0.9);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 3;
    pointer-events: auto;
}

.zoom-hint-icon:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.zoom-hint-icon svg {
    flex-shrink: 0;
}

.svg-display.zoomed .zoom-hint-icon {
    opacity: 0.5;
}

.svg-display.zoomed .zoom-hint-icon:hover {
    opacity: 1;
}

.svg-page-indicator {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.pdf-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pdf-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.pdf-control-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.pdf-control-btn svg {
    flex-shrink: 0;
}

/* 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;
}

/* Upcoming video styling */
.upcoming-video .video-thumbnail {
    position: relative;
    cursor: default;
}

.upcoming-video .video-thumbnail .coming-soon {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    margin-bottom: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 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: 1.25rem 0;
    }

    .language-selector {
        gap: 0.4rem;
        margin-bottom: 1rem;
    }

    .lang-btn {
        padding: 0.3rem 0.6rem;
        gap: 0.3rem;
    }

    .lang-btn .flag-icon {
        width: 18px;
        height: 18px;
    }

    .lang-btn .flag {
        font-size: 0.75rem;
    }

    .lang-btn .lang-name {
        font-size: 0.85rem;
    }

    .main-title {
        font-size: 1.8rem;
        margin-bottom: 0.35rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .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;
    }

    /* SVG Slider Responsive */
    .svg-slider-container {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1rem;
        align-items: center;
    }

    .svg-display {
        max-width: 100%;
        width: 100%;
        order: 2;
    }

    .svg-display::before {
        padding-top: 141.4%; /* Keep A4 ratio */
    }

    .svg-nav-btn {
        position: static;
        transform: none;
        width: 48px;
        height: 48px;
        background: var(--primary-color);
    }

    .svg-prev-btn {
        order: 1;
    }

    .svg-next-btn {
        order: 3;
    }

    .svg-page-indicator {
        font-size: 1rem;
        width: 100%;
        order: 4;
        margin-top: 0;
        margin-bottom: 0.75rem;
    }

    .pdf-controls {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }

    .pdf-control-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    /* 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;
    }

    .hero-section {
        padding: 1rem 0;
    }

    .language-selector {
        gap: 0.3rem;
        margin-bottom: 0.75rem;
    }

    .lang-btn {
        padding: 0.25rem 0.5rem;
        gap: 0.25rem;
        border-width: 1px;
    }

    .lang-btn .flag-icon {
        width: 16px;
        height: 16px;
    }

    .lang-btn .flag {
        font-size: 0.7rem;
    }

    .lang-btn .lang-name {
        font-size: 0.8rem;
    }

    .main-title {
        font-size: 1.5rem;
        letter-spacing: 0.5px;
        margin-bottom: 0.25rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .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,
    .visual-guide-section {
        padding: 2rem 0;
    }

    /* SVG Slider Small Mobile */
    .svg-slider-container {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .svg-display {
        max-width: 100%;
        width: 100%;
        padding: 0.5rem;
        border-radius: 8px;
    }

    .svg-display::before {
        padding-top: 141.4%; /* Keep A4 ratio on small screens */
    }

    .svg-nav-btn {
        width: 44px;
        height: 44px;
    }

    .svg-page-indicator {
        font-size: 0.95rem;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .zoom-hint-icon {
        width: 36px;
        height: 36px;
        bottom: 1rem;
        right: 1rem;
    }

    .zoom-hint-icon svg {
        width: 18px;
        height: 18px;
    }

    .pdf-control-btn {
        padding: 0.65rem 1.2rem;
        font-size: 0.9rem;
    }

    .pdf-control-btn svg {
        width: 18px;
        height: 18px;
    }

    .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;
}

/* Prayer Audio Section */
.prayer-audio-section {
    padding: 1.5rem 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.prayer-audio-section .prayer-carousel {
    margin-top: 0.75rem;
}

.prayer-audio-section .section-title {
    margin-bottom: 0.25rem;
    font-size: 1.75rem;
}

.prayer-audio-section .section-description {
    margin: 0 auto 0.75rem;
    font-size: 0.95rem;
}

.section-description {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-color);
    margin: -1rem auto 2.5rem;
    max-width: 600px;
    opacity: 0.85;
}

#openPrayerBtn {
    margin: 0 auto;
    display: flex;
}

/* Prayer Modal */
#prayerModal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: auto;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.prayer-modal-content {
    position: relative;
    background-color: var(--white);
    margin: 2% auto;
    padding: 0;
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--light-bg);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    border-radius: 16px 16px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--white);
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Prayer Carousel */
.prayer-carousel {
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 600px;
    padding: 1rem;
}

.prayer-card-container {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 1rem;
    min-height: 450px;
}

.prayer-card-container .prayer-item {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    transform: translateX(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.prayer-item {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.prayer-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.prayer-item.playing {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
}

.prayer-item.playing .prayer-number,
.prayer-item.playing .prayer-arabic,
.prayer-item.playing .prayer-transliteration,
.prayer-item.playing .prayer-english {
    color: var(--white);
}

.prayer-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.prayer-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.prayer-item.playing .prayer-number {
    background: var(--white);
    color: #667eea;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.prayer-content {
    width: 100%;
}

.prayer-arabic {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    line-height: 1.6;
    font-family: 'Traditional Arabic', 'Arial', sans-serif;
}

.prayer-transliteration {
    font-size: 1.4rem;
    color: #718096;
    margin-bottom: 0.5rem;
    font-weight: 600;
    direction: rtl;
}

.prayer-english {
    font-size: 1.6rem;
    color: #2d3748;
    font-weight: 700;
    direction: ltr;
    text-align: center;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.prayer-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    width: 100%;
}

.prayer-action-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.prayer-action-section:hover {
    background: rgba(102, 126, 234, 0.1);
}

.prayer-action-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
}

.play-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all 0.3s ease;
    cursor: pointer;
}

.play-icon:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.prayer-item.playing .play-icon {
    background: var(--white);
    color: #667eea;
}

.play-icon svg {
    width: 24px;
    height: 24px;
}

.mic-btn {
    width: 56px;
    height: 56px;
    background: #10b981;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mic-btn:hover {
    background: #059669;
    transform: scale(1.1);
}

.mic-btn.recording {
    background: #ef4444;
    animation: pulse 1.5s ease-in-out infinite;
}

.mic-btn svg {
    width: 24px;
    height: 24px;
}

.prayer-item.playing .prayer-transliteration,
.prayer-item.playing .prayer-english {
    color: rgba(255, 255, 255, 0.95);
}

.audio-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.audio-progress-bar {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.1s linear;
}

.prayer-item.playing .audio-progress-bar {
    background: var(--white);
}

/* Prayer Navigation */
.prayer-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.nav-btn {
    background: var(--primary-color);
    border: none;
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.nav-btn:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.prayer-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    min-width: 80px;
    justify-content: center;
}

.progress-separator {
    color: var(--primary-color);
    font-weight: 400;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    width: 5%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* RTL Adjustments for Navigation Buttons */
/* Arrows remain the same in both RTL and LTR */

/* LTR Adjustments for Prayer Section */
[dir="ltr"] .prayer-english {
    text-align: center;
    direction: ltr;
}

[dir="ltr"] .prayer-header {
    flex-direction: row-reverse;
}

/* Pronunciation Feature Styles */
.prayer-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.mic-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    position: relative;
    z-index: 10; /* Ensure button is above recording indicator */
}

.mic-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(1.1);
}

.mic-btn.recording {
    background: #dc3545;
    border-color: #dc3545;
    color: var(--white);
    animation: pulse-recording 1.5s ease-in-out infinite;
}

@keyframes pulse-recording {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
}

/* Pronunciation Modal */
.pronunciation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10001;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.pronunciation-modal-content {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.pronunciation-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.pronunciation-close-btn:hover {
    background: #f0f0f0;
    color: var(--text-color);
}

/* Loading State */
.pronunciation-loading {
    text-align: center;
    padding: 3rem 1rem;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Pronunciation Result */
.pronunciation-result {
    padding: 1rem;
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.score-emoji {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.result-header h3 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin: 0;
}

/* Score Circle */
.score-display {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.score-circle {
    position: relative;
    width: 150px;
    height: 150px;
}

.score-circle svg {
    width: 100%;
    height: 100%;
}

.pronunciation-result.excellent circle:last-child { stroke: #28a745; }
.pronunciation-result.good circle:last-child { stroke: #17a2b8; }
.pronunciation-result.fair circle:last-child { stroke: #ffc107; }
.pronunciation-result.needs-improvement circle:last-child { stroke: #dc3545; }

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
}

.score-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
}

/* Pronunciation Details */
.pronunciation-details {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.detail-item {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.detail-item span {
    color: var(--text-color);
    font-size: 1.1rem;
}

/* Word Analysis */
.word-analysis {
    margin-top: 1.5rem;
}

.word-analysis h4 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.word-item {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
}

.word-item.correct {
    background: #d4edda;
    color: #155724;
}

.word-item.close {
    background: #fff3cd;
    color: #856404;
}

.word-item.incorrect {
    background: #f8d7da;
    color: #721c24;
}

/* Feedback Actions */
.feedback-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.feedback-actions button {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-try-again {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-try-again:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-next-prayer {
    background: var(--primary-color);
    color: var(--white);
}

.btn-next-prayer:hover {
    background: var(--secondary-color);
}

/* Error State */
.pronunciation-error {
    text-align: center;
    padding: 2rem 1rem;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.pronunciation-error h3 {
    color: #dc3545;
    margin-bottom: 1rem;
}

.pronunciation-error p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-close-error {
    padding: 0.875rem 2rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close-error:hover {
    background: var(--secondary-color);
}

/* Responsive Design for Prayer Modal */
@media (max-width: 768px) {
    .prayer-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .modal-header {
        padding: 1rem 1.25rem;
        border-radius: 0;
    }

    .modal-header h2 {
        font-size: 1.15rem;
    }

    .close-btn {
        width: 38px;
        height: 38px;
    }

    .prayer-carousel {
        height: auto;
        max-height: 500px;
        padding: 0.75rem;
    }

    .prayer-card-container {
        margin-bottom: 0.75rem;
        min-height: auto;
    }

    .prayer-item {
        padding: 1.5rem 1rem;
        border-radius: 10px;
        min-height: auto;
    }

    .prayer-header {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .prayer-arabic {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
        line-height: 1.5;
    }

    .prayer-english {
        font-size: 1.2rem;
        line-height: 1.4;
        margin-bottom: 0.4rem;
    }

    .prayer-transliteration {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }

    .prayer-actions {
        gap: 0.75rem;
        margin-top: 1rem;
    }

    .prayer-action-section {
        padding: 0.75rem;
        gap: 0.4rem;
    }

    .prayer-action-label {
        font-size: 0.85rem;
    }

    .play-icon,
    .mic-btn {
        width: 48px;
        height: 48px;
    }

    .play-icon svg,
    .mic-btn svg {
        width: 20px;
        height: 20px;
    }

    .prayer-number {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    .prayer-navigation {
        gap: 1.5rem;
        margin-bottom: 1rem;
    }

    .nav-btn {
        width: 48px;
        height: 48px;
    }

    .prayer-progress {
        font-size: 1.15rem;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 0.875rem 1rem;
    }

    .modal-header h2 {
        font-size: 1.05rem;
    }

    .close-btn {
        width: 36px;
        height: 36px;
    }

    .prayer-carousel {
        height: auto;
        max-height: 450px;
        padding: 0.625rem;
    }

    .prayer-card-container {
        margin-bottom: 0.625rem;
        min-height: 0;
    }

    .prayer-item {
        padding: 1.25rem 0.875rem;
        border-radius: 8px;
        min-height: 0;
    }

    .prayer-header {
        gap: 0.4rem;
        margin-bottom: 0.875rem;
    }

    .prayer-arabic {
        font-size: 1.6rem;
        margin-bottom: 0.4rem;
        line-height: 1.4;
    }

    .prayer-english {
        font-size: 1.1rem;
        line-height: 1.3;
        margin-bottom: 0.3rem;
    }

    .prayer-transliteration {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
        line-height: 1.3;
    }

    .prayer-actions {
        gap: 0.625rem;
        margin-top: 0.875rem;
    }

    .prayer-action-section {
        padding: 0.625rem;
        gap: 0.35rem;
    }

    .prayer-action-label {
        font-size: 0.8rem;
    }

    .play-icon,
    .mic-btn {
        width: 44px;
        height: 44px;
    }

    .play-icon svg,
    .mic-btn svg {
        width: 18px;
        height: 18px;
    }

    .prayer-number {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .prayer-navigation {
        gap: 1.25rem;
        margin-bottom: 0.875rem;
    }

    .nav-btn {
        width: 46px;
        height: 46px;
    }

    .prayer-progress {
        font-size: 1.1rem;
        min-width: 70px;
    }

    .progress-bar-container {
        height: 5px;
    }
}

/* Recording Indicator Overlay */
.recording-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(220, 53, 69, 0.1);
    border: 3px solid #dc3545;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 16px;
    z-index: 5;
    animation: fadeIn 0.3s ease;
    pointer-events: none; /* Allow clicks to pass through to buttons */
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.recording-pulse {
    width: 14px;
    height: 14px;
    background: #dc3545;
    border-radius: 50%;
    position: relative;
    animation: pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
    }
}

.recording-text {
    color: #dc3545;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.recording-hint {
    color: #dc3545;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 0.95;
    }
    50% {
        opacity: 0.6;
    }
}

/* Prayer item needs relative positioning for overlay */
.prayer-item {
    position: relative;
}

/* Recording Preview Styles */
.recording-preview {
    text-align: center;
    padding: 1rem 0;
}

.preview-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.recording-preview h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.recording-preview p {
    color: #666;
    margin-bottom: 1.5rem;
}

.audio-player {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.audio-player audio {
    width: 100%;
    max-width: 400px;
    height: 40px;
    border-radius: 20px;
}

.preview-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.preview-actions button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.btn-record-again {
    background: #ffc107;
    color: #000;
}

.btn-record-again:hover {
    background: #ffb300;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-check-pronunciation {
    background: var(--primary-color);
    color: var(--white);
}

.btn-check-pronunciation:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* RTL Support for Preview Actions */
[dir="rtl"] .preview-actions button {
    flex-direction: row-reverse;
}

/* Mobile Responsive for Preview */
@media (max-width: 768px) {
    .preview-actions {
        flex-direction: column;
    }

    .preview-actions button {
        width: 100%;
        justify-content: center;
    }

    .audio-player {
        padding: 1rem;
    }
}

@media print {
    .video-section,
    footer,
    .prayer-audio-section {
        display: none;
    }

    body {
        background: white;
    }

    .content-text {
        box-shadow: none;
    }
}
