/* Responsive Header Styles for Islamic Website */
/* Include this CSS file in all HTML pages along with Tailwind CSS */

/* Base Tailwind Configuration */
:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --accent: #facc15;
    --light: #f9fafb;
    --lightgrad: #eef2ff;
    --emerald-50: #ecfdf5;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
}

/* Language content visibility rules */
.lang-content {
    display: none;
}

.lang-content[data-lang="en"] {
    display: block;
}

[dir="rtl"] .lang-content[data-lang="en"] {
    display: none;
}

[dir="rtl"] .lang-content[data-lang="ar"],
[dir="rtl"] .lang-content[data-lang="ur"] {
    display: block;
}

/* Arabic and Urdu font styling */
.arabic-text {
    font-family: 'Amiri', 'Noto Naskh Arabic', serif;
    font-weight: 400;
}

/* Header specific styles */
header {
    font-family: 'Poppins', 'Inter', sans-serif;
}

/* Language switcher styles */
.language-btn {
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border: none;
    background: transparent;
}

.language-btn:hover {
    background-color: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.language-btn.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Mobile responsive language buttons */
@media (max-width: 640px) {
    .language-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Navigation link styles */
.nav-link {
    position: relative;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background-color: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile menu animations */
#mobile-menu {
    transition: all 0.3s ease;
    transform-origin: top;
}

#mobile-menu.hidden {
    opacity: 0;
    transform: scaleY(0);
    max-height: 0;
    overflow: hidden;
}

#mobile-menu:not(.hidden) {
    opacity: 1;
    transform: scaleY(1);
    max-height: 100vh;
}

/* Mobile submenu styles */
.mobile-submenu-btn {
    transition: all 0.2s ease;
}

.mobile-submenu-btn.active {
    background-color: var(--emerald-50);
    color: var(--primary);
}

.mobile-submenu-btn.active svg {
    transform: rotate(180deg);
}

.mobile-submenu-content {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.mobile-submenu-content.show {
    max-height: 500px;
    opacity: 1;
    padding-top: 0.5rem;
}

/* Desktop dropdown menu styles */
.group:hover .group-hover\:opacity-100 {
    opacity: 1;
}

.group:hover .group-hover\:visible {
    visibility: visible;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Header shadow on scroll */
header.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* RTL support */
[dir="rtl"] .nav-link::after {
    right: 50%;
    left: auto;
    transform: translateX(50%);
}

[dir="rtl"] .mobile-submenu-content {
    padding-right: 1.5rem;
    padding-left: 0;
}

/* Focus states for accessibility */
.language-btn:focus,
.nav-link:focus,
#mobile-menu-btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Loading state for language switching */
.lang-switching {
    opacity: 0.7;
    pointer-events: none;
}

/* Responsive typography */
@media (max-width: 768px) {
    .nav-link {
        font-size: 0.875rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .language-btn.active {
        border: 2px solid currentColor;
    }
    
    .nav-link:hover {
        text-decoration: underline;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .language-btn,
    .nav-link,
    #mobile-menu,
    .mobile-submenu-content {
        transition: none;
    }
    
    .nav-link::after {
        transition: none;
    }
}

/* Print styles */
@media print {
    header {
        position: static;
        box-shadow: none;
        border-bottom: 1px solid #000;
    }
    
    #mobile-menu,
    #mobile-menu-btn,
    .language-btn {
        display: none;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .dark header {
        background-color: #1e293b;
        color: #cbd5e1;
    }
    
    .dark .language-btn:hover {
        background-color: #334155;
    }
    
    .dark .nav-link {
        color: #cbd5e1;
    }
    
    .dark .nav-link:hover {
        color: var(--accent);
    }
}

/* Ensure proper stacking context */
header {
    z-index: 1000;
}

/* Smooth transitions for all interactive elements */
button, a {
    transition: all 0.2s ease;
}

/* Ensure mobile menu doesn't interfere with page content */
@media (max-width: 1023px) {
    body.menu-open {
        overflow: hidden;
    }
}