/* ===== TAYYAB MONEY — DESIGN SYSTEM ===== */

:root {
    --ifh-primary: #0f6b3e;
    --ifh-primary-light: #198754;
    --ifh-accent: #c8a84e;
    --ifh-accent-light: #e8d291;
    --ifh-dark: #1a1a2e;
    --ifh-gradient: linear-gradient(135deg, #0f6b3e 0%, #145a32 50%, #1a3a2a 100%);
    --ifh-gradient-gold: linear-gradient(135deg, #c8a84e, #e8d291, #c8a84e);
    --ifh-gradient-hero: linear-gradient(160deg, #0f6b3e 0%, #145a32 40%, #1a3a2a 100%);
    --ifh-shadow: 0 4px 24px rgba(15, 107, 62, 0.10);
    --ifh-shadow-hover: 0 12px 40px rgba(15, 107, 62, 0.18);
    --ifh-radius: 16px;
    --ifh-radius-sm: 10px;
    --ifh-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --ifh-font-arabic: Amiri, "Noto Sans Arabic", "Segoe UI", Roboto, Arial, sans-serif;
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-bottom: 0;
    font-family: var(--ifh-font);
    background-color: #f8f9fa;
    color: #2d3436;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a, a:hover, a:focus, a:active {
    text-decoration: none;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(15, 107, 62, 0.4);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ===== NAVBAR ===== */
.ifh-navbar {
    background: var(--ifh-gradient) !important;
    padding: 0.75rem 0;
    border-bottom: 3px solid var(--ifh-accent);
    backdrop-filter: blur(10px);
}

.navbar-brand-logo {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: brightness(0) invert(1);
}

.navbar-brand:hover .navbar-brand-logo {
    transform: scale(1.05);
    filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(255,255,255,0.3));
}

.nav-link-animated {
    position: relative;
    transition: color 0.2s ease;
}

.nav-link-animated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--ifh-accent);
    transition: width 0.3s ease, left 0.3s ease;
    border-radius: 2px;
}

.nav-link-animated:hover::after {
    width: 70%;
    left: 15%;
}

/* ===== HERO SECTION (Home page) ===== */
.ifh-hero {
    background: var(--ifh-gradient-hero);
    border-radius: var(--ifh-radius);
    padding: 3rem 2.5rem;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.ifh-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(200, 168, 78, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.ifh-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.ifh-hero .hero-logo {
    position: absolute;
    top: 1.25rem;
    left: 1.5rem;
    height: 80px;
    width: auto;
    opacity: 0.15;
    filter: brightness(0) invert(1);
    pointer-events: none;
}

.ifh-hero h2 {
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.ifh-hero p {
    opacity: 0.85;
    font-size: 1.05rem;
    margin-bottom: 0;
    position: relative;
}

.hero-divider {
    width: 60px;
    height: 3px;
    background: var(--ifh-gradient-gold);
    border-radius: 3px;
    margin: 1rem 0;
}

/* ===== HERO QUOTE BOX ===== */
.hero-quote-box {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border-radius: var(--ifh-radius);
    padding: 1.5rem 1.25rem;
    border: 1px solid rgba(255,255,255,0.15);
}

.hero-quote-icon {
    font-size: 1.5rem;
    opacity: 0.6;
    margin-bottom: 0.75rem;
    display: block;
}

.hero-quote-arabic {
    font-family: var(--ifh-font-arabic);
    font-size: 1.15rem;
    line-height: 2.2;
    opacity: 0.95;
    margin-bottom: 0.5rem;
}

.hero-quote-divider {
    width: 40px;
    height: 2px;
    background: var(--ifh-accent);
    margin: 0.5rem auto;
    border-radius: 2px;
}

.hero-quote-english {
    font-style: italic;
    opacity: 0.9;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.hero-quote-ref {
    font-weight: 600;
    opacity: 0.6;
    font-size: 0.8rem;
}

/* ===== CATEGORY DROPDOWN ===== */
.ifh-category-dropdown {
    min-width: 220px;
}

.ifh-category-dropdown .form-select {
    border-radius: 30px;
    padding: 0.5rem 2.5rem 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 2px solid #e0e8e0;
    color: var(--ifh-dark);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ifh-category-dropdown .form-select:focus {
    border-color: var(--ifh-primary-light);
    box-shadow: 0 0 0 3px rgba(15, 107, 62, 0.12);
}

/* ===== SECTION HEADINGS ===== */
.ifh-section-heading {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--ifh-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.ifh-section-heading .heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--ifh-radius-sm);
    background: var(--ifh-gradient);
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.ifh-section-heading::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, #e0e0e0, transparent);
    border-radius: 2px;
}

/* ===== ARTICLE CARDS ===== */
.ifh-card {
    background: #fff;
    border: none;
    border-radius: var(--ifh-radius);
    box-shadow: var(--ifh-shadow);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.ifh-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--ifh-shadow-hover);
}

.ifh-card .card-img-top {
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ifh-card:hover .card-img-top {
    transform: scale(1.05);
}

.ifh-card .card-img-wrapper {
    overflow: hidden;
    position: relative;
}

.ifh-card .card-img-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, rgba(0,0,0,0.05));
    pointer-events: none;
}

.ifh-card .card-body {
    padding: 1.5rem;
}

.ifh-card .card-title a {
    color: var(--ifh-dark);
    font-weight: 600;
    transition: color 0.2s ease;
}

.ifh-card .card-title a:hover {
    color: var(--ifh-primary);
}

/* ===== BADGES & TAGS ===== */
.ifh-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--ifh-primary-light), var(--ifh-primary));
    color: #fff;
    letter-spacing: 0.02em;
}

