/* Custom Styles for Naba Center */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    overflow-x: hidden;
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
}

/* LTR Support */
[dir="ltr"] {
    direction: ltr;
}

/* Font adjustments for English */
body.ltr {
    font-family: 'Inter', 'Arial', sans-serif;
}

body.ltr .font-cairo {
    font-family: 'Inter', 'Arial', sans-serif;
}

body.ltr .font-tajawal {
    font-family: 'Inter', 'Arial', sans-serif;
}

/* Spacing adjustments for LTR */
[dir="ltr"] .space-x-reverse {
    space-x-reverse: 0;
}

/* Smooth Scrolling */
section {
    scroll-margin-top: 80px;
}

/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Logo Animation */
@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 10px 30px rgba(245, 158, 11, 0.3));
    }
    50% {
        filter: drop-shadow(0 15px 40px rgba(245, 158, 11, 0.6));
    }
}

.animate-logo-glow {
    animation: logoGlow 2s ease-in-out infinite;
}

/* Logo Transparent Background */
.logo-transparent {
    background: transparent !important;
    mix-blend-mode: normal;
    isolation: isolate;
}

/* For logos with dark background, make it transparent */
.logo-transparent img {
    background: transparent;
    border-radius: 50%;
}

/* Filter to remove black background */
.remove-black-bg {
    filter: contrast(1.2) brightness(1.1);
    mix-blend-mode: screen;
}

/* Icon Animations */
@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(5deg);
    }
    75% {
        transform: translateY(-5px) rotate(-5deg);
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes iconRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

/* Apply animations to program card icons */
.program-icon {
    animation: iconFloat 3s ease-in-out infinite;
}

.program-icon:hover {
    animation: iconPulse 0.5s ease-in-out;
}

/* Teacher card animations */
.teacher-card-icon {
    transition: all 0.3s ease;
}

.teacher-card:hover .teacher-card-icon {
    animation: iconBounce 0.6s ease-in-out;
}

/* Pricing card animations */
.pricing-icon {
    animation: iconPulse 2s ease-in-out infinite;
}

.pricing-icon:hover {
    animation: iconRotate 1s linear;
}

/* Apply Animations */
.animate-fade-in {
    animation: fadeIn 1s ease-in-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

/* Loading Animation */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f4f6;
    border-top-color: #1e40af;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #1e40af;
    border-radius: 6px;
}

/* Program Sub-levels Accordion Styles */
.program-card-header {
    cursor: pointer;
    transition: all 0.3s ease;
}

.program-card-header:hover {
    transform: scale(1.02);
}

#sublevels-arabic-learning,
#sublevels-quran-learning {
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.3s ease;
}

#icon-arabic-learning,
#icon-quran-learning {
    transition: transform 0.3s ease;
    display: inline-block;
}

/* Smooth animation for sub-level items */
.bg-blue-50,
.bg-purple-50 {
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

::-webkit-scrollbar-thumb:hover {
    background: #1e3a8a;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #1e40af 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Button Effects */
button, .btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

button::before, .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before, .btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Text Selection */
::selection {
    background: #f59e0b;
    color: white;
}

::-moz-selection {
    background: #f59e0b;
    color: white;
}

/* Form Focus States */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Mobile Menu Transition */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

#mobile-menu.show {
    max-height: 500px;
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Stats Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.stat-number {
    animation: countUp 1s ease-out;
}

/* Section Divider */
.section-divider {
    position: relative;
    height: 2px;
    background: linear-gradient(90deg, transparent, #1e40af, transparent);
    margin: 40px 0;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #1f2937;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Card Flip Effect */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Gradient Border */
.gradient-border {
    position: relative;
    background: white;
    border-radius: 1rem;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #1e40af, #059669, #f59e0b);
    border-radius: 1rem;
    z-index: -1;
}

/* Loading Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f4f6;
    border-top: 5px solid #1e40af;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* Success Message Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message {
    animation: slideDown 0.5s ease-out;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    nav, footer, #register, #contact {
        display: none;
    }
    
    body {
        color: black;
        background: white;
    }
}

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

/* Focus Visible */
*:focus-visible {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* Utility Classes */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.box-shadow-lg {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hover-lift:hover {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}

.transition-all {
    transition: all 0.3s ease;
}

/* Backdrop Filter Support */
@supports (backdrop-filter: blur(10px)) {
    .backdrop-blur {
        backdrop-filter: blur(10px);
    }
}

@supports not (backdrop-filter: blur(10px)) {
    .backdrop-blur {
        background: rgba(255, 255, 255, 0.95);
    }
}