/* 
 * Hadith Chapter Display Plugin Styles 
 * This is a copy of the original styles.css file, with added prefixes to avoid conflicts.
 */

/* Base Styles and Variables */
:root {
    /* Enhanced Islamic-inspired Palette with bright green primary */
    --gradient-primary: linear-gradient(135deg, #23DE00, #0F9B00);
    --gradient-secondary: linear-gradient(135deg, #23DE00, #84FF69);
    --gradient-accent: linear-gradient(135deg, #ff9800, #f44336);
    --gradient-dark: linear-gradient(135deg, #006600, #004d00);
    
    /* Base Colors */
    --primary-color: #23DE00;
    --primary-light: #84FF69;
    --primary-dark: #0F9B00;
    --accent-color: #ff9800;
    --accent-light: #ffc947;
    --accent-dark: #c66900;
    --text-color: #212121;
    --text-light: #757575;
    --bg-color: #f5fffb;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --hadith-bg: #f5fff0;
    --hadith-border: rgba(35, 222, 0, 0.3);
    
    /* Authentication Grade Colors */
    --sahih-color: #23DE00;
    --hassan-color: #FFB800;
    --daif-color: #ff2600;
    --mawdu-color: #000000;
    
    /* Shadows & Effects */
    --shadow-sm: 0 2px 10px rgba(35, 222, 0, 0.1);
    --shadow: 0 8px 16px rgba(35, 222, 0, 0.16), 0 3px 6px rgba(35, 222, 0, 0.1);
    --shadow-lg: 0 16px 24px rgba(35, 222, 0, 0.22), 0 6px 12px rgba(35, 222, 0, 0.12);
    --glow: 0 0 20px rgba(35, 222, 0, 0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;
    
    /* Typography */
    --font-primary: 'Playfair Display', serif;
    --font-secondary: 'Poppins', sans-serif;
    --font-arabic: 'Amiri', serif;
    --font-bengali: 'Hind Siliguri', sans-serif;

    /* Authenticity color variables */
    --sahih-color: #23DE00;
    --hassan-color: #FFB800;
    --daif-color: #FF4500;
    --mawdu-color: #000000;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    /* Modern Dark Islamic-inspired Gradients */
    --gradient-primary: linear-gradient(135deg, #1EB900, #006600);
    --gradient-secondary: linear-gradient(135deg, #1EB900, #006600);
    --gradient-accent: linear-gradient(135deg, #ff9800, #f44336);
    --gradient-dark: linear-gradient(135deg, #006600, #003300);
    
    /* Base Colors */
    --primary-color: #23DE00;
    --primary-light: #84FF69;
    --primary-dark: #0F9B00;
    --accent-color: #ff9800;
    --accent-light: #ffc947;
    --accent-dark: #c66900;
    --text-color: #f5f5f5;
    --text-light: #bdbdbd;
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --border-color: #333333;
    --hadith-bg: #0e1f0e;
    --hadith-border: rgba(35, 222, 0, 0.2);
    
    /* Shadows & Effects */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow: 0 8px 16px rgba(0, 0, 0, 0.4), 0 3px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 24px rgba(0, 0, 0, 0.5), 0 6px 12px rgba(0, 0, 0, 0.4);
    --glow: 0 0 20px rgba(35, 222, 0, 0.4);
}

/* WordPress Integration Styles */
.hcd-wrapper {
    /* Default font styles */
    font-family: var(--font-secondary);
    line-height: 1.6;
}

/* Ensure app-container works within WordPress */
.hcd-wrapper .app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Main Content Styles */
.hcd-wrapper .main-content {
    display: flex;
    flex: 1;
    padding: 2rem 1rem;
    gap: 2rem;
}

/* Hero Section Styles */
.hcd-wrapper .hero-section {
    background: var(--gradient-primary);
    margin: 1.5rem 0.5rem 1rem;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    padding: 3rem 2rem;
    box-shadow: var(--shadow-lg);
    color: white;
    display: flex;
    justify-content: center;
    min-height: 320px;
}

.hcd-wrapper .hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hcd-wrapper .hero-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hcd-wrapper .hero-logo i {
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: pulse 3s infinite ease-in-out;
}

.hcd-wrapper .logo-text {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 2.5rem;
    letter-spacing: -0.5px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hcd-wrapper .primary-text {
    color: var(--accent-light);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hcd-wrapper .hero-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 2rem;
    max-width: 600px;
    opacity: 0.9;
    text-align: center;
}

.hcd-wrapper .hero-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 600px;
}

/* Enhanced hero quote design */
.hcd-wrapper .hero-quote {
    margin: 1.5rem 0 2rem;
    position: relative;
    max-width: 600px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hcd-wrapper .quote-icon {
    color: var(--accent-light);
    font-size: 1.8rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    display: block;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.hcd-wrapper .hero-quote blockquote {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    line-height: 1.5;
    font-weight: 500;
    font-style: italic;
    color: white;
    margin: 0;
    padding: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Language Switcher Styles */
.hcd-wrapper .language-switcher {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0 auto;
}

.hcd-wrapper .lang-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-lg);
    background-color: transparent;
    color: white;
    font-family: var(--font-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.hcd-wrapper .lang-btn.active {
    background-color: var(--accent-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.hcd-wrapper .lang-btn:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Sidebar Styles */
.hcd-wrapper .sidebar {
    width: 280px;
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: var(--shadow);
    height: fit-content;
    position: relative;
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
}

.hcd-wrapper .sidebar-sticky-container {
    position: sticky;
    top: 6rem;
}

.hcd-wrapper .sidebar-title {
    font-family: var(--font-primary);
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 0.5rem;
}

.hcd-wrapper .sidebar-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 3px;
}

/* Collections section (Topics in chapter page) */
.hcd-wrapper .collections-section {
    margin-top: 1.8rem;
}

.hcd-wrapper .collections-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 1rem;
}

.hcd-wrapper .collection-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    background-color: var(--bg-color);
    transition: var(--transition);
    cursor: pointer;
}

.hcd-wrapper .collection-item i {
    color: var(--primary-color);
}

.hcd-wrapper .collection-item:hover {
    background-color: rgba(74, 125, 222, 0.1);
    transform: translateX(5px);
}

.hcd-wrapper .collection-item.active {
    background-color: var(--primary-color);
    color: white;
}

.hcd-wrapper .collection-item.active i {
    color: white;
}

/* Topics Container Styles */
.hcd-wrapper .topics-container {
    flex: 1;
}

.hcd-wrapper .topics-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(74, 125, 222, 0.1);
}

.hcd-wrapper .topics-title-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hcd-wrapper .topics-title {
    font-family: var(--font-primary);
    font-size: 2rem;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

.hcd-wrapper .topics-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 3px;
}

.hcd-wrapper .topics-subtitle {
    color: var(--text-light);
    font-size: 1rem;
    max-width: 450px;
}

.hcd-wrapper .topics-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.hcd-wrapper .topics-stats {
    color: var(--text-light);
    font-size: 1rem;
    background-color: var(--card-bg);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hcd-wrapper .topics-count {
    font-weight: 600;
    color: var(--primary-color);
}

.hcd-wrapper .topics-filter select {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-lg);
    border: none;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: var(--font-secondary);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
}

/* Filter Section */
.hcd-wrapper .filter-section {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
}

.hcd-wrapper .filter-title {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hcd-wrapper .filter-search {
    position: relative;
    margin-bottom: 1rem;
    width: 100%;
}

.hcd-wrapper .filter-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 0.95rem;
    transition: var(--transition);
}

.hcd-wrapper .filter-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1rem;
}

.hcd-wrapper .filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.hcd-wrapper .filter-tag {
    background: white;
    border: 1px solid rgba(35, 222, 0, 0.3);
    border-radius: 30px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    cursor: pointer;
}

.hcd-wrapper .filter-tag:hover {
    background: rgba(35, 222, 0, 0.1);
    transform: translateY(-2px);
}

.hcd-wrapper .filter-tag.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Authenticity Filters */
.hcd-wrapper .authenticity-filters {
    margin-top: 1rem;
    width: 100%;
}

.hcd-wrapper .filter-search-bar {
    width: 100%;
    padding: 0.5rem 0;
}

.hcd-wrapper .authenticity-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.hcd-wrapper .filter-section .authenticity-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    background-color: var(--hadith-bg);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--hadith-border);
}

/* Add specific styles for each authenticity level with more specific selectors */
.hcd-wrapper .filter-section .authenticity-sahih,
.filter-section .authenticity-tag.authenticity-sahih,
.authenticity-tags .authenticity-sahih {
    background-color: rgba(35, 222, 0, 0.1) !important;
    border-color: rgba(35, 222, 0, 0.5) !important;
    color: var(--sahih-color) !important;
}

.hcd-wrapper .filter-section .authenticity-hassan,
.filter-section .authenticity-tag.authenticity-hassan,
.authenticity-tags .authenticity-hassan {
    background-color: rgba(255, 184, 0, 0.1) !important;
    border-color: rgba(255, 184, 0, 0.5) !important;
    color: var(--hassan-color) !important;
}

.hcd-wrapper .filter-section .authenticity-daif,
.filter-section .authenticity-tag.authenticity-daif,
.authenticity-tags .authenticity-daif {
    background-color: rgba(255, 69, 0, 0.1) !important;
    border-color: rgba(255, 69, 0, 0.5) !important;
    color: var(--daif-color) !important;
}

.hcd-wrapper .filter-section .authenticity-mawdu,
.filter-section .authenticity-tag.authenticity-mawdu,
.authenticity-tags .authenticity-mawdu {
    background-color: rgba(2, 1, 1, 0.1) !important;
    border-color: rgba(0, 0, 0, 0.5) !important;
    color: var(rgba(0, 0, 0, 0.5)) !important;
}

.hcd-wrapper .authenticity-tag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.hcd-wrapper .authenticity-tag.active {
    filter: brightness(1.2);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.hcd-wrapper .authenticity-sahih.active,
.filter-section .authenticity-tag.authenticity-sahih.active,
.authenticity-tags .authenticity-sahih.active {
    background-color: rgba(35, 222, 0, 0.5) !important;
    color: #105500 !important;
    border-color: var(--sahih-color) !important;
}

.hcd-wrapper .authenticity-hassan.active,
.filter-section .authenticity-tag.authenticity-hassan.active,
.authenticity-tags .authenticity-hassan.active {
    background-color: rgba(255, 184, 0, 0.5) !important;
    color: #7a5000 !important;
    border-color: var(--hassan-color) !important;
}

.hcd-wrapper .authenticity-daif.active,
.filter-section .authenticity-tag.authenticity-daif.active,
.authenticity-tags .authenticity-daif.active {
    background-color: rgba(255, 69, 0, 0.5) !important;
    color: #802b00 !important;
    border-color: var(--daif-color) !important;
}

.hcd-wrapper .authenticity-mawdu.active,
.filter-section .authenticity-tag.authenticity-mawdu.active,
.authenticity-tags .authenticity-mawdu.active {
    background-color: rgba(0, 0, 0, 0.5) !important;
    color: #fcfcfc !important;
    border-color: var(--mawdu-color) !important;
}

/* Featured Hadith - REMOVED */
.hcd-wrapper .featured-hadith {
    display: none;
}

.hcd-wrapper .featured-hadith-content {
    display: none;
}

.hcd-wrapper .featured-tag {
    display: none;
}

.hcd-wrapper .featured-meta {
    display: none;
}

.hcd-wrapper .featured-link {
    display: none;
}

/* End of featured hadith removal */

/* Hadiths Grid */
.hcd-wrapper .hadiths-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.hcd-wrapper .hadiths-grid.list-view {
    grid-template-columns: 1fr;
}

.hcd-wrapper .hadiths-grid.masonry-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    grid-auto-rows: 20px;
    grid-gap: 1.5rem;
}

/* Pagination Styles */
.hcd-wrapper .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.hcd-wrapper .pagination-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background-color: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.hcd-wrapper .page-numbers {
    display: flex;
    gap: 0.5rem;
}

.hcd-wrapper .page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background-color: #23DE00;
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background-color: #1fca00;
    transform: translateY(-3px);
}

/* Hero Section Decorations */
.hcd-wrapper .hero-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.hcd-wrapper .decoration-circle {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    z-index: 1;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.hcd-wrapper .decoration-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.07;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(255, 255, 255, 0.1) 20px, rgba(255, 255, 255, 0.1) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(255, 255, 255, 0.1) 20px, rgba(255, 255, 255, 0.1) 40px);
    background-size: 80px 80px;
    z-index: 0;
}

.hcd-wrapper .decoration-islamic-pattern {
    position: absolute;
    bottom: -5%;
    right: 2%;
    width: 300px;
    height: 300px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj48cGF0aCBmaWxsPSIjZmZmZmZmIiBvcGFjaXR5PSIwLjE1IiBkPSJNMjUsMjVIMjI1TDEyNSwxMjVMMjUsMjUiLz48cGF0aCBmaWxsPSIjZmZmZmZmIiBvcGFjaXR5PSIwLjE1IiBkPSJNMjUsMjI1SDIyNUwxMjUsMTI1TDI1LDIyNSIvPjxwYXRoIGZpbGw9IiNmZmZmZmYiIG9wYWNpdHk9IjAuMTUiIGQ9Ik0yMjUsMjVWMjI1TDEyNSwxMjVMMjI1LDI1Ii8+PHBhdGggZmlsbD0iI2ZmZmZmZiIgb3BhY2l0eT0iMC4xNSIgZD0iTTI1LDI1VjIyNUwxMjUsMTI1TDI1LDI1Ii8+PC9zdmc+');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 0;
    transform: rotate(5deg);
    opacity: 0.12;
}

.hcd-wrapper .decoration-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.2) 1px, transparent 2px),
        radial-gradient(circle at 40% 70%, rgba(255, 255, 255, 0.2) 1px, transparent 2px),
        radial-gradient(circle at 60% 20%, rgba(255, 255, 255, 0.2) 1px, transparent 2px),
        radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.2) 1px, transparent 2px);
    background-size: 200px 200px;
    z-index: 0;
}

