/* ===== RESET & BASE ===== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800;900&display=swap');

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    direction: rtl;
    background: #f0f0f0;
    color: #333;
    line-height: 1.7;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

ul,
ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input {
    font-family: inherit;
}

/* ===== CSS VARIABLES ===== */
:root {
    --maroon: #8B1A4A;
    --maroon-dark: #6d1339;
    --maroon-light: #a82060;
    --pink-light: #f0e0e8;
    --blue-dark: #1a3660;
    --blue-medium: #2c5080;
    --blue-light: #4a7ab0;
    --green-accent: #4CAF50;
    --green-dark: #2e7d32;
    --teal: #489ba3;
    --gold: #d4a843;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --bg-section: #f8f8f8;
    --text-dark: #333333;
    --text-muted: #777777;
    --text-light: #ffffff;
    --border-light: #e0e0e0;
    --border-medium: #d0d0d0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --container-width: 1100px;
}

/* ===== CONTAINER ===== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   1. CATEGORY NAVIGATION (Top Icon Bar)
   ============================================ */
.category-nav {
    background: var(--bg-white);
    padding: 12px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 10;
}

.category-list {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: auto;
}

.category-item {
    flex: 0 0 auto;
}

.category-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    min-width: 82px;
    text-align: center;
}

.category-link:hover {
  /*  background: var(--pink-light);*/
    transform: translateY(-2px);
}

.category-link img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 10px;
}

.category-link span {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    line-height: 1.3;
}

/* ============================================
   2. SEARCH / ASK SECTION
   ============================================ */
.search-section {
    background: #e8e8e8;
    padding: 40px 0 28px;
    text-align: center;
}

.search-logo {
    width: 160px;
    margin: 0 auto 8px;
    display: block;
}

.ramadan-logo {
    width: 200px;
    margin: 0 auto 12px;
    display: block;
}

.search-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.search-box {
    display: block;
    max-width: 540px;
    margin: 0 auto;
    position: relative;
}

.search-box input {
    width: 100%;
    border: 1.5px solid #ccc;
    outline: none;
    padding: 16px 28px;
    font-size: 1rem;
    background: var(--bg-white);
    color: var(--text-dark);
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-box input:focus {
    border-color: var(--maroon);
    box-shadow: 0 3px 12px rgba(139, 26, 74, 0.1);
}

.search-box input::placeholder {
    color: #aaa;
    font-weight: 600;
    font-size: 0.95rem;
}

/* ============================================
   3. TABS (فقه الصيام)
   ============================================ */
.main-tabs {
    background: #c8dee1;
    padding: 0;
}

.tabs-list {
    display: flex;
    justify-content: center;
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    align-items: flex-end;
}

.tab-item {
    padding: 12px 26px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #4a6a6e;
    cursor: pointer;
    transition: all 0.25s;
    border-bottom: none;
    white-space: nowrap;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
}

.tab-item:hover {
    color: var(--maroon);
    background: rgba(255, 255, 255, 0.4);
}

.tab-item.active {
    background: var(--bg-white);
    color: var(--maroon);
    font-weight: 800;
    padding-top: 14px;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.05);
}

/* Sub-tabs */
.sub-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 14px 0;
    background: var(--blue-dark);
}

.sub-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.sub-tab.green {
    background: var(--green-accent);
}

.sub-tab.pink {
    background: var(--maroon);
}

.sub-tab:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.sub-tab svg {
    width: 16px;
    height: 16px;
    fill: white;
    transition: transform 0.3s;
}

/* ============================================
   4. FATWA / CONTENT LIST SECTION
   ============================================ */
.content-list-section {
    padding: 30px 0 40px;
    background: #f0f0f0;
}

.content-list-layout {
    display: flex;
    gap: 24px;
}

.content-list-main {
    flex: 1;
    order: 2;
}

.content-list-sidebar {
    flex: 0 0 160px;
    order: 1;
}

.content-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-align: right;
}

/* Sidebar filter buttons */
.sidebar-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-btn {
    display: block;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border-light);
    color: var(--text-dark);
    background: var(--bg-light);
}

.sidebar-btn:hover {
    border-color: var(--maroon);
    color: var(--maroon);
}

