/* Islamic Theme CSS - RTL First - Brown/Gold Theme */
:root {
    --primary-brown: #663b05;
    --dark-brown: #4a2a04;
    --light-brown: #8b5a1a;
    --gold: #d4af37;
    --gold-light: #e8c547;
    --gold-dark: #b8941f;
    --off-white: #f8f6f0;
    --logo-bg: #faf8f3;
    --white: #ffffff;
    --text-dark: #2c2c2c;
    --text-light: #8b7355;
    --text-gold: #d4af37;
    --border-color: #8b7355;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
    background-color: #663b05;
    color: #d4af37;
    line-height: 1.6;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(212, 175, 55, 0.05) 35px, rgba(212, 175, 55, 0.05) 70px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--primary-brown) 0%, var(--dark-brown) 100%);
    color: var(--text-gold);
    padding: 50px 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.site-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.site-header .container {
    max-width: 100%;
    padding: 0;
    width: 100%;
}

.header-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.header-search-mobile {
    display: flex;
    width: 100%;
    padding: 20px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 10px;
    margin-bottom: 20px;
    flex-direction: row;
    gap: 15px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    backdrop-filter: blur(10px);
}

.header-search-in-header input {
    flex: 2;
    min-width: 150px;
    padding: 12px 15px;
    border: 2px solid #d4af37;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #2c2c2c;
    font-family: inherit;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.header-search-in-header input:focus {
    outline: none;
    border-color: #e8c547;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

.header-search-in-header input::placeholder {
    color: #8b7355;
}

.header-search-in-header select {
    flex: 1;
    min-width: 100px;
    padding: 12px 15px;
    border: 2px solid #d4af37;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #2c2c2c;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.header-search-in-header select:focus {
    outline: none;
    border-color: #e8c547;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.5);
}

.header-search-in-header button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #d4af37 0%, #e8c547 100%);
    color: #663b05;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    white-space: nowrap;
}

.header-search-in-header button:hover {
    background: linear-gradient(135deg, #e8c547 0%, #d4af37 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.6);
}

.header-search-in-header button:active {
    transform: translateY(0);
}

/* Search Box (between header and menu) */
.header-search-mobile {
    display: flex;
    width: 100%;
    padding: 20px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 10px;
    margin-bottom: 20px;
    flex-direction: row;
    gap: 15px;
    align-items: center;
    border: 2px solid rgba(212, 175, 55, 0.3);
    backdrop-filter: blur(10px);
}

.header-search-mobile input {
    flex: 2;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #d4af37;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #2c2c2c;
    font-family: inherit;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.header-search-mobile input:focus {
    outline: none;
    border-color: #e8c547;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

.header-search-mobile input::placeholder {
    color: #8b7355;
}

.header-search-mobile select {
    flex: 1;
    min-width: 150px;
    padding: 12px 15px;
    border: 2px solid #d4af37;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #2c2c2c;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.header-search-mobile select:focus {
    outline: none;
    border-color: #e8c547;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.5);
}

.header-search-mobile button {
    padding: 12px 25px;
    background: linear-gradient(135deg, #d4af37 0%, #e8c547 100%);
    color: #663b05;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    white-space: nowrap;
}

.header-search-mobile button:hover {
    background: linear-gradient(135deg, #e8c547 0%, #d4af37 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.6);
}

.header-search-mobile button:active {
    transform: translateY(0);
}

/* Banner */
.site-banner {
    width: 100%;
    background-color: #663b05;
    padding: 15px 0;
    margin: 0;
    overflow: hidden;
    border-top: 2px solid #d4af37;
}

.site-banner .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.banner-image {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.site-banner a {
    display: block;
    width: 100%;
    transition: opacity 0.3s;
}

.site-banner a:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .banner-image {
        max-height: 200px;
    }
    
    .site-banner {
        padding: 10px 0;
    }
}

/* Navigation */
.main-nav {
    background-color: #663b05;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid #d4af37;
}

.nav-with-search {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px 0;
}

.header-search {
    display: flex;
    gap: 15px;
    align-items: center;
    margin: 0 auto;
    flex-wrap: wrap;
    max-width: 800px;
    width: 100%;
    justify-content: center;
    padding: 20px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 15px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    backdrop-filter: blur(10px);
}

.header-search input {
    flex: 2;
    min-width: 300px;
    padding: 15px 20px;
    border: 2px solid #d4af37;
    border-radius: 10px;
    background-color: #faf8f3;
    color: #2c2c2c;
    font-family: inherit;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.header-search input:focus {
    outline: none;
    border-color: #e8c547;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.header-search input::placeholder {
    color: #8b7355;
}

.header-search select {
    flex: 1;
    min-width: 150px;
    padding: 15px 20px;
    border: 2px solid #d4af37;
    border-radius: 10px;
    background-color: #faf8f3;
    color: #2c2c2c;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.header-search select:focus {
    outline: none;
    border-color: #e8c547;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.header-search button {
    padding: 15px 35px;
    background: linear-gradient(135deg, #d4af37 0%, #e8c547 100%);
    color: #663b05;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-search button:hover {
    background: linear-gradient(135deg, #e8c547 0%, #d4af37 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.6);
}

.header-search button:active {
    transform: translateY(-1px);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    flex: 1;
}

.nav-menu a {
    display: block;
    padding: 20px;
    text-decoration: none;
    color: var(--text-gold);
    font-weight: 600;
    text-align: center;
    transition: all 0.3s;
    border-left: 1px solid rgba(212, 175, 55, 0.3);
    position: relative;
}

.nav-menu li:first-child a {
    border-left: none;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: rgba(212, 175, 55, 0.2);
    color: var(--gold-light);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 3px;
    background-color: var(--gold);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    gap: 5px;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 101;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-gold);
    transition: all 0.3s;
    border-radius: 2px;
    display: block;
}

.mobile-menu-toggle:hover span {
    background-color: var(--gold-light);
}

.main-nav .container {
    position: relative;
}

/* Main Content */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 400px);
}

.page-title {
    font-size: 2.5rem;
    color: var(--text-gold);
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(to left, var(--gold-light), var(--gold));
    border-radius: 2px;
}

/* Sections */
.section-title {
    font-size: 2rem;
    color: var(--text-gold);
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    padding: 15px 0;
}

.section-title::before,
.section-title::after {
    content: '✦';
    color: var(--gold);
    margin: 0 15px;
    font-size: 1.5rem;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.category-card {
    background: var(--card-bg);
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: var(--text-gold);
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 2px solid var(--gold);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gold-light);
    background-color: var(--white);
}

.category-card:hover::before {
    opacity: 1;
}

.category-icon {
    color: var(--text-gold);
    margin-bottom: 15px;
}

.category-card h3 {
    font-size: 1.3rem;
    color: var(--text-gold);
    margin-top: 10px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1px solid var(--gold);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: var(--border-color);
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.card:hover .play-overlay {
    opacity: 1;
}

.video-placeholder,
.audio-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-brown), var(--light-brown));
    color: var(--text-gold);
    font-size: 1.5rem;
    font-weight: 600;
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    color: var(--text-gold);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.card-content p {
    color: var(--text-light);
    margin-bottom: 10px;
}

.date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.category-badge {
    display: inline-block;
    background-color: var(--gold);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

/* Grids */
.videos-grid,
.audios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Books Grid - 5 per row */
.books-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.book-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border-color);
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gold);
}

.book-cover {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: var(--border-color);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-brown), var(--light-brown));
    color: var(--text-gold);
    font-size: 3rem;
    font-weight: 700;
}

.book-info {
    padding: 15px;
}

.book-info h3 {
    color: var(--text-gold);
    font-size: 1rem;
    margin-bottom: 5px;
    line-height: 1.4;
}

.book-info .author {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Fatawa List */
.fatawa-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.fatawa-item {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border-right: 4px solid var(--gold);
    transition: all 0.3s;
}

.fatawa-item:hover {
    box-shadow: var(--shadow-lg);
    border-right-color: var(--gold-light);
    background-color: var(--white);
}

.fatawa-item h2 {
    color: var(--text-gold);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.fatawa-item h2 a {
    color: inherit;
    text-decoration: none;
}

.fatawa-item h2 a:hover {
    text-decoration: underline;
}

.fatawa-item p {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.8;
}

.fatawa-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Detail Pages */
.fatawa-detail,
.video-detail,
.audio-detail,
.book-detail,
.article-detail,
.biography-detail {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: 0 auto;
}

.article-featured-image {
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.article-content {
    color: var(--text-gold);
    line-height: 1.8;
    font-size: 1.1rem;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 20px 0;
}

.biography-content {
    color: var(--text-gold);
    line-height: 1.8;
    font-size: 1.1rem;
}

.biography-gallery {
    margin-top: 40px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--gold);
    transition: all 0.3s;
}

.gallery-item img:hover {
    transform: scale(1.05);
    border-color: var(--gold-light);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.article-card {
    background: var(--card-bg);
}

.fatawa-question,
.video-title,
.audio-title,
.book-title,
.article-title {
    font-size: 2rem;
    color: var(--text-gold);
    margin-bottom: 20px;
    line-height: 1.4;
}

.fatawa-answer,
.video-description,
.audio-description,
.book-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 30px;
}

.fatawa-answer p,
.video-description p,
.audio-description p,
.book-description p {
    margin-bottom: 15px;
}

.video-player {
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.video-player iframe,
.video-player video {
    width: 100%;
    display: block;
}

.audio-player-wrapper {
    margin-bottom: 30px;
}

.audio-player {
    width: 100%;
    height: 50px;
}

.book-detail-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    align-items: start;
}

.book-cover-large {
    width: 100%;
}

.book-cover-large img {
    width: 100%;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}

.book-placeholder-large {
    width: 100%;
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-brown), var(--light-brown));
    color: var(--text-gold);
    font-size: 5rem;
    font-weight: 700;
    border-radius: 10px;
}

.book-author {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.book-download {
    margin: 30px 0;
}

.article-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--gold);
    color: var(--primary-brown);
    font-weight: 700;
}