.ifh-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 500;
    border-radius: 6px;
    background: #f0f4f0;
    color: var(--ifh-primary);
    border: 1px solid #e0e8e0;
    transition: background 0.2s, color 0.2s;
}

.ifh-tag:hover {
    background: var(--ifh-primary);
    color: #fff;
}

/* ===== QUOTE CARD (Sidebar) ===== */
.ifh-quote-card {
    background: var(--ifh-gradient);
    border: none;
    border-radius: var(--ifh-radius);
    color: #fff;
    overflow: hidden;
    position: relative;
}

.ifh-quote-card::before {
    content: '\201C';
    position: absolute;
    top: -15px;
    left: 15px;
    font-size: 8rem;
    font-family: var(--ifh-font-arabic);
    opacity: 0.08;
    line-height: 1;
    pointer-events: none;
}

.ifh-quote-card .card-body {
    position: relative;
    z-index: 1;
    padding: 2rem 1.5rem;
}

.ifh-quote-card .quote-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.3rem;
}

.ifh-quote-card .arabic-text {
    font-family: var(--ifh-font-arabic);
    font-size: 1.2rem;
    line-height: 2.2;
    opacity: 0.95;
}

.ifh-quote-card .english-text {
    font-style: italic;
    opacity: 0.9;
    font-size: 0.95rem;
    line-height: 1.7;
}

.ifh-quote-card .quote-reference {
    font-weight: 600;
    opacity: 0.7;
    font-size: 0.85rem;
}

.ifh-quote-card .gold-line {
    width: 40px;
    height: 2px;
    background: var(--ifh-accent);
    margin: 0.75rem auto;
    border-radius: 2px;
}

/* ===== CATEGORIES SIDEBAR ===== */
.ifh-sidebar-card {
    border: none;
    border-radius: var(--ifh-radius);
    box-shadow: var(--ifh-shadow);
    overflow: hidden;
}

.ifh-sidebar-card .card-header {
    background: var(--ifh-gradient) !important;
    border: none;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.ifh-sidebar-card .list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.85rem 1.25rem;
    transition: background 0.2s ease, padding-left 0.2s ease;
}

.ifh-sidebar-card .list-group-item:hover {
    background: #f0faf5;
    padding-left: 1.5rem;
}

.ifh-sidebar-card .list-group-item a {
    color: #444;
    font-weight: 500;
    transition: color 0.2s;
}

.ifh-sidebar-card .list-group-item:hover a {
    color: var(--ifh-primary);
}

.ifh-sidebar-card .list-group-item.active {
    background: linear-gradient(90deg, #e6f5ec, #f0faf5);
    border-color: #e0e0e0;
}

.ifh-count-badge {
    background: linear-gradient(135deg, var(--ifh-primary-light), var(--ifh-primary));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
}

/* ===== META INFO ===== */
.ifh-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #888;
}

.ifh-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.ifh-meta-divider {
    width: 4px;
    height: 4px;
    background: #ccc;
    border-radius: 50%;
}

/* ===== SCROLL FADE-IN ANIMATIONS ===== */
.ifh-fade-in {
    opacity: 0;
    transform: translateY(24px);
    animation: ifhFadeInUp 0.6s ease forwards;
}

@keyframes ifhFadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ifh-card:nth-child(1) { animation-delay: 0.05s; }
.ifh-card:nth-child(2) { animation-delay: 0.15s; }
.ifh-card:nth-child(3) { animation-delay: 0.25s; }
.ifh-card:nth-child(4) { animation-delay: 0.35s; }
.ifh-card:nth-child(5) { animation-delay: 0.45s; }

/* ===== ARTICLE PAGE ===== */
.ifh-article-header {
    position: relative;
    background: var(--ifh-gradient-hero);
    border-radius: var(--ifh-radius);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    color: #fff;
    overflow: hidden;
}

.ifh-article-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(200, 168, 78, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.ifh-article-header h1 {
    font-weight: 700;
    font-size: 1.8rem;
    position: relative;
    line-height: 1.35;
}

.ifh-article-header .hero-divider {
    margin: 1rem 0 0.75rem;
}

.ifh-article-header .ifh-meta {
    color: rgba(255,255,255,0.8);
    position: relative;
}

.ifh-article-header .ifh-meta-divider {
    background: rgba(255,255,255,0.4);
}

.ifh-article-header .ifh-badge {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
}

.ifh-article-image {
    border-radius: var(--ifh-radius);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--ifh-shadow);
}