.sidebar-btn.active {
    background: var(--maroon);
    color: white;
    border-color: var(--maroon);
}

/* Fatwa items */
.fatwa-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.fatwa-item {
    padding: 18px 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-white);
    transition: background 0.2s;
}

.fatwa-item:hover {
    background: #fdfdfd;
}

.fatwa-item:last-child {
    border-bottom: none;
}

.fatwa-body {
    flex: 1;
}

.fatwa-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.fatwa-excerpt {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.fatwa-more {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: color 0.3s;
    white-space: nowrap;
}

.fatwa-more:hover {
    color: var(--maroon);
}

.fatwa-more svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ============================================
   5. PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 24px 0 10px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.3s;
    background: transparent;
}

.pagination-btn:hover {
    color: var(--maroon);
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.pagination-num {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-dark);
}

.pagination-num:hover {
    background: var(--pink-light);
}

.pagination-num.active {
    color: var(--text-dark);
    font-weight: 900;
    background: none;
}

.pagination-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
}

.pagination-text:hover {
    color: var(--maroon);
}

/* ============================================
   SECTION COMMON STYLES
   ============================================ */
.section-block {
    padding: 50px 0;
    position: relative;
}

.section-block.bg-white {
    background: var(--bg-white);
}

.section-block.bg-light {
    background: var(--bg-light);
}

.section-block.bg-decorated {
    background: var(--bg-light);
    overflow: hidden;
}

/* White box wrapper for section content */
.section-block>.container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 2;
    overflow: hidden;
}

/* Section header with decorative banner */
/* Section header with decorative banner */
.section-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.section-title-banner {
    display: inline-block;
    background: var(--maroon);
    color: white;
    padding: 10px 60px;
    font-size: 1.3rem;
    font-weight: 800;
    position: relative;
    clip-path: polygon(0% 50%,
            15px 0%,
            100% 0%,
            100% 100%,
            15px 100%,
            0% 50%);
    margin-bottom: 15px;
    /* Create the double-pointed look using a wrapper or pseudo-elements might be needed for the exact complex shape, 
       but a simple polygon is a good start. Let's try to match the image better with a border shape */
    clip-path: none;
    /* Resetting to use background image approach or borders if css only */
    background: none;
    padding: 0;
}

/* Creating the shape using borders/pseudo-elements to match [ < text > ] style loosely or specific svg shape */
.section-title-banner {
    background: var(--maroon);
    color: white;
    padding: 12px 50px;
    border-radius: 30px;
    /* Fallback */
    border-radius: 50px;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(139, 26, 74, 0.2);
    border: 4px solid white;
    outline: 2px solid var(--maroon);
}

.section-title-banner::before,
.section-title-banner::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 2px;
    background: var(--maroon);
    z-index: -1;
}

.section-title-banner::before {
    left: -50px;
}

.section-title-banner::after {
    right: -50px;
}

/* A better match for the "pointed header" in the images: */
.section-title-banner {
    background: var(--maroon);
    color: white;
    padding: 10px 50px;
    border-radius: 0;
    clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
    font-size: 1.25rem;
    min-width: 280px;
    border: none;
    outline: none;
    box-shadow: none;
}

/* Adding a container for the double-border effect seen in images */
.section-header {
    margin-bottom: 40px;
}

.section-header-img {
    max-width: 300px;
    height: auto;
    display: block;
}

.section-title-banner {
    background: var(--maroon);
    color: white;
    padding: 8px 40px;
    border-radius: 12px 12px 12px 12px;
    position: relative;
    font-size: 1.2rem;
    min-width: 250px;
    clip-path: polygon(15px 0%, 100% 0%, calc(100% - 15px) 100%, 0% 100%);
    /* actually the design is more like a stretched hexagon or banner */
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    border-radius: 50px;
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--maroon);
}

/* Wait, the design has "pointed" ends like < Title >. Let's do that. */
.section-title-banner {
    background: var(--maroon);
    color: white;
    padding: 10px 40px;
    border-radius: 0;
    clip-path: polygon(20px 0, 100% 0, calc(100% - 20px) 100%, 0 100%);
    /* Parallelogram? No */
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    border-radius: 25px;
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--maroon);
}

