/* ============================================
   KangSantri.com - Islamic Fiqh Reference
   Design System & Styles
   ============================================ */

/* Google Fonts moved to HTML head for better performance */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    /* Colors - Islamic Green & Gold */
    --primary: #1a6b3c;
    --primary-dark: #0f4d2a;
    --primary-light: #2d8f54;
    --primary-50: rgba(26, 107, 60, 0.08);
    --primary-100: rgba(26, 107, 60, 0.15);

    --gold: #c9a84c;
    --gold-light: #e3c96e;
    --gold-dark: #a88a35;

    --bg: #faf8f4;
    --bg-warm: #f5f0e8;
    --bg-card: #ffffff;

    --text: #2c2c2c;
    --text-secondary: #4b4b4b;
    --text-muted: #666666;
    --text-light: #ffffff;

    --border: #e8e2d8;
    --border-light: #f0ebe3;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 16px 60px rgba(0, 0, 0, 0.12);

    /* Typography */
    --font-body: 'Outfit', sans-serif;
    --font-arabic: 'Amiri', serif;

    /* Spacing */
    --container: 1200px;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Container
   ============================================ */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    background: var(--primary-dark);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-light);
    font-weight: 700;
    font-size: 1.3rem;
}

.navbar-brand .brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary-dark);
    box-shadow: 0 2px 10px rgba(201, 168, 76, 0.3);
}

.navbar-brand span {
    color: var(--gold-light);
}

.navbar-brand .brand-text {
    color: inherit;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    padding: 80px 0;
    position: relative;
    overflow: visible;
    z-index: 50;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero::after {
    content: '﷽';
    position: absolute;
    top: 50%;
    right: -5%;
    transform: translateY(-50%);
    font-family: serif;
    font-size: 12rem;
    color: rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 100;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    padding: 6px 18px;
    border-radius: 50px;
    color: var(--gold-light);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero h1 span {
    color: var(--gold-light);
}

.hero-arabic {
    font-family: var(--font-arabic);
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    direction: rtl;
}

.hero p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-bottom: 36px;
    line-height: 1.8;
}

/* Search */
.search-box {
    max-width: 560px;
    margin: 0 auto;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 18px 60px 18px 24px;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 1rem;
    font-family: var(--font-body);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    color: var(--text);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    outline: none;
    background: white;
    box-shadow: var(--shadow-xl), 0 0 0 4px rgba(201, 168, 76, 0.2);
}

.search-box button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-50%) scale(1.05);
}

/* Live Search Dropdown */
.search-box {
    position: relative;
    z-index: 9999;
}

.live-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 99999;
    max-height: 420px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.live-search-dropdown.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.live-search-dropdown .dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.live-search-dropdown .dropdown-header .result-count {
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
}

.live-search-item {
    display: flex;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.live-search-item:last-child {
    border-bottom: none;
}

.live-search-item:hover {
    background: var(--primary-50);
}

.live-search-item .search-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.live-search-item .search-info {
    flex: 1;
    min-width: 0;
}

.live-search-item .search-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-search-item .search-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.live-search-item .search-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-search-footer {
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid var(--border-light);
    background: var(--bg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.live-search-footer a {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.live-search-footer a:hover {
    color: var(--primary-dark);
}

.live-search-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
}

.live-search-empty .empty-emoji {
    font-size: 2rem;
    margin-bottom: 8px;
}

.live-search-loading {
    padding: 24px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.live-search-loading .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

mark.search-highlight {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: var(--primary-dark);
    padding: 0 3px;
    border-radius: 3px;
    font-weight: 600;
}

/* ============================================
   Stats Bar
   ============================================ */
.stats-bar {
    background: white;
    border-bottom: 1px solid var(--border-light);
    padding: 20px 0;
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================
   Section Headers
   ============================================ */
.section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto;
}

.section-header .underline {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    border-radius: 3px;
    margin: 16px auto 0;
}

/* ============================================
   Category Pills
   ============================================ */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 50px;
    background: white;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.category-pill:hover,
.category-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.category-pill .pill-icon {
    font-size: 1.1rem;
}

/* ============================================
   Article Cards
   ============================================ */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 28px;
}

.article-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.article-card-body {
    padding: 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-card .card-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-50);
    padding: 5px 14px;
    border-radius: 50px;
    margin-bottom: 14px;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--text);
    transition: var(--transition-fast);
}

.article-card:hover h3 {
    color: var(--primary);
}

.article-card .card-excerpt {
    font-size: 0.93rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    flex: 1;
}

.article-card .card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-meta-item .meta-icon {
    width: 28px;
    height: 28px;
    background: var(--bg-warm);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.card-meta-item strong {
    color: var(--text);
    font-weight: 600;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 16px;
    transition: var(--transition);
}

.card-link:hover {
    gap: 10px;
    color: var(--primary-dark);
}

/* ============================================
   Article Detail
   ============================================ */
.article-detail {
    padding: 48px 0;
}

.article-detail .article-container {
    max-width: 800px;
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .separator {
    color: var(--border);
}

.article-header {
    margin-bottom: 36px;
}

.article-header .article-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-50);
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 20px;
}

.article-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 24px;
    background: var(--bg-warm);
    border-radius: var(--radius);
    border-left: 4px solid var(--gold);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.info-item .info-icon {
    font-size: 1.1rem;
}

.info-item .info-label {
    color: var(--text-muted);
}

.info-item .info-value {
    font-weight: 600;
    color: var(--text);
}

/* Article Content */
.article-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 48px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-50);
}

