/* Quran Section - Matching Hadith Design */

/* Page Back Button */
.page-back-button {
    position: fixed;
    top: 90px;
    left: 20px;
    z-index: 999;
}

.page-back-button .back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.4);
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.page-back-button .back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(46, 125, 50, 0.5);
}

.page-back-button .back-btn i {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .page-back-button {
        top: 70px;
        left: 10px;
    }
    
    .page-back-button .back-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .page-back-button .back-btn span {
        display: none;
    }
    
    .page-back-button .back-btn i {
        margin: 0;
    }
}

/* Page Header - Consistent with home page */
.quran-page-header {
    background: var(--gradient-hero);
    padding: 120px 20px 80px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    overflow: hidden;
}

.quran-header-content {
    max-width: 900px;
    margin: 0 auto;
}

.quran-page-title {
    font-family: 'Amiri', serif;
    font-size: 4rem;
    color: white;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

.quran-page-subtitle {
    font-family: 'Cairo', sans-serif;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 30px;
    font-weight: 400;
}

.quran-bismillah {
    font-family: 'Amiri', serif;
    font-size: 2rem;
    color: var(--primary-gold);
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
}

/* Content Section */
.quran-content-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(46, 125, 50, 0.03) 50%, var(--bg-primary) 100%);
    position: relative;
    z-index: 1;
}

.quran-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Search Section */
.quran-search-wrapper {
    margin-bottom: 50px;
    text-align: center;
}

.quran-search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto 15px;
    gap: 10px;
}

.quran-search-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    border: none;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.1);
}

.quran-search-input:focus {
    background: white;
    box-shadow: 0 8px 24px rgba(46, 125, 50, 0.15);
    transform: translateY(-2px);
}

.quran-search-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
}

.quran-search-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(46, 125, 50, 0.35);
}

.quran-search-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
}

.quran-search-status {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Surah Grid - Matching hadith books grid */
.surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
    min-height: 200px;
}

.surah-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 35px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(46, 125, 50, 0.3);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(46, 125, 50, 0.12);
}

.surah-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.08), rgba(201, 162, 39, 0.05));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.surah-card:hover::before {
    opacity: 1;
}

.surah-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.2);
    border-color: #4caf50;
}

.surah-name {
    font-family: 'Amiri', serif;
    font-size: 1.8rem;
    color: #2e7d32;
    margin-bottom: 10px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
    visibility: visible;
    opacity: 1;
}

.surah-card:hover .surah-name {
    color: #1b5e20;
    font-size: 1.9rem;
}

.surah-meta {
    color: #2e7d32;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
    visibility: visible;
    opacity: 1;
    font-weight: 500;
}

.surah-card:hover .surah-meta {
    color: #1b5e20;
    font-weight: 600;
}

/* Surah View Section */
.surah-section {
    background: #ffffff;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 6px 25px rgba(46, 125, 50, 0.15);
    border: 2px solid rgba(46, 125, 50, 0.15);
}

.surah-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(46, 125, 50, 0.2);
}

.surah-title {
    font-family: 'Amiri', serif;
    font-size: 2.5rem;
    color: #2e7d32;
    margin: 0;
}

.quran-back-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.15);
}

.quran-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(46, 125, 50, 0.3);
}

.quran-back-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.15);
}

/* Ayah Container */
.ayah-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Bismillah styling */
.bismillah-ayah {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.08), rgba(25, 103, 210, 0.08));
    border-radius: 15px;
    border: 2px solid rgba(76, 175, 80, 0.2);
}

.bismillah-text {
    font-family: 'Amiri', serif;
    font-size: 2rem;
    color: #2e7d32;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
}

/* Premium Book Style Quran Text */
.quran-text-block {
    background-color: #fffbf0; /* Warm parchment color */
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23d4af37' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    padding: 50px;
    border-radius: 20px;
    border: 3px double rgba(212, 175, 55, 0.4); /* Gold border */
    box-shadow: 
        0 10px 40px rgba(0,0,0,0.08),
        inset 0 0 80px rgba(212, 175, 55, 0.1);
    
    /* Typography */
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 2rem;
    line-height: 2.6;
    color: #2c3e50;
    text-align: justify;
    text-align-last: center;
    direction: rtl;
}

.ayah-text {
    position: relative;
}

.ayah-end-marker {
    display: inline-block;
    color: #c9a227; /* Gold */
    font-family: 'Amiri', serif;
    font-weight: 400;
    margin: 0 8px;
    font-size: 0.85em;
    white-space: nowrap;
}