/* Decorative lantern ornaments */
/* Decorative lantern ornaments */
.section-decorations {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.lantern {
    position: absolute;
    top: 0;
    width: 200px;
    height: 100%;
    background-repeat: no-repeat;
    background-size: contain;
    /* Hide the emoji text */
    font-size: 0;
    color: transparent;
    overflow: hidden;
}

.lantern-right {
    right: 0;
    background-image: url('images/right-fanoos.png');
    background-position: right top;
}

.lantern-left {
    left: 0;
    background-image: url('images/left-fanoos.png');
    background-position: left top;
}

@keyframes swing {
    0% {
        transform: rotate(5deg);
    }

    100% {
        transform: rotate(-5deg);
    }
}

.star {
    position: absolute;
    opacity: 0.2;
    color: #ccc;
}

.star-1 {
    top: 20px;
    right: 12%;
    font-size: 1.2rem;
}

.star-2 {
    top: 50px;
    left: 10%;
    font-size: 0.9rem;
}

/* Decorations inside the white box */
.section-decorations-inner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
    border-radius: var(--radius-lg);
}

.section-decorations-inner .lantern {
    width: 150px;
    height: 120px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.9;
}

.section-decorations-inner .lantern-right {
    right: 5px;
    /*top: 5px;*/
}

.section-decorations-inner .lantern-left {
    left: 5px;
    /*top: 5px;*/
}

.section-decorations-inner .star {
    opacity: 0.25;
    color: #c0c0c0;
    font-size: 1.5rem;
}

.section-decorations-inner .star-1 {
    top: 10px;
    right: 80px;
}

.section-decorations-inner .star-2 {
    top: 10px;
    left: 80px;
}

.section-decorations-inner .star-3 {
    top: 40px;
    right: 50%;
    font-size: 0.8rem;
}

/* ============================================
   6. رواء رمضان (4 Icon Buttons)
   ============================================ */
.rowaa-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.rowaa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
   /* padding: 24px 20px;*/
    /*background: var(--blue-dark);*/
    border-radius: var(--radius-md);
    min-width: 140px;
    transition: all 0.3s;
    text-align: center;
}

.rowaa-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    /*  background: var(--blue-medium);*/
}

.rowaa-btn img {
    width: 100%;
    height: 150px;
    object-fit: contain;
}

.rowaa-btn span {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

/* ============================================
   7. مرئيات رمضان (Video Section)
   ============================================ */
.video-section-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-main {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.video-main .video-thumb {
    width: 100%;
    height: 350px;
    background-color: #e0e0e0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-play-btn {
    width: 60px;
    height: 60px;
    background: rgba(139, 26, 74, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.video-play-btn:hover {
    transform: scale(1.1);
    background: var(--maroon);
}

.video-play-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
    margin-right: -3px;
}

.video-main .video-info {
    padding: 16px 20px;
    text-align: center;
}

.video-main .video-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
}

.video-small-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.video-card-small {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.3s;
}

.video-card-small:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.video-card-small .video-thumb {
    height: 180px;
    background-color: #e0e0e0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-card-small .video-info {
    padding: 10px 12px;
}

.video-card-small .video-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.5;
}

/* ============================================
   8. VIDEO CARD GRID (عرفتك ربي, أحكام, etc.)
   ============================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 0 20px;
}

.card {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-thumb {
    height: 160px;
    background: linear-gradient(135deg, #e8e8e8, #d5d5d5);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-body {
    padding: 12px 14px;
}

.card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.5;
}

/* Section logo positioned top-right */
.section-logo {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 100px;
    z-index: 2;
}

/* ============================================
   9. كتيبات رمضان (Horizontal Booklets)
   ============================================ */
.booklets-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

  .booklet-card {
                        flex: 0 0 auto;
                        width: 120px;
                        text-align: center;
                        transition: all 0.3s;
                        text-decoration: none;
                        /* ← NEW: removes underline from <a> */
                        color: inherit;
                        /* ← NEW: inherits parent text color */
                        display: block;
                        /* ← NEW: makes <a> behave like <div> */
                    }

.booklet-card:hover {
    transform: translateY(-3px);
}

.booklet-thumb {
	overflow: hidden;
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #e0e0e0, #ccc);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
}
    .booklet-thumb img {
                        width: 100%;
                        height: 100%;
                        object-fit: cover;
                        /* fills thumb area, cropping if needed */
                        display: block;
                        /* removes bottom gap from inline img */
                    }

.booklet-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* ============================================
   10. بنين وبنات (Kids Buttons)
   ============================================ */
.kids-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.kids-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    /** padding: 20px;*/
    border-radius: var(--radius-lg);
    /*  min-width: 150px;
    max-width: 180px;*/
    /*flex: 1;*/
    transition: all 0.3s;
    text-align: center;
}