.btn-primary:hover {
    background-color: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-gold);
    border: 2px solid var(--gold);
}

.btn-outline:hover {
    background-color: var(--gold);
    color: var(--primary-brown);
}

.section-footer {
    text-align: center;
    margin-top: 40px;
}

/* Forms */
.contact-form-wrapper,
.filters-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    border: 1px solid var(--gold);
}

.search-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-green);
}

.category-select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--white);
}

.category-select:focus {
    outline: none;
    border-color: var(--primary-green);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-gold);
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    background-color: var(--white);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination-link {
    padding: 10px 15px;
    text-decoration: none;
    color: var(--primary-green);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    transition: all 0.3s;
}

.pagination-link:hover,
.pagination-link.active {
    background-color: var(--gold);
    color: var(--primary-brown);
    border-color: var(--gold);
}

.pagination-ellipsis {
    padding: 10px 5px;
    color: var(--text-light);
}

/* Footer */
.site-footer {
    background-color: var(--dark-brown);
    color: var(--text-gold);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--gold);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
    color: var(--gold-light);
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s;
}

.social-links a:hover {
    background-color: var(--gold);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-gold);
    font-size: 1.2rem;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.search-result-item {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border-right: 4px solid var(--gold);
    transition: all 0.3s;
}

.search-result-item:hover {
    box-shadow: var(--shadow-lg);
    border-right-color: var(--gold-light);
    background-color: var(--white);
}

