/* Base Styles */
:root {
    --gold: #D4AF37;
    --dark-green: #0A3A40;
    --light-beige: #F8F1E5;
    --arabic-gold: #C19A6B;
}

/* Layout Structure */
.main-quran-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
    z-index: 1;
}

.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Background */
.quran-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('{% static "front/images/mosque-pattern.png" %}');
    background-size: cover;
    opacity: 0.03;
    z-index: -1;
}

.ayah-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, #f5f5f5 70%);
}

/* Breadcrumb */
.islamic-breadcrumb {
    position: relative;
    padding: 1rem;
    margin: 1rem 0;
    background-color: rgba(10, 58, 64, 0.8);
    border-radius: 5px;
    overflow: hidden;
}

.pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('{% static "front/images/islamic-pattern.png" %}');
    opacity: 0.1;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 2;
}

.breadcrumb-item {
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: var(--light-beige);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--gold);
}

/* Section Header */
.section-header {
    text-align: center;
    margin: 2rem 0;
    padding: 1rem 0;
}

.arabic-calligraphy {
    font-size: 3rem;
    font-family: 'Traditional Arabic', 'Amiri', 'Arial', sans-serif;
    color: var(--arabic-gold);
    margin-bottom: -1rem;
    line-height: 1;
}

@media (min-width: 768px) {
    .arabic-calligraphy {
        font-size: 4rem;
        margin-bottom: -1.5rem;
    }
}

.section-title {
    font-size: 1.8rem;
    color: var(--dark-green);
    margin: 1rem 0 0.5rem;
    position: relative;
    display: inline-block;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2.5rem;
    }
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--gold);
}

.section-subtitle {
    font-style: italic;
    color: #666;
    max-width: 100%;
    margin: 0 auto;
    font-size: 0.95rem;
    line-height: 1.5;
}

@media (min-width: 576px) {
    .section-subtitle {
        max-width: 80%;
        font-size: 1rem;
    }
}

@media (min-width: 768px) {
    .section-subtitle {
        max-width: 600px;
    }
}

/* Quran Grid */
.quran-grid-container {
    margin: 2rem 0;
}

.quran-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

@media (min-width: 400px) {
    .quran-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (min-width: 576px) {
    .quran-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 2rem;
    }
}

