/*
Theme Name: أثر هدى
Theme URI: https://atharhuda.com
Description: منصة إسلامية شاملة — ختمات جماعية، مصحّح تلاوة ذكي، أدعية، تسابيح، ورمضانيات
Version: 1.0.0
Author: Athar Huda
Text Domain: atharhuda
License: GPL-2.0-or-later
*/

/* ═══════════════════════════════════════
   DESIGN SYSTEM — CSS VARIABLES
   ═══════════════════════════════════════ */

:root {
    --bg-rgb: 252, 251, 248;
    --surface-rgb: 255, 255, 255;
    --surface-el-rgb: 246, 245, 242;
    --primary-rgb: 30, 58, 138;
    --secondary-rgb: 79, 70, 229;
    --accent-rgb: 16, 185, 129;
    --text-rgb: 28, 25, 23;
    --text-secondary-rgb: 87, 83, 78;
    --text-muted-rgb: 168, 162, 158;
    --border-rgb: 228, 228, 228;
    --input-border-rgb: 209, 206, 200;
    --input-bg-rgb: 250, 249, 246;
    --focus-rgb: 30, 58, 138;
    --error-rgb: 239, 68, 68;
    --warn-rgb: 234, 179, 8;
    --ok-rgb: 34, 197, 94;
    --info-rgb: 6, 182, 212;
    --link-rgb: 30, 58, 138;

    --bg: rgb(var(--bg-rgb));
    --surface: rgb(var(--surface-rgb));
    --surface-el: rgb(var(--surface-el-rgb));
    --primary: rgb(var(--primary-rgb));
    --secondary: rgb(var(--secondary-rgb));
    --accent: rgb(var(--accent-rgb));
    --text: rgb(var(--text-rgb));
    --text-secondary: rgb(var(--text-secondary-rgb));
    --text-muted: rgb(var(--text-muted-rgb));
    --border: rgb(var(--border-rgb));
    --input-border: rgb(var(--input-border-rgb));
    --input-bg: rgb(var(--input-bg-rgb));
    --focus: rgb(var(--focus-rgb));
    --error: rgb(var(--error-rgb));
    --warn: rgb(var(--warn-rgb));
    --ok: rgb(var(--ok-rgb));
    --info: rgb(var(--info-rgb));
    --link: rgb(var(--link-rgb));
}

.dark {
    --bg-rgb: 16, 18, 28;
    --surface-rgb: 25, 28, 40;
    --surface-el-rgb: 34, 38, 55;
    --primary-rgb: 96, 130, 255;
    --secondary-rgb: 129, 120, 255;
    --accent-rgb: 52, 211, 153;
    --text-rgb: 237, 233, 228;
    --text-secondary-rgb: 161, 161, 170;
    --text-muted-rgb: 113, 113, 122;
    --border-rgb: 55, 60, 78;
    --input-border-rgb: 63, 68, 88;
    --input-bg-rgb: 30, 34, 50;
    --focus-rgb: 96, 130, 255;
    --link-rgb: 129, 140, 255;
}

/* ═══════════════════════════════════════
   BASE RESET & TYPOGRAPHY
   ═══════════════════════════════════════ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "IBM Plex Sans Arabic", "Noto Kufi Arabic", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    direction: rtl;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
select,
textarea {
    font-family: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

.font-quran {
    font-family: "Amiri", serif;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══════════════════════════════
   COLOR UTILITIES
   ═══════════════════════════════ */

.text-txt {
    color: var(--text);
}

.text-txt-secondary {
    color: var(--text-secondary);
}

.text-txt-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary);
}

.text-secondary {
    color: var(--secondary);
}

.text-accent {
    color: var(--accent);
}

.text-ok {
    color: var(--ok);
}

.text-err {
    color: var(--error);
}

.text-warn {
    color: var(--warn);
}

.text-info {
    color: #06b6d4;
}

.text-link {
    color: var(--link);
}

.text-amber-500 {
    color: #f59e0b;
}

.text-amber-600 {
    color: #d97706;
}

.text-orange-500 {
    color: #f97316;
}

.text-orange-600 {
    color: #ea580c;
}

.dark .text-amber-400 {
    color: #fbbf24;
}

.dark .text-orange-400 {
    color: #fb923c;
}