.ifh-article-image img {
    width: 100%;
    display: block;
}

.ifh-summary {
    background: linear-gradient(135deg, #f0faf5, #f8fdfb);
    border: none;
    border-left: 4px solid var(--ifh-primary);
    border-radius: var(--ifh-radius-sm);
    padding: 1.25rem 1.5rem;
    font-size: 0.95rem;
    color: #444;
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #333;
}

.article-content h2 {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--ifh-dark);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.article-content h3 {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--ifh-dark);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content blockquote {
    border-left: 4px solid var(--ifh-accent);
    background: linear-gradient(135deg, #fffdf5, #fefcf0);
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--ifh-radius-sm) var(--ifh-radius-sm) 0;
    font-style: italic;
    color: #555;
    margin: 1.5rem 0;
}

/* ===== BACK BUTTON ===== */
.ifh-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.9rem;
    border: 2px solid var(--ifh-primary);
    color: var(--ifh-primary);
    background: transparent;
    text-decoration: none;
    transition: background 0.3s, color 0.3s, transform 0.2s;
}

.ifh-btn-back:hover {
    background: var(--ifh-primary);
    color: #fff;
    transform: translateX(-4px);
}

/* ===== LOGIN PAGE ===== */
.ifh-login-wrapper {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ifh-login-card {
    border: none;
    border-radius: var(--ifh-radius);
    box-shadow: 0 8px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    max-width: 440px;
    width: 100%;
}

.ifh-login-header {
    background: var(--ifh-gradient);
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.ifh-login-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -30%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(200,168,78,0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.ifh-login-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    padding: 0.75rem;
}

.login-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.ifh-login-card .card-body {
    padding: 2rem;
}

.ifh-login-card .form-control {
    border-radius: var(--ifh-radius-sm);
    padding: 0.7rem 1rem;
    border: 2px solid #e8e8e8;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ifh-login-card .form-control:focus {
    border-color: var(--ifh-primary-light);
    box-shadow: 0 0 0 3px rgba(15, 107, 62, 0.1);
}

.ifh-btn-login {
    background: var(--ifh-gradient);
    border: none;
    border-radius: 30px;
    padding: 0.7rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ifh-btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 107, 62, 0.3);
    color: #fff;
}

/* ===== FOOTER ===== */
.ifh-footer {
    background: var(--ifh-gradient);
    position: relative;
    overflow: hidden;
    margin-top: auto;
}

.footer-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: 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='%23ffffff' fill-rule='evenodd'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3Ccircle cx='0' cy='0' r='2'/%3E%3Ccircle cx='60' cy='0' r='2'/%3E%3Ccircle cx='0' cy='60' r='2'/%3E%3Ccircle cx='60' cy='60' r='2'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.footer-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.footer-brand-logo {
    height: 36px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.footer-brand-logo:hover {
    opacity: 1;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
}

.breadcrumb-item a {
    color: var(--ifh-primary);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-item.active {
    color: #888;
}

/* ===== CATEGORY PAGE HEADER ===== */
.ifh-category-hero {
    background: var(--ifh-gradient);
    border-radius: var(--ifh-radius);
    padding: 2rem 2rem;
    margin-bottom: 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.ifh-category-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(200,168,78,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.ifh-category-hero h2 {
    font-weight: 700;
    margin: 0;
    position: relative;
}

/* ===== EMPTY STATE ===== */
.ifh-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: #fff;
    border-radius: var(--ifh-radius);
    box-shadow: var(--ifh-shadow);
}

.ifh-empty-state .empty-icon {
    font-size: 3rem;
    color: var(--ifh-accent);
    margin-bottom: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .ifh-hero {
        padding: 2rem 1.5rem;
    }

    .ifh-hero h2 {
        font-size: 1.5rem;
    }

    .ifh-article-header h1 {
        font-size: 1.4rem;
    }
}

/* ===== NEWSLETTER POPUP ===== */
.newsletter-modal-content {
    background: var(--ifh-gradient);
    border: none;
    border-radius: var(--ifh-radius);
    color: #fff;
    overflow: hidden;
    position: relative;
}

.newsletter-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    filter: brightness(2);
}

.newsletter-icon {
    font-size: 3rem;
    color: var(--ifh-accent);
    animation: newsletterBounce 2s ease-in-out infinite;
}

@keyframes newsletterBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.newsletter-title {
    font-weight: 700;
    color: #fff;
}

.newsletter-subtitle {
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 0.95rem;
}

.newsletter-modal-content .form-control {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: var(--ifh-radius-sm);
    padding: 0.7rem 1rem;
}

.newsletter-modal-content .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.newsletter-modal-content .form-control:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--ifh-accent);
    box-shadow: 0 0 0 3px rgba(200, 168, 78, 0.25);
    color: #fff;
}

.newsletter-modal-content .btn-success {
    background: var(--ifh-accent);
    border: none;
    color: var(--ifh-dark);
    font-weight: 600;
    border-radius: var(--ifh-radius-sm);
    padding: 0.7rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.newsletter-modal-content .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 168, 78, 0.4);
    background: var(--ifh-accent-light);
}