@media (min-width: 768px) {
    .quran-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (min-width: 992px) {
    .quran-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

.quran-book {
    position: relative;
    height: 280px;
    perspective: 1000px;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (min-width: 576px) {
    .quran-book {
        height: 320px;
    }
}

@media (min-width: 768px) {
    .quran-book {
        height: 350px;
    }
}

.quran-book:hover {
    transform: translateY(-5px);
}

.book-cover {
    position: absolute;
    width: 100%;
    height: 90%;
    background: linear-gradient(135deg, #1a3a40 0%, #0a3a40 100%);
    border-radius: 5px 5px 0 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition: all 0.5s ease;
    z-index: 2;
    overflow: hidden;
}

@media (min-width: 768px) {
    .quran-book:hover .book-cover {
        transform: rotateY(-10deg);
        box-shadow: -10px 10px 25px rgba(0,0,0,0.15);
    }
}

.cover-design {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.islamic-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('{% static "front/images/quran-pattern.png" %}');
    opacity: 0.2;
    background-size: cover;
}

.title-box {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    padding: 0.8rem;
    text-align: center;
    background: rgba(0,0,0,0.5);
}

.surah-name {
    display: block;
    font-size: 1.2rem;
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 0.2rem;
}

@media (min-width: 576px) {
    .surah-name {
        font-size: 1.3rem;
    }
}

@media (min-width: 768px) {
    .surah-name {
        font-size: 1.5rem;
    }
}

.surah-translation {
    display: block;
    font-size: 0.85rem;
    color: white;
}

@media (min-width: 576px) {
    .surah-translation {
        font-size: 0.9rem;
    }
}

@media (min-width: 768px) {
    .surah-translation {
        font-size: 1rem;
    }
}

.gold-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--gold);
    border-radius: 5px;
    pointer-events: none;
    opacity: 0.5;
}

.book-spine {
    position: absolute;
    left: -8px;
    top: 15px;
    width: 16px;
    height: 82%;
    background: linear-gradient(to right, #2b1b0a 0%, #4a3a20 100%);
    transform: rotateY(90deg);
    transform-origin: left center;
    z-index: 1;
    border-radius: 3px 0 0 3px;
}

@media (min-width: 768px) {
    .book-spine {
        left: -10px;
        width: 20px;
        height: 85%;
    }
}

.spine-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    color: var(--gold);
    font-family: 'Traditional Arabic', 'Amiri', 'Arial', sans-serif;
    font-size: 1rem;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .spine-text {
        font-size: 1.2rem;
    }
}

.book-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3;
}

.quran-book:hover .book-actions {
    opacity: 1;
}

.read-btn, .download-btn {
    flex: 1;
    padding: 0.7rem;
    text-align: center;
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

@media (min-width: 576px) {
    .read-btn, .download-btn {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

.read-btn {
    background: var(--dark-green);
    border-radius: 0 0 0 5px;
}

.download-btn {
    background: var(--gold);
    border-radius: 0 0 5px 0;
}

.read-btn:hover, .download-btn:hover {
    filter: brightness(1.1);
}

/* Pagination */
.islamic-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    padding: 0.8rem;
    background-color: white;
    border-radius: 50px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.5rem 1rem;
    margin: 0.3rem;
    border: none;
    background: var(--dark-green);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
}

@media (min-width: 576px) {
    .page-btn {
        padding: 0.5rem 1.5rem;
        margin: 0 0.5rem;
        font-size: 1rem;
    }
}

.page-btn:hover {
    background: var(--gold);
    color: #333;
}

.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.page-number, .current-page {
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.2rem;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

@media (min-width: 576px) {
    .page-number, .current-page {
        width: 40px;
        height: 40px;
        margin: 0 5px;
    }
}

.page-number {
    background: #f0f0f0;
    color: #333;
}

.page-number:hover {
    background: var(--gold);
    color: white;
}

.current-page {
    background: var(--dark-green);
    color: white;
    font-weight: bold;
}

.btn-text {
    display: none;
}

@media (min-width: 576px) {
    .btn-text {
        display: inline;
    }
}

/* Verse Display */
.verse-display {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(10, 58, 64, 0.1) 100%);
    padding: 1.5rem;
    border-radius: 10px;
    margin: 2rem 0;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

@media (min-width: 768px) {
    .verse-display {
        padding: 2rem;
        margin: 3rem 0;
    }
}

.verse-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.verse-arabic {
    font-size: 1.5rem;
    font-family: 'Traditional Arabic', 'Amiri', 'Arial', sans-serif;
    color: var(--dark-green);
    margin-bottom: 1rem;
    line-height: 1.6;
    direction: rtl;
}

@media (min-width: 768px) {
    .verse-arabic {
        font-size: 2rem;
    }
}

.verse-translation {
    font-size: 1rem;
    color: #555;
    margin-bottom: 0.5rem;
    font-style: italic;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .verse-translation {
        font-size: 1.2rem;
    }
}

.verse-reference {
    font-size: 0.9rem;
    color: var(--gold);
    font-weight: bold;
}

/* Audio Player */
.quran-player-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px;
    z-index: 100;
}

.quran-player {
    background: white;
    border-radius: 50px;
    padding: 0.8rem 1.2rem;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.5s ease;
    max-width: 95%;
}

.quran-player.show {
    transform: translateY(0);
    opacity: 1;
}

.play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold);
    color: white;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.play-btn:hover {
    transform: scale(1.1);
}

.player-info {
    line-height: 1.3;
    overflow: hidden;
}

.surah-name {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--dark-green);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reciter-name {
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 400px) {
    .quran-player {
        padding: 0.8rem 1.5rem;
    }
    
    .surah-name {
        font-size: 0.9rem;
    }
    
    .reciter-name {
        font-size: 0.8rem;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 576px) {
    .book-spine {
        display: none;
    }
    
    .quran-book:hover .book-cover {
        transform: none;
    }
    
    .verse-arabic {
        font-size: 1.3rem;
    }
}