/* ==========================================================================
   Allah.click — Stylesheet (cleaned, single source of truth; matches Shababsoft)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic&family=Noto+Nastaliq+Urdu&display=swap");

/* --------------------------------------------------------------------------
   CSS variables (green palette for Allah.click)
   -------------------------------------------------------------------------- */
:root {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #d1fae5;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --text: #212529;
    --text-muted: #6c757d;
    --transition: all 0.3s ease;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.1);
    --radius: 0.6rem;
    --success: #198754;
    --info: #0dcaf0;
    --warning: #ffc107;
    --danger: #dc3545;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html { position: relative; min-height: 100%; }

body {
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--gray-100);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 56px; /* fixed navbar height */
}

main { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
    margin-top: 0;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.375rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.1rem; }

p { margin-bottom: 1rem; }

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); text-decoration: underline; }

code {
    font-size: 0.875em;
    background: var(--gray-200);
    padding: 0.15em 0.3em;
    border-radius: 0.2rem;
}

/* Keyboard focus indicator */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 0.15rem; }

/* Screen-reader-only text */
.sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link — hidden until focused */
.skip-link {
    position: absolute;
    left: 0.5rem; top: -3rem;
    z-index: 10000;
    background: var(--dark); color: #fff;
    padding: 0.5rem 1rem; border-radius: var(--radius);
    transition: top 0.2s ease;
}
.skip-link:focus { top: 0.5rem; color: #fff; text-decoration: none; }

i[class*="fa-"] { line-height: inherit; }

/* --------------------------------------------------------------------------
   Loading overlay
   -------------------------------------------------------------------------- */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}
#loading-overlay .spinner {
    width: 44px; height: 44px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-overlay .loading-text { color: var(--text-muted); font-size: 0.95rem; letter-spacing: 0.5px; }

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.navbar { background: var(--dark) !important; box-shadow: var(--shadow); }
.navbar-brand {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff !important;
}
.navbar-brand img { height: 40px; width: auto; display: block; }
.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 0.5rem 0.9rem !important;
    border-radius: var(--radius);
    transition: var(--transition);
    text-decoration: none;
}
.nav-link:hover, .nav-link:focus { color: #fff !important; background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.nav-link.active { color: #fff !important; background: var(--primary); }
.navbar-toggler { border-color: rgba(255, 255, 255, 0.3); }
.navbar-toggler:focus { box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25); }
.navbar .input-group .form-control { font-size: 0.9rem; }
.navbar .input-group .btn { border-radius: var(--radius); }
.navbar-search .form-control { min-width: 8rem; }

.dropdown-menu { border-radius: var(--radius); border: 1px solid var(--gray-200); box-shadow: var(--shadow-hover); }
.dropdown-item { padding: 0.4rem 1rem; }
.dropdown-item:active { background: var(--primary); }

/* --------------------------------------------------------------------------
   Page header / titles
   -------------------------------------------------------------------------- */
.pg-title { font-size: 2rem; font-weight: 800; margin: 1rem 0 0.5rem; color: var(--dark); }
.pg-subtitle { font-size: 1rem; color: var(--text-muted); margin-bottom: 1.5rem; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn { border-radius: var(--radius); font-weight: 500; transition: var(--transition); text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--gray-100); border-color: var(--gray-300); color: var(--text); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-info { background: var(--info); border-color: var(--info); color: #000; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #000; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: #fff;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-body { padding: 1.25rem; }
.card-title { font-size: 1.1rem; font-weight: 700; }

/* Feature cards */
.feature-card {
    padding: 2rem;
    text-align: center;
    border-radius: var(--radius);
    background: var(--gray-100);
    border: 2px solid transparent;
    transition: var(--transition);
    height: 100%;
}
.feature-card:hover { border-color: var(--primary); background: var(--primary-light); }
.feature-icon { font-size: 3rem; color: var(--primary); margin-bottom: 1rem; }

/* Embedded widgets (IslamicFinder etc.) */
.embed-widget { width: 100%; border: 1px solid var(--gray-300); min-height: 320px; border-radius: var(--radius); background: #fff; }
.embed-widget:hover { transform: none; }

/* Home tiles */
.home-tile-icon { font-size: 6rem !important; }

/* --------------------------------------------------------------------------
   Fonts (Arabic / Urdu)
   -------------------------------------------------------------------------- */
.arabic { font-family: "Noto Naskh Arabic", serif; direction: rtl; }
.urdu { font-family: "Noto Nastaliq Urdu", serif; direction: rtl; }

/* --------------------------------------------------------------------------
   Status badges
   -------------------------------------------------------------------------- */
.badge-success { background: var(--success); color: #fff; padding: 0.25rem 0.5rem; border-radius: var(--radius); }
.badge-info { background: var(--info); color: #000; padding: 0.25rem 0.5rem; border-radius: var(--radius); }
.badge-warning { background: var(--warning); color: #000; padding: 0.25rem 0.5rem; border-radius: var(--radius); }
.badge-danger { background: var(--danger); color: #fff; padding: 0.25rem 0.5rem; border-radius: var(--radius); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer { margin-top: auto; }
.footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.85);
    padding: 2rem 0 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.footer a { color: rgba(255, 255, 255, 0.9); transition: var(--transition); }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer .sitemap { margin-bottom: 1.25rem; }
.footer .sitemap .copyright,
.footer .sitemap .imp-link { color: rgba(255, 255, 255, 0.7); font-size: 0.9rem; }
.footer .sitemap .imp-link a { margin: 0 0.35rem; }
.footer .social-media { display: flex; justify-content: center; gap: 1rem; margin-top: 1rem; }
.footer .social-media > a {
    width: 40px; height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff !important;
    font-size: 1.25rem;
    margin: 0 !important;
    transition: var(--transition);
    text-decoration: none;
}
.footer .social-media > a:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-2px); text-decoration: none; }
.footer .facebook-logo { color: #3b5998 !important; }
.footer .twitter-logo { color: #1da1f2 !important; }
.footer .instagram-logo { color: #e1306c !important; }
.footer .youtube-logo { color: #ff0000 !important; }
.footer .linkedin-logo { color: #0e76a8 !important; }

/* --------------------------------------------------------------------------
   Extended / legacy helpers
   -------------------------------------------------------------------------- */
.fa-xl { font-size: 1.65em; }
.bg-light { background-color: #f8f9fa !important; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    body { font-size: 0.9rem; }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    .navbar .input-group { display: none; }
    .footer { padding: 1.5rem 0 1rem; }
    .footer .sitemap { text-align: center; }
    .footer .sitemap .imp-link a { margin: 0 0.25rem; }
    .footer .social-media { justify-content: center; }
    .home-tile-icon { font-size: 5rem !important; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .card:hover, .feature-card:hover, .footer .social-media > a:hover { transform: none; }
}
