/**
 * Global Navigation System
 * Consistent navigation, breadcrumbs, and theme support across all pages
 */

/* ===========================================
   ENHANCED DARK MODE COMPATIBILITY
   =========================================== */

:root {
    /* Light mode colors */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-500: #373e98;
    --primary-600: #2d3577;
    --primary-700: #252a66;
    
    --secondary-500: #f16775;
    --secondary-600: #d64d5e;
    
    --accent-500: #fee36e;
    --accent-600: #fcd34d;
    
    /* Light mode text and background */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --text-inverse: #ffffff;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #e5e7eb;
    
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;
    
    /* Navigation specific */
    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-border: rgba(229, 231, 235, 0.8);
    --nav-text: #374151;
    --nav-text-hover: #373e98;
    --nav-text-active: #373e98;
    
    /* Breadcrumb specific */
    --breadcrumb-bg: rgba(249, 250, 251, 0.9);
    --breadcrumb-text: #6b7280;
    --breadcrumb-text-active: #111827;
    --breadcrumb-separator: #d1d5db;
    
    /* Widget specific */
    --widget-bg: #ffffff;
    --widget-border: #e5e7eb;
    --widget-shadow: rgba(0, 0, 0, 0.1);
}

.dark {
    /* Dark mode colors */
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --text-inverse: #111827;
    
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #1f2937;
    
    --border-primary: #4b5563;
    --border-secondary: #6b7280;
    
    /* Navigation specific dark mode */
    --nav-bg: rgba(17, 24, 39, 0.95);
    --nav-border: rgba(75, 85, 99, 0.8);
    --nav-text: #d1d5db;
    --nav-text-hover: #818cf8;
    --nav-text-active: #818cf8;
    
    /* Breadcrumb specific dark mode */
    --breadcrumb-bg: rgba(31, 41, 55, 0.9);
    --breadcrumb-text: #9ca3af;
    --breadcrumb-text-active: #ffffff;
    --breadcrumb-separator: #6b7280;
    
    /* Widget specific dark mode */
    --widget-bg: #1f2937;
    --widget-border: #374151;
    --widget-shadow: rgba(0, 0, 0, 0.3);
}

/* Force visibility for all text elements */
* {
    color: inherit;
}

body {
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===========================================
   ENHANCED NAVIGATION HEADER
   =========================================== */

.main-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--nav-border);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .main-header {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .nav-container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .nav-container {
        padding: 0 2rem;
    }
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

/* Logo styling */
.nav-logo {
    flex-shrink: 0;
}

.nav-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo img {
    height: 3rem;
    width: auto;
    transition: transform 0.2s ease;
}

.nav-logo a:hover img {
    transform: scale(1.05);
}

/* Desktop Navigation */
.nav-desktop {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 1024px) {
    .nav-desktop {
        display: flex;
    }
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--nav-text);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--nav-text-hover);
    background-color: rgba(55, 62, 152, 0.1);
    transform: translateY(-1px);
}

.dark .nav-link:hover {
    background-color: rgba(129, 140, 248, 0.1);
}

.nav-link.active {
    color: var(--nav-text-active);
    background-color: rgba(55, 62, 152, 0.15);
    font-weight: 600;
}

.dark .nav-link.active {
    background-color: rgba(129, 140, 248, 0.15);
}

.nav-link i {
    font-size: 0.875rem;
    width: 1.25rem;
    margin-right: 0.5rem;
    text-align: center;
}

/* Action buttons */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    color: var(--nav-text-hover);
    background-color: rgba(55, 62, 152, 0.1);
    transform: scale(1.1);
}

.dark .theme-toggle:hover {
    background-color: rgba(129, 140, 248, 0.1);
}

.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (min-width: 1024px) {
    .mobile-menu-btn {
        display: none;
    }
}

.mobile-menu-btn:hover {
    color: var(--nav-text-hover);
    background-color: rgba(55, 62, 152, 0.1);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    border-top: 1px solid var(--nav-border);
    padding: 1rem 0;
    background: var(--nav-bg);
}

.mobile-menu.active {
    display: block;
}

@media (min-width: 1024px) {
    .mobile-menu {
        display: none !important;
    }
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--nav-text);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.mobile-nav-link:hover {
    color: var(--nav-text-hover);
    background-color: rgba(55, 62, 152, 0.1);
}