.article-content h2:first-child {
    margin-top: 0;
}

.article-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 12px;
}

.article-content p {
    margin-bottom: 16px;
    line-height: 1.9;
    color: var(--text);
}

.article-content blockquote {
    margin: 24px 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary-50), transparent);
    border-left: 4px solid var(--gold);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-family: var(--font-arabic);
    font-size: 1.15rem;
    line-height: 2;
    color: var(--primary-dark);
}

.article-content ul,
.article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.article-content strong {
    color: var(--primary-dark);
    font-weight: 700;
}

.article-content em {
    color: var(--text-secondary);
    font-style: italic;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.article-content th {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
}

.article-content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.article-content tr:nth-child(even) {
    background: var(--bg);
}

/* Related Articles */
.related-section {
    margin-top: 48px;
}

.related-section h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ============================================
   Tentang Page
   ============================================ */
.about-page {
    padding: 60px 0;
}

.about-card {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-lg);
    padding: 48px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.about-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 32px 0 16px;
}

.about-card h2:first-child {
    margin-top: 0;
}

.about-card p {
    margin-bottom: 16px;
    line-height: 1.9;
}

.about-card ul {
    padding-left: 24px;
    margin-bottom: 16px;
}

.about-card li {
    margin-bottom: 8px;
    line-height: 1.8;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: white;
}

.pagination a:hover {
    background: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination span.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 48px 0 24px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer-brand h3 span {
    color: var(--gold-light);
}

.footer-brand p {
    font-size: 0.93rem;
    line-height: 1.7;
    max-width: 320px;
}

.footer-links h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--gold-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
}

/* ============================================
   Scroll Animations
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Loading skeleton
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-warm) 25%, #ede8de 50%, var(--bg-warm) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   Comments UI & Nested Replies — Premium
   ============================================ */

/* Section wrapper */
.comments-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid var(--border-light);
}

.comments-section .section-header h3 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Comment Form Card */
.comment-form-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8faf9 100%);
    padding: 28px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    margin-bottom: 36px;
    transition: all 0.3s ease;
}

.comment-form-card h4,
.comment-form-card #form-title {
    font-size: 1.15rem;
    color: var(--text);
    margin: 0;
}

.comment-form-card .form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    background: white;
    color: var(--text);
}

.comment-form-card .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.1);
}

.comment-form-card textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.comment-form-card label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.comment-form-card .btn-primary {
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.comment-form-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 107, 60, 0.25);
}

/* Admin info banner */
.admin-comment-banner {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    border-left: 4px solid #0ea5e9;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Comment Cards */
.comment-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    position: relative;
}

.comment-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.comment-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.comment-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-100) 0%, #c6f6d5 100%);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(26, 107, 60, 0.12);
}

.comment-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comment-meta h5 {
    margin: 0;
    font-size: 0.98rem;
    color: var(--text);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.comment-meta span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.admin-badge {
    background: #059669;
    color: #ffffff !important;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
    line-height: normal;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.admin-badge svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
}

.comment-body {
    padding-left: 60px;
}

.comment-body p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.94rem;
    margin: 0;
    white-space: pre-line;
}

.comment-actions {
    margin-top: 12px;
    padding-left: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.btn-reply {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-reply:hover {
    background: var(--primary-100);
    color: var(--primary-dark);
    text-decoration: none;
}

.btn-delete-comment {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-delete-comment:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Replied comments (Nested) */
.replies-wrapper {
    margin-left: 60px;
    position: relative;
}

.replies-wrapper::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 0;
    bottom: 16px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-100) 0%, var(--border-light) 100%);
    border-radius: 2px;
}