.hcd-wrapper .decoration-calligraphy {
    position: absolute;
    top: 10%;
    right: 5%;
    width: 180px;
    height: 180px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48cGF0aCBmaWxsPSIjZmZmZmZmIiBvcGFjaXR5PSIwLjEiIGQ9Ik01MCwxMCBMOTAsNTAgTDUwLDkwIEwxMCw1MCBaIi8+PC9zdmc+');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.15;
    z-index: 0;
    transform: rotate(-5deg);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .hcd-wrapper .main-content {
        flex-direction: column;
    }
    
    .hcd-wrapper .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 2rem;
    }
    
    .hcd-wrapper .collections-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .hcd-wrapper .collection-item {
        margin-bottom: 0;
        flex: 1 0 auto;
    }
}

@media (max-width: 768px) {
    .hcd-wrapper .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .hcd-wrapper .topics-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .hcd-wrapper .topics-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .hcd-wrapper .collections-list {
        grid-template-columns: 1fr 1fr;
    }
    
    .hcd-wrapper .hadiths-grid.masonry-view {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 480px) {
    .hcd-wrapper .main-content {
        padding: 1rem 0.5rem;
    }
    
    .hcd-wrapper .topics-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hcd-wrapper .topics-filter {
        width: 100%;
    }
    
    .hcd-wrapper .topics-filter select {
        width: 100%;
    }
    
    .hcd-wrapper .collections-list {
        grid-template-columns: 1fr;
    }
    
    .hcd-wrapper .hadiths-grid.masonry-view {
        grid-template-columns: 1fr;
    }
    
    .hcd-wrapper .authenticity-tags {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile-specific card styling */
    .topic-card .topic-narrator-row {
        gap: 6px;
        align-items: center;
    }
    
    .topic-card .topic-narrator {
        max-width: 55%;
        padding: 3px 8px;
        font-size: 0.8rem;
    }
    
    .topic-card .authenticity-tag {
        min-width: 60px;
        padding: 3px 8px;
        font-size: 0.8rem;
    }
    
    .hadith-content {
        padding: 12px 15px 8px;
    }
    
    .topic-meta {
        gap: 8px;
        padding: 8px 12px;
    }
    
    .topic-card .button-container {
        margin-top: 3px;
    }
    
    .topic-card .topic-link {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* TOPIC CARD STYLES - CRITICAL FIX */
.topic-card {
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    padding: 15px;
    margin-bottom: 20px;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.topic-card .hadith-content {
    padding: 15px 20px 10px;
    position: relative;
    padding-bottom: 8px;
}

.topic-card .hadith-text-container {
    position: relative;
    padding-left: 25px;
    line-height: 1.5;
}

.topic-card .quote-icon-small {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 18px;
    color: #23DE00;
    opacity: 0.5;
}

.topic-card .topic-meta {
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* NARRATOR ROW - CRITICAL FIX */
.topic-card .topic-narrator-row {
    display: flex;
    width: 100%;
    justify-content: space-between !important;
    align-items: center;
    padding: 0 !important;
    margin: 0 !important;
    gap: 10px !important;
}

.topic-card .topic-narrator {
    flex: 1 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60% !important;
    padding: 4px 10px;
    margin: 0 !important;
    background-color: rgba(240, 240, 240, 0.7);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

.topic-card .topic-narrator i {
    margin-right: 6px;
    color: #23DE00;
}

.topic-card .authenticity-tag {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 4px 10px;
    min-width: 65px;
    text-align: center;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    justify-content: center;
}

.topic-card .authenticity-tag i {
    margin-right: 6px;
    font-size: 0.9rem;
}

.topic-card .hadith-reference {
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 5px auto;
    padding: 4px 12px;
    background-color: rgba(140, 255, 170, 0.15);
    border: 1px solid rgba(35, 222, 0, 0.15);
    border-radius: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #247c00;
    font-weight: 500;
}

.topic-card .hadith-reference i {
    margin-right: 6px;
    color: var(--primary-color);
}

.topic-card .button-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 5px;
    padding: 0;
}

.topic-card .topic-link {
    padding: 6px 14px;
    background-color: #23DE00;
    color: white;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.topic-card .topic-link:hover {
    background-color: #1db100;
    transform: translateY(-2px);
}

.topic-card .topic-link i {
    margin-left: 2px;
    transition: transform 0.2s;
    font-size: 0.8rem;
}

.topic-card .topic-link:hover i {
    transform: translateX(3px);
}

/* Authenticity color styles */
.authenticity-sahih {
    color: var(--sahih-color);
    border: 1px solid var(--sahih-color);
    background-color: rgba(35, 222, 0, 0.1);
}

.authenticity-hassan, .authenticity-hasan {
    color: var(--hassan-color);
    border: 1px solid var(--hassan-color);
    background-color: rgba(255, 184, 0, 0.1);
}

.authenticity-daif {
    color: var(--daif-color);
    border: 1px solid var(--daif-color);
    background-color: rgba(255, 69, 0, 0.1);
}

.authenticity-mawdu, .authenticity-maudu {
    color: var(--mawdu-color);
    border: 1px solid var(--mawdu-color);
    background-color: rgba(0, 0, 0, 0.1);
}

/* Mobile Specific Styles */
@media (max-width: 480px) {
    .topic-card .topic-narrator-row {
        gap: 5px !important;
    }
    
    .topic-card .topic-narrator {
        max-width: 60% !important;
        padding: 3px 8px;
        font-size: 0.8rem;
    }
    
    .topic-card .authenticity-tag {
        min-width: 60px;
        padding: 3px 8px;
        font-size: 0.8rem;
    }
    
    .topic-card .topic-meta {
        gap: 8px;
        padding: 8px 12px;
    }
    
    .topic-card .hadith-content {
        padding: 12px 15px 8px;
    }
    
    .topic-card .button-container {
        margin-top: 3px;
    }
    
    .topic-card .topic-link {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
} 