.bg-bg {
    background: var(--bg);
}

.bg-surface {
    background: var(--surface);
}

.bg-surface-el {
    background: var(--surface-el);
}

.bg-primary {
    background: var(--primary);
}

/* ═══════════════════════════════
   ISLAMIC PATTERN BACKGROUND
   ═══════════════════════════════ */

.islamic-pattern-dense {
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%231e3a8a' stroke-width='0.5' opacity='0.15'%3E%3Ccircle cx='40' cy='40' r='20'/%3E%3Ccircle cx='40' cy='40' r='10'/%3E%3Cline x1='40' y1='20' x2='40' y2='60'/%3E%3Cline x1='20' y1='40' x2='60' y2='40'/%3E%3Cline x1='25.86' y1='25.86' x2='54.14' y2='54.14'/%3E%3Cline x1='54.14' y1='25.86' x2='25.86' y2='54.14'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 80px 80px;
}

/* ═══════════════════════════════
   GLASS MORPHISM
   ═══════════════════════════════ */

.glass {
    background: rgba(var(--surface-rgb), 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(var(--border-rgb), 0.5);
}

/* ═══════════════════════════════
   SCROLLBAR
   ═══════════════════════════════ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--text-muted-rgb), 0.25);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--text-muted-rgb), 0.4);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ═══════════════════════════════
   ANIMATIONS
   ═══════════════════════════════ */

@keyframes drift {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(30px, -20px);
    }

    50% {
        transform: translate(-20px, 15px);
    }

    75% {
        transform: translate(15px, 25px);
    }
}