/* Enhancing list-style ayahs for search results only */
.ayah {
    background: linear-gradient(to left, #f1f8f4, #ffffff);
    border-right: 4px solid #4caf50;
    padding: 20px 25px;
    border-radius: 12px;
    line-height: 2.2;
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    color: #1b5e20;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.1);
    transition: all 0.3s ease;
}

.ayah:hover {
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.25);
    transform: translateX(-5px);
    background: linear-gradient(to left, #e8f5e9, #ffffff);
}

.ayah-num {
    color: #2e7d32;
    font-weight: 700;
    margin-left: 10px;
}

/* Search Results Section */
.quran-search-results {
    background: #ffffff;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 6px 25px rgba(46, 125, 50, 0.15);
    border: 2px solid rgba(46, 125, 50, 0.15);
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(46, 125, 50, 0.2);
}

.search-results-header h3 {
    font-family: 'Amiri', serif;
    font-size: 2rem;
    color: #2e7d32;
    margin: 0;
}

/* Highlight */
.highlight {
    background: linear-gradient(transparent 70%, #fff59d 70%);
    font-weight: 600;
}

/* Responsive Design - Extreme Mobile Optimization */
@media (max-width: 1024px) {
    .quran-page-header {
        padding: 100px 20px 60px;
        min-height: 50vh;
    }
    
    .quran-page-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .quran-page-header {
        padding: 90px 15px 50px;
        min-height: 45vh;
    }
    
    .quran-page-title {
        font-size: 2.5rem;
    }
    
    .quran-page-subtitle {
        font-size: 1.2rem;
    }
    
    .quran-bismillah {
        font-size: 1.6rem;
    }
    
    .quran-content-section {
        padding: 50px 0;
    }
    
    .quran-container {
        padding: 0 15px;
    }
    
    .quran-search-wrapper {
        margin-bottom: 40px;
    }
    
    .quran-search-form {
        flex-direction: column;
        max-width: 100%;
    }
    
    .quran-search-input {
        width: 100%;
        font-size: 1rem;
    }
    
    .quran-search-btn {
        width: 100%;
        padding: 14px 20px;
    }
    
    .surah-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .surah-card {
        padding: 25px 20px;
    }
    
    .surah-section, .quran-search-results {
        padding: 30px 20px;
        border-radius: 10px;
    }
    
    .surah-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .surah-title {
        font-size: 2rem;
    }
    
    .quran-back-btn {
        width: 100%;
    }
    
    .ayah {
        font-size: 1.4rem;
        padding: 18px 20px;
        line-height: 2.3;
    }
    
    .bismillah-ayah {
        padding: 25px 15px;
    }
    
    .bismillah-text {
        font-size: 1.7rem;
    }
}

@media (max-width: 480px) {
    .quran-page-header {
        padding: 80px 10px 40px;
        min-height: 40vh;
    }
    
    .quran-page-title {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .quran-page-subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .quran-bismillah {
        font-size: 1.3rem;
    }
    
    .quran-content-section {
        padding: 40px 0;
    }
    
    .quran-container {
        padding: 0 10px;
    }
    
    .quran-search-wrapper {
        margin-bottom: 30px;
    }
    
    .quran-search-input {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .quran-search-btn {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .surah-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .surah-card {
        padding: 20px 15px;
    }
    
    .surah-name {
        font-size: 1.5rem;
    }
    
    .surah-meta {
        font-size: 0.9rem;
    }
    
    .surah-section, .quran-search-results {
        padding: 20px 15px;
        margin: 0 -5px;
    }
    
    .surah-title {
        font-size: 1.7rem;
    }
    
    .quran-back-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .ayah {
        font-size: 1.25rem;
        padding: 15px;
        line-height: 2.2;
        border-right-width: 3px;
    }
    
    .bismillah-ayah {
        padding: 20px 10px;
    }
    
    .bismillah-text {
        font-size: 1.4rem;
    }
    
    .ayah-num {
        display: block;
        margin: 10px 0 0 0;
        text-align: center;
    }
}

@media (max-width: 360px) {
    .quran-page-title {
        font-size: 1.7rem;
    }
    
    .quran-page-subtitle {
        font-size: 0.9rem;
    }
    
    .quran-bismillah {
        font-size: 1.15rem;
    }
    
    .surah-name {
        font-size: 1.3rem;
    }
    
    .ayah {
        font-size: 1.15rem;
        padding: 12px;
        line-height: 2.1;
    }
    
    .bismillah-text {
        font-size: 1.2rem;
    }
}