.kids-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.kids-btn img {
    width: 200px;
    /*height: 100px;*/
    object-fit: contain;
    /*  margin-bottom: 10px;*/
}

.kids-btn span {
    font-size: 0.9rem;
    font-weight: 800;
}

.kids-btn.color-blue {
    /* background: #f0c846;*/
    color: #333;
}

.kids-btn.color-green {
    /*   background: #a5d6a7;*/
    color: #333;
}

.kids-btn.color-purple {
    /*background: #90caf9;*/
    color: #333;
}

.kids-btn.color-pink {
    /*background: #d7b89c;*/
    color: #333;
}

/* ============================================
   11. صوتيات رمضان (Audio Table)
   ============================================ */
.audio-section-layout {
    display: flex;
    gap: 30px;
}

.audio-main {
    flex: 1;
}

.audio-sidebar {
    flex: 0 0 180px;
}

.audio-category-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.audio-category-btn {
    display: block;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    color: white;
}

.audio-category-btn.cat-red {
    background: #c0392b;
}

.audio-category-btn.cat-red.active {
    background: var(--maroon);
}

.audio-category-btn.cat-dark {
    background: #555;
    color: white;
}

.audio-category-btn.cat-gray {
    background: #bbb;
    color: white;
}

.audio-category-btn.cat-orange {
    background: #e67e22;
}

.audio-category-btn.cat-yellow {
    background: #f1c40f;
    color: #333;
}

.audio-category-btn.cat-green {
    background: #27ae60;
}

.audio-category-btn.cat-blue {
    background: #2980b9;
}

.audio-category-btn.cat-purple {
    background: #8e44ad;
}

.audio-category-btn.cat-teal {
    background: #16a085;
}

.audio-category-btn.cat-pink {
    background: #e84393;
}

.audio-category-btn:hover {
    opacity: 0.85;
    transform: translateX(-2px);
}