@keyframes orbit {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes orbit-reverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes float-slow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes hero-in {
    0% {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes count-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pop-in {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce-slow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05), inset 0 0 20px rgba(var(--primary-rgb), 0.02);
    }

    50% {
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08), inset 0 0 30px rgba(var(--primary-rgb), 0.04);
    }
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes pulse-slow {

    0%,
    100% {
        opacity: 0.06;
        transform: scale(1);
    }

    50% {
        opacity: 0.08;
        transform: scale(1.05);
    }
}

@keyframes pulse-slower {

    0%,
    100% {
        opacity: 0.06;
        transform: scale(1);
    }

    50% {
        opacity: 0.09;
        transform: scale(1.08);
    }
}

@keyframes expand {
    from {
        opacity: 0;
        max-height: 0;
    }

    to {
        opacity: 1;
        max-height: 5000px;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.animate-drift {
    animation: drift 20s ease-in-out infinite;
}

.animate-orbit {
    animation: orbit 25s linear infinite;
}

.animate-orbit-reverse {
    animation: orbit-reverse 20s linear infinite;
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-float-slow {
    animation: float-slow 5s ease-in-out infinite;
}

.animate-fade-up {
    opacity: 0;
    animation: fade-up 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fade-down {
    opacity: 0;
    animation: fade-down 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-hero {
    animation: hero-in 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-scale-in {
    opacity: 0;
    animation: scale-in 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-count {
    opacity: 0;
    animation: count-in 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-pop-in {
    opacity: 0;
    animation: pop-in 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-pulse-glow {
    animation: pulse-glow 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 6s ease infinite;
}

.animate-bounce-slow {
    animation: bounce-slow 1s ease-in-out infinite;
}

.animate-slide-in-right {
    animation: slide-in-right 0.5s ease-out;
}

.animate-pulse-slow {
    animation: pulse-slow 4s ease-in-out infinite;
}

.animate-pulse-slower {
    animation: pulse-slower 5s ease-in-out infinite;
}

.animate-expand {
    animation: expand 0.3s ease-out;
}

.animate-fade-in-up {
    animation: fade-in-up 0.4s ease-out forwards;
}

.animate-slide {
    animation: slide 1.5s ease-in-out infinite;
}

.animate-fade-in {
    animation: fade-up 0.5s ease-out;
}

.animate-fade-right {
    animation: slide-in-right 0.5s ease-out;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-600 {
    animation-delay: 600ms;
}

.delay-700 {
    animation-delay: 700ms;
}

/* ═══════════════════════════════
   CARD EFFECTS
   ═══════════════════════════════ */

.card-lift {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

.card-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04), 0 8px 16px rgba(0, 0, 0, 0.02);
}

.dark .card-lift:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.feature-hero-card {
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-hero-card:hover {
    border-color: rgba(var(--primary-rgb), 0.3);
}

/* ═══════════════════════════════
   QURAN TEXT STYLES
   ═══════════════════════════════ */

.quran-text {
    font-family: "Amiri", serif;
    line-height: 2.8;
    letter-spacing: 0.01em;
    font-size: 1.4rem;
}

.ayah-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    margin: 0 0.3rem;
    font-family: "IBM Plex Sans Arabic", sans-serif;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.06);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: 50%;
    vertical-align: middle;
}

.basmalah {
    text-align: center;
    font-family: "Amiri", serif;
    font-size: 1.8rem;
    color: var(--primary);
    padding: 1.5rem 0;
    opacity: 0.85;
}

.surah-header {
    text-align: center;
    padding: 1.5rem 1rem;
    margin: 2rem 0 1.5rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05), rgba(var(--accent-rgb), 0.03));
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    border-radius: 1.5rem;
    position: relative;
    overflow: hidden;
}

.surah-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%231e3a8a' stroke-width='0.5' opacity='0.08'%3E%3Ccircle cx='40' cy='40' r='20'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 60px 60px;
    pointer-events: none;
}

.surah-name {
    font-family: "Amiri", serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    position: relative;
}

.translation-box {
    margin-top: 1rem;
    padding: 1rem 1.2rem;
    background: rgba(var(--accent-rgb), 0.04);
    border: 1px solid rgba(var(--accent-rgb), 0.1);
    border-radius: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ═══════════════════════════════
   HEADER
   ═══════════════════════════════ */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(var(--bg-rgb), 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(var(--border-rgb), 0.5);
    transition: background 0.3s, border-color 0.3s;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.header-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 768px) {
    .header-inner {
        height: 4.5rem;
    }
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 900;
    font-size: 1rem;
    color: var(--text);
}

.header-logo .logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.header-logo .logo-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* Desktop Nav */
.desktop-nav {
    display: none;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem;
    border-radius: 9999px;
    border: 1px solid rgba(var(--border-rgb), 0.6);
    background: rgba(var(--surface-rgb), 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
    }
}

.desktop-nav a {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.06);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

/* Theme Toggle */
#theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    transition: all 0.3s;
}

#theme-toggle:hover {
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.3);
}

#theme-toggle svg {
    width: 1rem;
    height: 1rem;
}

/* ═══════════════════════════════
   FOOTER
   ═══════════════════════════════ */

.site-footer {
    position: relative;
    margin-top: 3rem;
    margin-bottom: 6rem;
    border-top: 1px solid rgba(var(--border-rgb), 0.6);
    background: rgba(var(--surface-rgb), 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

@media (min-width: 768px) {
    .site-footer {
        margin-bottom: 0;
    }
}

.footer-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.footer-inner p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-inner .footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.footer-inner .footer-brand .f-icon {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.footer-inner .footer-brand .f-icon svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* ═══════════════════════════════
   MOBILE BOTTOM NAV
   ═══════════════════════════════ */

.mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 0.5rem 1rem 1rem;
}

@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }
}

.mobile-nav-inner {
    display: flex;
    width: 100%;
    background: rgba(var(--surface-rgb), 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(var(--border-rgb), 0.5);
    border-radius: 1.25rem;
    padding: 0.5rem 0.375rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.mobile-nav-inner a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0;
    font-size: 0.5625rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: color 0.3s;
    text-decoration: none;
}

.mobile-nav-inner a:hover,
.mobile-nav-inner a.active {
    color: var(--primary);
}

.mobile-nav-inner a svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* ═══════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════ */

.site-main {
    flex: 1;
    padding-top: 4rem;
    padding-bottom: 7rem;
}

@media (min-width: 768px) {
    .site-main {
        padding-top: 4.5rem;
        padding-bottom: 0;
    }
}

/* ═══════════════════════════════
   RESPONSIVE HELPERS
   ═══════════════════════════════ */

@media (max-width: 640px) {
    .card-lift:hover {
        transform: translateY(-3px);
    }

    .feature-hero-card .fhc-flex {
        flex-direction: column;
        text-align: center;
    }
}

/* WP Admin Bar offset */
.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}