.reply-comment {
    background: linear-gradient(135deg, #fafffe 0%, #f0fdf4 100%);
    border: 1px solid #e2f0e8;
}

.reply-comment .comment-avatar {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
}

.reply-comment .comment-body {
    padding-left: 52px;
}

.reply-comment .comment-actions {
    padding-left: 52px;
}

/* Empty state */
.comments-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.95rem;
}

.comments-empty::before {
    content: '💬';
    display: block;
    font-size: 2.5rem;
    margin-bottom: 12px;
    font-style: normal;
}

/* Cancel reply button */
.btn-cancel-reply {
    display: none;
    background: #f1f5f9;
    color: var(--text-secondary);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-reply:hover {
    background: #e2e8f0;
}

/* Mobile responsive for comments */
@media (max-width: 768px) {
    .replies-wrapper {
        margin-left: 24px;
    }

    .replies-wrapper::before {
        left: -12px;
    }

    .comment-card {
        padding: 18px;
        border-radius: 12px;
    }

    .comment-body,
    .comment-actions {
        padding-left: 0;
    }

    .reply-comment .comment-body,
    .reply-comment .comment-actions {
        padding-left: 0;
    }

    .comment-form-card {
        padding: 20px;
    }

    .comment-form-card .form-grid {
        grid-template-columns: 1fr !important;
    }
}


/* ============================================
   Responsive
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .hero h1 {
        font-size: 2.4rem;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .navbar .container {
        height: 60px;
    }

    .navbar-brand {
        font-size: 1.1rem;
        gap: 8px;
    }

    .navbar-brand .brand-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        border-radius: 8px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: var(--shadow-lg);
        z-index: 1000;
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links a {
        padding: 12px 16px;
        width: 100%;
    }

    .nav-toggle {
        display: block;
    }

    .hero {
        padding: 48px 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-arabic {
        font-size: 1.2rem;
    }

    .hero p {
        font-size: 0.95rem;
        padding: 0 8px;
    }

    .hero-badge {
        font-size: 0.78rem;
        padding: 5px 14px;
    }

    .search-box {
        margin: 0 8px;
    }

    .search-box input {
        padding: 14px 50px 14px 18px;
        font-size: 0.9rem;
    }

    .live-search-dropdown {
        max-height: 320px;
        border-radius: var(--radius);
    }

    .live-search-item .search-title {
        font-size: 0.88rem;
    }

    .live-search-item .search-meta {
        font-size: 0.75rem;
        flex-wrap: wrap;
        gap: 6px;
    }

    .stats-grid {
        gap: 24px;
    }

    .section {
        padding: 40px 0;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .article-card-body {
        padding: 20px;
    }

    .article-header h1 {
        font-size: 1.6rem;
    }

    .article-content {
        padding: 24px;
    }

    /* Make tables in article content scrollable */
    .article-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .article-info-bar {
        flex-direction: column;
        gap: 12px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-card {
        padding: 24px;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }

    .pagination a,
    .pagination span {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 0.85rem;
    }
}

/* Small phone */
@media (max-width: 480px) {
    .container {
        padding: 0 14px;
    }

    .hero {
        padding: 36px 0;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.88rem;
    }

    .hero-arabic {
        font-size: 1rem;
    }

    .hero::after {
        display: none;
    }

    .search-box input {
        padding: 12px 46px 12px 14px;
        font-size: 0.85rem;
    }

    .search-box button {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }

    .category-pills {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .category-pills::-webkit-scrollbar {
        display: none;
    }

    .category-pill {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.82rem;
        padding: 8px 16px;
    }

    .stats-grid {
        gap: 16px;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.78rem;
    }

    .section-header h2 {
        font-size: 1.3rem;
    }

    .article-card h3 {
        font-size: 1.05rem;
    }

    .article-header h1 {
        font-size: 1.35rem;
    }

    .article-content {
        padding: 18px;
        font-size: 0.93rem;
    }

    .article-content h2 {
        font-size: 1.25rem;
    }

    .article-content blockquote {
        padding: 14px 16px;
        font-size: 1rem;
    }

    .footer {
        padding: 36px 0 20px;
        margin-top: 40px;
    }

    .navbar-brand {
        font-size: 1rem;
        gap: 6px;
    }

    .navbar-brand .brand-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .live-search-dropdown {
        max-height: 280px;
    }

    .live-search-item {
        padding: 10px 14px;
        gap: 10px;
    }

    .live-search-item .search-icon {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
}