.result-type {
    display: inline-block;
    background-color: var(--gold);
    color: var(--primary-brown);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.search-result-item h3 {
    margin-bottom: 10px;
}

.search-result-item h3 a {
    color: var(--text-gold);
    text-decoration: none;
}

.search-result-item h3 a:hover {
    color: var(--gold-light);
    text-decoration: underline;
}

.search-result-item p {
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Responsive - Tablet (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 0 15px;
    }
    
    .site-header {
        padding: 25px 0;
    }
    
    .profile-section {
        padding: 20px;
        gap: 20px;
    }
    
    .profile-photo {
        width: 100px;
        max-height: 100px;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .site-tagline {
        font-size: 1.1rem;
    }
    
    .site-header {
        min-height: 300px;
        padding: 40px 0;
    }
    
    .header-search-mobile {
        flex-direction: row;
        gap: 15px;
        padding: 18px;
    }
    
    .header-search-mobile input {
        flex: 2;
        min-width: 200px;
    }
    
    .header-search-mobile select {
        flex: 1;
        min-width: 150px;
    }
    
    .header-search-mobile button {
        padding: 12px 20px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
    }
    
    .nav-menu a {
        padding: 15px 10px;
        font-size: 0.9rem;
    }
    
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .videos-grid,
    .audios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .book-detail-wrapper {
        grid-template-columns: 200px 1fr;
        gap: 30px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.7rem;
    }
    
    .fatawa-detail,
    .video-detail,
    .audio-detail,
    .book-detail,
    .article-detail,
    .biography-detail {
        padding: 30px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* Responsive - Mobile (< 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .site-header {
        padding: 20px 0;
        min-height: 200px;
        background-size: cover;
        background-position: center;
        background-attachment: scroll;
    }
    
    .header-content {
        justify-content: center;
        align-items: center;
        padding: 0;
    }
    
    .header-search-mobile {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .header-search-mobile input,
    .header-search-mobile select {
        width: 100%;
        min-width: auto;
    }
    
    .header-search-mobile button {
        width: 100%;
    }
    
    .site-banner {
        padding: 10px 0;
        margin-top: 15px;
    }
    
    .site-banner .container {
        padding: 0 15px;
    }
    
    .banner-image {
        max-height: 180px;
    }
    
    .main-nav {
        position: relative;
    }
    
    .nav-with-search {
        flex-direction: column;
        gap: 15px;
        padding: 15px 0;
    }
    
    .header-search {
        width: 100%;
        margin: 0;
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        max-width: 100%;
    }
    
    .header-search input {
        width: 100%;
        min-width: auto;
        margin-bottom: 0;
        font-size: 1rem;
        padding: 12px 15px;
    }
    
    .header-search select {
        width: 100%;
        min-width: auto;
        margin-bottom: 0;
        font-size: 0.95rem;
        padding: 12px 15px;
    }
    
    .header-search button {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        display: none;
        width: 100%;
        gap: 0;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu a {
        border-left: none;
        border-bottom: 1px solid rgba(212, 175, 55, 0.3);
        padding: 15px;
        font-size: 0.95rem;
    }
    
    .nav-menu li:last-child a {
        border-bottom: none;
    }
    
    .mobile-menu-toggle,
    .mobile-menu-toggle.is-open,
    .mobile-menu-toggle.active,
    .mobile-menu-toggle[aria-expanded="true"],
    .menu-open .mobile-menu-toggle,
    body.menu-open .mobile-menu-toggle,
    .nav-menu.active ~ .mobile-menu-toggle {
        display: flex;
        position: fixed;
        left: 20px;
        top: 90%;
        bottom: auto;
        right: auto;
        transform: translateY(-50%);
        z-index: 1100;
        width: 54px;
        height: 54px;
        padding: 0;
        gap: 0;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        background-color: #663b05;
        border: 2px solid var(--gold, #d4af37);
        border-radius: 50%;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2);
        transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    }

    .mobile-menu-toggle:hover,
    .mobile-menu-toggle:focus-visible {
        background-color: #7a4706;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(212, 175, 55, 0.25);
        outline: none;
    }

    .mobile-menu-toggle:active {
        transform: translateY(-50%) scale(0.95);
    }

    /* Icon bars (3 lines -> X) */
    .mobile-menu-toggle span {
        position: absolute;
        width: 24px;
        height: 2.5px;
        background-color: var(--gold, #d4af37);
        border-radius: 3px;
        transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
        display: block;
    }

    .mobile-menu-toggle span:nth-child(1) { top: 18px; }
    .mobile-menu-toggle span:nth-child(2) { top: 26px; }
    .mobile-menu-toggle span:nth-child(3) { top: 34px; }

    /* Transform bars into an X when menu is open */
    .mobile-menu-toggle.is-open span:nth-child(1) {
        top: 26px;
        transform: rotate(45deg);
    }
    .mobile-menu-toggle.is-open span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .mobile-menu-toggle.is-open span:nth-child(3) {
        top: 26px;
        transform: rotate(-45deg);
    }

    /* ---------- Mobile fullscreen drawer ---------- */
    .nav-menu.active {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 80px 20px 120px;
        background: linear-gradient(180deg, rgba(102, 59, 5, 0.98) 0%, rgba(61, 33, 2, 0.98) 100%);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        overflow-y: auto;
        z-index: 1000;
        animation: navMenuFadeIn 0.25s ease;
    }

    @keyframes navMenuFadeIn {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    .nav-menu.active li {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }

    .nav-menu.active a {
        display: block;
        padding: 16px 20px;
        text-align: center;
        font-size: 1.05rem;
        color: var(--text-gold, #f5e8c7);
        border: none;
        border-bottom: 1px solid rgba(212, 175, 55, 0.22);
        border-radius: 6px;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .nav-menu.active a:hover,
    .nav-menu.active a.active {
        background-color: rgba(212, 175, 55, 0.15);
        color: var(--gold-light, #e6c659);
    }

    /* Prevent background scroll when menu open */
    body.nav-open {
        overflow: hidden;
    }
    
    .main-content {
        padding: 30px 0;
    }
    
    .page-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .book-card {
        border-radius: 8px;
    }
    
    .book-cover {
        height: 200px;
    }
    
    .book-info {
        padding: 12px;
    }
    
    .book-info h3 {
        font-size: 0.95rem;
    }
    
    .book-info .author {
        font-size: 0.8rem;
    }
    
    .videos-grid,
    .audios-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .category-card {
        padding: 20px;
    }
    
    .category-card h3 {
        font-size: 1.1rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .article-card {
        border-radius: 8px;
    }
    
    .card-image {
        height: 180px;
    }
    
    .card-content {
        padding: 15px;
    }
    
    .card-content h3 {
        font-size: 1.1rem;
    }
    
    .fatawa-list {
        gap: 15px;
    }
    
    .fatawa-item {
        padding: 20px;
    }
    
    .fatawa-item h2 {
        font-size: 1.2rem;
    }
    
    .fatawa-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .book-detail-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .book-cover-large {
        max-width: 200px;
        margin: 0 auto;
    }
    
    .fatawa-detail,
    .video-detail,
    .audio-detail,
    .book-detail,
    .article-detail,
    .biography-detail {
        padding: 20px;
        border-radius: 8px;
    }
    
    .fatawa-question,
    .video-title,
    .audio-title,
    .book-title,
    .article-title {
        font-size: 1.5rem;
    }
    
    .fatawa-answer,
    .video-description,
    .audio-description,
    .book-description {
        font-size: 1rem;
    }
    
    .article-content,
    .biography-content {
        font-size: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .search-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-input,
    .category-select {
        width: 100%;
    }
    
    .contact-form-wrapper,
    .filters-section {
        padding: 20px;
    }
    
    .contact-form {
        max-width: 100%;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-control {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-section h3 {
        font-size: 1.2rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .pagination-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .search-results {
        gap: 15px;
    }
    
    .search-result-item {
        padding: 20px;
    }
    
    .search-result-item h3 {
        font-size: 1.1rem;
    }
}

/* Responsive - Small Mobile (< 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .site-header {
        padding: 15px 0;
    }
    
    .profile-section {
        padding: 15px;
    }
    
    .profile-photo {
        width: 80px;
        max-height: 80px;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .site-tagline {
        font-size: 0.9rem;
    }
    
    .profile-bio {
        font-size: 0.85rem;
    }
    
    .site-banner {
        padding: 8px 0;
    }
    
    .banner-image {
        max-height: 150px;
    }
    
    .site-header {
        min-height: 180px;
        padding: 15px 0;
        background-size: cover;
        background-position: center;
        background-attachment: scroll;
    }
    
    .header-content {
        padding-top: 15px;
    }
    
    .header-search-mobile {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    
    .header-search-mobile input,
    .header-search-mobile select {
        width: 100%;
        min-width: auto;
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .header-search-mobile button {
        width: 100%;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .nav-menu a {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .main-content {
        padding: 20px 0;
    }
    
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .section-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .book-cover {
        height: 250px;
    }
    
    .videos-grid,
    .audios-grid,
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .category-card {
        padding: 15px;
    }
    
    .category-card h3 {
        font-size: 1rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card-image {
        height: 160px;
    }
    
    .card-content {
        padding: 12px;
    }
    
    .card-content h3 {
        font-size: 1rem;
    }
    
    .fatawa-item {
        padding: 15px;
    }
    
    .fatawa-item h2 {
        font-size: 1.1rem;
    }
    
    .fatawa-detail,
    .video-detail,
    .audio-detail,
    .book-detail,
    .article-detail,
    .biography-detail {
        padding: 15px;
    }
    
    .fatawa-question,
    .video-title,
    .audio-title,
    .book-title,
    .article-title {
        font-size: 1.3rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .gallery-item img {
        height: 250px;
    }
    
    .contact-form-wrapper,
    .filters-section {
        padding: 15px;
    }
    
    .form-control {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .footer-content {
        gap: 25px;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
    
    .pagination-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .search-result-item {
        padding: 15px;
    }
    
    .search-result-item h3 {
        font-size: 1rem;
    }
}