/* Audio items layout (Flexbox instead of Table) */
.audio-section-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.audio-main {
    flex: 1;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.audio-sidebar {
    flex: 0 0 110px;
    /* Narrower sidebar for categories */
}

.audio-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.audio-item {
    /*display: flex;*/
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f9f9f9;
    border-radius: 8px;
    transition: background 0.2s;
}

.audio-item:hover {
    background: #eee;
}

.audio-play {
    width: 36px;
    height: 36px;
    background: var(--maroon);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.audio-play svg {
    width: 16px;
    height: 16px;
    fill: white;
    margin-right: -2px;
}

.audio-info {
    flex: 0 0 70%;
    text-align: right;
}

.audio-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.audio-speaker {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.audio-progress {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    min-width: 80px;
    margin: 0 10px;
}

.audio-progress-bar {
    width: 30%;
    /* Mock progress */
    height: 100%;
    background: var(--maroon);
    border-radius: 4px;
}

.audio-duration {
    font-size: 0.7rem;
    font-weight: 700;
    color: #777;
    background: #e0e0e0;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Category buttons styles refined */
.audio-category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audio-category-btn {
    display: block;
    width: 100%;
    padding: 10px 4px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(25px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {

    .section-block>.container {
        padding: 30px 20px;
    }

    .section-decorations-inner .lantern {
        width: 100px;
        height: 90px;
    }

    .content-list-layout,
    .audio-section-layout {
        flex-direction: column;
    }

    .content-list-sidebar,
    .audio-sidebar {
        flex: none;
    }

    .sidebar-filters,
    .audio-category-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .video-small-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rowaa-btn {
        min-width: 110px;
    }

    .tab-item {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {

    .section-block {
        padding: 20px 0;
    }

    .section-block>.container {
        padding: 25px 15px;
        border-radius: var(--radius-md);
       /* margin: 0 10px;*/
    }

    .section-decorations-inner .lantern {
        width: 55px;
        height: 50px;
        opacity: 0.4;
    }

    .section-decorations-inner .star {
        display: none;
    }

    .section-header {
        margin-bottom: 20px;
    }

    .section-header-img {
        max-width: 200px;
    }

    .category-nav {
        padding: 8px 0;
        position: relative;
    }

    .category-nav::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 40px;
        height: 100%;
        background: linear-gradient(to right, var(--bg-white), transparent);
        z-index: 2;
        pointer-events: none;
    }

    .category-list {
        justify-content: flex-start;
        gap: 2px;
        padding: 0 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .category-list::-webkit-scrollbar {
        display: none;
    }

    .category-link {
        min-width: 70px;
        padding: 6px 4px;
    }

    .category-link img {
        width: 60px;
        height: 60px;
    }

    .category-link span {
        font-size: 0.55rem;
    }

    .search-title {
        font-size: 1.2rem;
    }

    .tabs-list {
        gap: 0;
    }

    .tab-item {
        padding: 8px 10px;
        font-size: 0.7rem;
    }

    .sub-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .video-main .video-thumb {
        height: 220px;
    }

    .video-small-grid {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 5px;
    }

    .kids-buttons {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .kids-btn {
        min-width: 40%;
        max-width: 45%;
        padding: 14px 10px;
    }

    .kids-btn img {
        /*    width: 60px;
        height: 60px;*/
    }

    .kids-btn span {
        font-size: 0.75rem;
    }

    .booklets-row {
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

    .booklet-card {
        width: 100px;
    }

    .rowaa-buttons {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .rowaa-btn {
        min-width: 40%;
        max-width: 45%;
        padding: 12px 8px;
    }

    .rowaa-btn img {
        width: 100%;
        height: 100px;
    }

    .section-title-banner {
        font-size: 1rem;
        padding: 6px 28px;
    }

    .container {
        padding: 0 12px;
    }

    /* Audio items stack on mobile */
    .audio-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .audio-info {
        flex: 1 1 100%;
        order: -1;
    }

    .audio-progress {
        min-width: 60px;
        margin: 0 5px;
    }

    /* عرفتك ربي logo - hide on mobile to prevent overlap */
    .section-logo {
        display: none;
    }

    .fatwa-item {
        padding: 14px 12px;
    }

    .fatwa-title {
        font-size: 0.85rem;
    }

    .fatwa-excerpt {
        font-size: 0.75rem;
    }

    /* Audio categories - horizontal scrollable on mobile */
    .audio-sidebar {
        order: -1;
    }

    .audio-category-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .audio-category-btn {
        width: auto;
        padding: 8px 14px;
        font-size: 0.7rem;
    }
}

/* ============================================
   FOOTER
   ============================================ */
.page-footer {
    background: var(--blue-dark);
    color: var(--text-light);
    padding: 40px 0 24px;
    text-align: center;
}

.footer-brand-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gold);
    display: block;
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.3s;
}

.footer-link:hover {
    color: white;
}

.footer-divider {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 16px auto;
}

.footer-copyright {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   CARD THUMB (عرفتك ربي style)
   ============================================ */
.card-thumb {
    height: 180px;
    background-color: #e0e0e0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-thumb .video-play-btn {
    opacity: 0.85;
    transition: all 0.3s;
}

.card:hover .card-thumb .video-play-btn {
    opacity: 1;
    transform: scale(1.1);
}

/* ============================================
   VIDEO POPUP MODAL
   ============================================ */
.video-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Simple modal (مرئيات رمضان) */
.video-modal {
    position: relative;
    width: 90%;
    max-width: 900px;
}

/* Enhanced modal content (عرفتك ربي + general) */
.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    z-index: 2;
}

.video-modal-close {
    position: absolute;
    top: -45px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.video-modal-close:hover {
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.2);
}

/* Counter */
.video-modal-counter {
    position: absolute;
    top: -40px;
    left: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    z-index: 10;
}

/* Navigation arrows */
.video-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.video-modal-prev {
    right: -70px;
}

.video-modal-next {
    left: -70px;
}

/* Video container (16:9) */
.video-modal-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.video-modal-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

/* Title under video */
.video-modal-title {
    text-align: center;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 16px;
    padding: 0 20px;
}

/* Responsive nav adjustments */
@media (max-width: 1100px) {
    .video-modal-prev {
        right: 10px;
        top: auto;
        bottom: -60px;
        transform: none;
    }

    .video-modal-next {
        left: 10px;
        top: auto;
        bottom: -60px;
        transform: none;
    }

    .video-modal-nav:hover {
        transform: scale(1.1);
    }
}

@media screen and (max-width: 767.9px) {
    .portalpage {
        background-image: none;
        padding: 0 !important;
    }
    
    .section-block {
        padding: 10px 10px !important;
            
    }
    
    .tabs-list
    {
        justify-content:  unset !important;       
    }        
}


/*********************************************************/


/* --- زر البحث --- */
        .search-box { position: relative; }
        .rama-search-btn {
            position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
            background: linear-gradient(135deg, #1a5276, #002d6a); color: #fff; border: none;
            border-radius: 50%; width: 42px; height: 42px; display: flex; align-items: center;
            justify-content: center; cursor: pointer; transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(0,45,106,0.3);
        }
        .rama-search-btn:hover { background: linear-gradient(135deg, #002d6a, #001a3e); transform: translateY(-50%) scale(1.05); }

        /* --- حاوية النتائج --- */
        .rama-search-results {
            background: linear-gradient(180deg, #fefaf3 0%, #fff8ee 100%);
            border-top: 3px solid #c8a96e; padding: 30px 0 40px;
            animation: ramaSlideDown 0.4s ease-out;
        }
        @keyframes ramaSlideDown { from { opacity:0; transform:translateY(-20px); } to { opacity:1; transform:translateY(0); } }

        /* --- رأس النتائج --- */
        .rama-results-header {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid rgba(200,169,110,0.3);
        }
        .rama-results-title {
            font-family: 'Lotus Linotype','Traditional Arabic',serif; font-size: 20px;
            color: #002d6a; font-weight: bold; display: flex; align-items: center; gap: 8px; margin: 0;
            flex-wrap: wrap;
        }
        .rama-results-title span { color: #8b1a2b; }
        .rama-results-title .rama-title-label { color: #002d6a; }
        .rama-close-results {
            background: none; border: 2px solid #c8a96e; color: #8b1a2b; font-size: 28px;
            width: 40px; height: 40px; min-width: 40px; border-radius: 50%; cursor: pointer;
            display: flex; align-items: center; justify-content: center; transition: all 0.3s; line-height: 1;
        }
        .rama-close-results:hover { background: #8b1a2b; color: #fff; border-color: #8b1a2b; }

        /* --- التبويبات --- */
        .rama-search-tabs-wrap {
            margin-bottom: 20px;
        }
        .rama-search-tabs {
            display: flex; gap: 8px; flex-wrap: nowrap;
        }
        .rama-tab {
            font-family: 'Lotus Linotype','Traditional Arabic',serif; font-size: 17px;
            padding: 10px 24px; border: 2px solid #c8a96e; background: #fff; color: #002d6a;
            border-radius: 30px; cursor: pointer; transition: all 0.3s ease;
            display: flex; align-items: center; gap: 6px; font-weight: bold;
            white-space: nowrap; flex-shrink: 0;
        }
        .rama-tab:hover { background: rgba(200,169,110,0.15); }
        .rama-tab.active {
            background: linear-gradient(135deg, #002d6a, #1a5276); color: #fff;
            border-color: #002d6a; box-shadow: 0 3px 10px rgba(0,45,106,0.3);
        }
        .rama-tab.active svg { stroke: #c8a96e; }
        .rama-tab-count {
            background: #c8a96e; color: #fff; font-size: 13px; padding: 1px 8px;
            border-radius: 12px; font-weight: bold; min-width: 22px; text-align: center;
        }
        .rama-tab.active .rama-tab-count { background: rgba(255,255,255,0.3); color: #fff; }

        /* --- لوحة المحتوى --- */
        .rama-tab-panel { display: none; }
        .rama-tab-panel.active { display: block; animation: ramaFadeIn 0.3s ease; }
        @keyframes ramaFadeIn { from { opacity:0; } to { opacity:1; } }

        .rama-loading {
            text-align: center; padding: 40px 20px; color: #666;
            font-family: 'Lotus Linotype','Traditional Arabic',serif; font-size: 18px; display: none;
        }
        .rama-loading.show { display: flex; align-items: center; justify-content: center; gap: 12px; }
        .rama-spinner {
            width: 28px; height: 28px; border: 3px solid rgba(200,169,110,0.3);
            border-top-color: #002d6a; border-radius: 50%; animation: ramaSpin 0.8s linear infinite;
        }
        @keyframes ramaSpin { to { transform: rotate(360deg); } }

        /* --- تنسيق بطاقات النتائج --- */
        .rama-tab-content .global-searchresult { background: transparent; }
        .rama-tab-content .oneitems.search-results { list-style: none; padding: 0; margin: 0; }
        .rama-tab-content .oneitems.search-results.w-border { border: none; }
        .rama-tab-content .oneitems.search-results li {
            background: #fff; border: 1px solid rgba(200,169,110,0.3); border-radius: 12px;
            padding: 18px 24px 18px 18px !important; margin-bottom: 12px;
            transition: all 0.3s ease; box-shadow: 0 1px 4px rgba(0,0,0,0.04); background-image: none !important;
        }
        .rama-tab-content .oneitems.search-results li:hover {
            border-color: #c8a96e; box-shadow: 0 4px 16px rgba(200,169,110,0.2); transform: translateY(-1px);
        }
        .rama-tab-content .oneitems.search-results li h5 {
            font-family: 'Lotus Linotype','Traditional Arabic',serif; font-size: 19px !important; margin-bottom: 10px !important;
        }
        .rama-tab-content .oneitems.search-results li h5 a { color: #002d6a !important; text-decoration: none; transition: color 0.2s; }
        .rama-tab-content .oneitems.search-results li h5 a:hover { color: #8b1a2b !important; }
        .rama-tab-content .oneitems.search-results li .desc {
            font-family: 'Lotus Linotype','Traditional Arabic',serif; font-size: 16px; color: #444; line-height: 180% !important;
        }
        .rama-tab-content .oneitems.search-results li .book-name {
            color: #888; font-size: 14px !important; margin-top: 12px !important;
            padding-top: 10px; border-top: 1px dashed rgba(200,169,110,0.3);
        }
        .rama-tab-content .oneitems.search-results li .book-name span { font-size: 14px !important; color: #8b6914; }
        .rama-tab-content .oneitems.search-results li .book-name a { color: #8b6914 !important; text-decoration: none; }

        /* ===== Pagination ===== */
        .rama-paging {
            display: flex; align-items: center; justify-content: center;
            gap: 6px; margin-top: 24px; padding-top: 20px;
            border-top: 1px solid rgba(200,169,110,0.25); flex-wrap: nowrap;
        }
        .rama-paging:empty { display: none; border: none; margin: 0; padding: 0; }
        .rama-paging-info {
            font-family: 'Lotus Linotype','Traditional Arabic',serif;
            font-size: 15px; color: #777; margin-left: 12px; margin-right: 12px; white-space: nowrap;
        }
        .rama-page-btn {
            font-family: 'Lotus Linotype','Traditional Arabic',serif;
            min-width: 40px; height: 40px; padding: 0 6px;
            border: 2px solid #c8a96e; background: #fff; color: #002d6a;
            border-radius: 10px; cursor: pointer; font-size: 16px; font-weight: bold;
            display: inline-flex; align-items: center; justify-content: center;
            transition: all 0.25s ease;
        }
        .rama-page-btn:hover:not(.active):not(:disabled) { background: rgba(200,169,110,0.15); border-color: #b89a5a; }
        .rama-page-btn.active {
            background: linear-gradient(135deg, #002d6a, #1a5276); color: #fff; border-color: #002d6a;
            box-shadow: 0 2px 8px rgba(0,45,106,0.3); pointer-events: none;
        }
        .rama-page-btn:disabled { opacity: 0.4; cursor: default; }
        .rama-page-nav { min-width: 80px; gap: 4px; font-size: 15px; }
        .rama-page-nav svg { width: 16px; height: 16px; flex-shrink: 0; }
        .rama-page-dots {
            font-size: 18px; color: #999; min-width: 24px; text-align: center;
            display: inline-flex; align-items: center; justify-content: center; height: 40px;
        }

        /* ========================================= */
        /* ===== تحسينات الجوال - Mobile First ===== */
        /* ========================================= */
        @media (max-width: 768px) {

            /* --- حاوية النتائج --- */
            .rama-search-results { padding: 16px 0 24px; }
            .rama-search-results .container { padding-left: 12px; padding-right: 12px; }

            /* --- رأس النتائج مضغوط --- */
            .rama-results-header { margin-bottom: 14px; padding-bottom: 10px; gap: 8px; }
            .rama-results-title {
                font-size: 16px; gap: 5px;
            }
            .rama-results-title svg { width: 16px; height: 16px; min-width: 16px; }
            .rama-close-results { width: 34px; height: 34px; min-width: 34px; font-size: 22px; }

            /* --- التبويبات - سطر واحد قابل للسحب --- */
            .rama-search-tabs-wrap {
                margin-left: -12px; margin-right: -12px;
                padding-left: 12px; padding-right: 12px;
                overflow-x: auto; overflow-y: hidden;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none; /* Firefox */
                margin-bottom: 16px;
            }
            .rama-search-tabs-wrap::-webkit-scrollbar { display: none; }
            .rama-search-tabs {
                display: inline-flex; flex-wrap: nowrap; gap: 6px;
                padding-bottom: 4px; min-width: max-content;
            }
            .rama-tab {
                font-size: 14px; padding: 8px 14px; gap: 4px;
                border-radius: 25px; border-width: 1.5px;
            }
            .rama-tab svg { width: 14px; height: 14px; }
            .rama-tab-count { font-size: 11px; padding: 0 6px; min-width: 18px; }

            /* --- بطاقات النتائج --- */
            .rama-tab-content .oneitems.search-results li {
                padding: 14px 14px 12px !important; margin-bottom: 10px;
                border-radius: 10px;
            }
            .rama-tab-content .oneitems.search-results li h5 {
                font-size: 17px !important; margin-bottom: 8px !important; line-height: 160%;
            }
            .rama-tab-content .oneitems.search-results li .desc {
                font-size: 14px; line-height: 170% !important;
            }
            .rama-tab-content .oneitems.search-results li .book-name {
                font-size: 12px !important; margin-top: 8px !important; padding-top: 8px;
            }
            .rama-tab-content .oneitems.search-results li .book-name span { font-size: 12px !important; }

            /* --- زر البحث --- */
            .rama-search-btn { width: 36px; height: 36px; left: 8px; }
            .rama-search-btn svg { width: 18px; height: 18px; }

            /* --- مؤشر التحميل --- */
            .rama-loading { padding: 30px 16px; font-size: 16px; }

            /* --- Pagination مضغوط في سطر واحد --- */
            .rama-paging {
                gap: 4px; margin-top: 16px; padding-top: 14px;
                flex-wrap: nowrap; justify-content: center;
            }
            .rama-paging-info {
                font-size: 12px; margin-left: 6px; margin-right: 6px;
                order: -1; flex-basis: 100%; text-align: center; margin-bottom: 8px;
            }
            .rama-page-btn {
                min-width: 34px; height: 34px; font-size: 14px;
                border-radius: 8px; border-width: 1.5px; padding: 0 4px;
            }
            .rama-page-nav {
                min-width: auto; padding: 0 8px; font-size: 13px; gap: 3px;
            }
            .rama-page-nav svg { width: 14px; height: 14px; }
            .rama-page-dots { min-width: 20px; font-size: 16px; height: 34px; }
        }

        /* --- شاشات صغيرة جداً --- */
        @media (max-width: 380px) {
            .rama-results-title { font-size: 14px; }
            .rama-results-title svg { display: none; }
            .rama-tab { font-size: 13px; padding: 7px 10px; }
            .rama-tab svg { display: none; }
            .rama-page-btn { min-width: 30px; height: 30px; font-size: 13px; }
            .rama-page-nav { font-size: 12px; padding: 0 6px; }
            .rama-page-dots { height: 30px; min-width: 16px; }
            .rama-paging-info { font-size: 11px; }
        }