.dark .mobile-nav-link:hover {
    background-color: rgba(129, 140, 248, 0.1);
}

.mobile-nav-link.active {
    color: var(--nav-text-active);
    background-color: rgba(55, 62, 152, 0.15);
    font-weight: 600;
}

.dark .mobile-nav-link.active {
    background-color: rgba(129, 140, 248, 0.15);
}

.mobile-nav-link i {
    font-size: 1rem;
    width: 1.5rem;
    margin-right: 0.75rem;
    text-align: center;
}

/* ===========================================
   ENHANCED BREADCRUMB SYSTEM
   =========================================== */

.breadcrumb-nav {
    background: var(--breadcrumb-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--nav-border);
    padding: 0.75rem 0;
}

.breadcrumb-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .breadcrumb-container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .breadcrumb-container {
        padding: 0 2rem;
    }
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-link {
    display: flex;
    align-items: center;
    color: var(--breadcrumb-text);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.breadcrumb-link:hover {
    color: var(--nav-text-hover);
    background-color: rgba(55, 62, 152, 0.1);
}

.dark .breadcrumb-link:hover {
    background-color: rgba(129, 140, 248, 0.1);
}

.breadcrumb-link i {
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.breadcrumb-current {
    color: var(--breadcrumb-text-active);
    font-weight: 500;
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
}

.breadcrumb-current i {
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.breadcrumb-separator {
    color: var(--breadcrumb-separator);
    font-size: 0.75rem;
    margin: 0 0.25rem;
}

/* ===========================================
   ENHANCED FOOTER SYSTEM
   =========================================== */

.main-footer {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-primary);
    margin-top: auto;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 1rem 2rem;
}

@media (min-width: 640px) {
    .footer-content {
        padding: 3rem 1.5rem 2rem;
    }
}

@media (min-width: 1024px) {
    .footer-content {
        padding: 3rem 2rem 2rem;
    }
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-section h3 {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.footer-section h3 i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.25rem 0;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-link:hover {
    color: var(--nav-text-hover);
    transform: translateX(4px);
}

.footer-link i {
    width: 1rem;
    text-align: center;
    opacity: 0.7;
    font-size: 0.875rem;
}

.footer-link:hover i {
    opacity: 1;
    color: var(--primary-500);
}

.footer-bottom {
    border-top: 1px solid var(--border-primary);
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    .footer-bottom-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-copyright {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--text-tertiary);
    background: var(--widget-bg);
    border: 1px solid var(--border-primary);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-link:hover {
    color: var(--nav-text-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--widget-shadow);
}

/* Urdu text styling in footer */
.footer-link.urdu-text {
    font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', 'Arabic Typesetting', 'Traditional Arabic', serif;
    direction: rtl;
    text-align: right;
    line-height: 1.8;
    font-size: 1em;
}

.footer-section h3 .urdu-text {
    font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', 'Arabic Typesetting', serif;
    direction: rtl;
    font-size: 1.1em;
}

/* ===========================================
   ENHANCED WIDGET SYSTEM
   =========================================== */

.widget {
    background: var(--widget-bg);
    border: 1px solid var(--widget-border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px var(--widget-shadow);
    transition: all 0.3s ease;
}

.widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px var(--widget-shadow);
}

.widget-title {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.widget-title i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* ===========================================
   RESPONSIVE UTILITIES
   =========================================== */

.hidden {
    display: none !important;
}

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

/* ===========================================
   ANIMATION SYSTEM
   =========================================== */

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

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

.animate-fade-in-down {
    animation: fadeInDown 0.5s ease-out;
}

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

/* Staggered animations for lists */
.stagger-animation > * {
    animation: fadeInDown 0.5s ease-out;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-animation > *:nth-child(7) { animation-delay: 0.7s; }

/* ===========================================
   ACCESSIBILITY ENHANCEMENTS
   =========================================== */

/* Focus styles for better keyboard navigation */
.nav-link:focus,
.breadcrumb-link:focus,
.footer-link:focus,
.theme-toggle:focus,
.mobile-menu-btn:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --bg-primary: #ffffff;
        --border-primary: #000000;
    }
    
    .dark {
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --bg-primary: #000000;
        --border-primary: #ffffff;
    }
}

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

/* Print styles */
@media print {
    .main-header,
    .breadcrumb-nav,
    .nav-actions,
    .mobile-menu-btn {
        display: none !important;
    }
}