/* NHR Alemtithal Website Custom Styles */

/* Color Variables */
:root {
    --color-primary: #605DBA;
    --color-success: #4ECDC4;
    --color-info: #00A9E0;
    --color-warning: #FFC107;
    --color-danger: #FF6B6B;

    /* Mapped for backward compatibility */
    --color-accent-1: var(--color-success);
    --color-accent-2: var(--color-info);
    --color-accent-3: var(--color-warning);
    --color-accent-4: var(--color-danger);

    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-gray-900);
    background-color: #ffffff;
}

/* Typography Enhancements */
.text-gradient-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-accent {
    background: linear-gradient(135deg, var(--color-accent-1) 0%, var(--color-accent-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #7b68ee 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px 0 rgba(96, 93, 186, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(96, 93, 186, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(96, 93, 186, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--color-gray-700);
    border: 2px solid var(--color-gray-300);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px 0 rgba(96, 93, 186, 0.2);
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid var(--color-gray-200);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-header {
    padding: 24px 24px 0 24px;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 0 24px 24px 24px;
}

/* Stats/Numbers Styling */
.stat-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    color: var(--color-primary);
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Icon Styles */
.icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.icon-circle.primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #7b68ee 100%);
    color: white;
}

.icon-circle.accent1 {
    background: linear-gradient(135deg, var(--color-accent-1) 0%, #4ade80 100%);
    color: white;
}

.icon-circle.accent2 {
    background: linear-gradient(135deg, var(--color-accent-2) 0%, #3b82f6 100%);
    color: white;
}

.icon-circle.accent3 {
    background: linear-gradient(135deg, var(--color-accent-3) 0%, #f59e0b 100%);
    color: white;
}

.icon-circle.accent4 {
    background: linear-gradient(135deg, var(--color-accent-4) 0%, #ef4444 100%);
    color: white;
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-gray-300);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(96, 93, 186, 0.1);
}

.form-error {
    color: #ef4444;
    font-size: 14px;
    margin-top: 4px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Alert Styles */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
}

.alert-success {
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-warning {
    background-color: #fefce8;
    border: 1px solid #fef08a;
    color: #ca8a04;
}

.alert-info {
    background-color: #dbeafe;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

/* Loading States */
.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-gray-300);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(96, 93, 186, 0.1);
}

.form-error {
    color: #ef4444;
    font-size: 14px;
    margin-top: 4px;
}

.form-success {
    color: var(--color-accent-1);
    font-size: 14px;
    margin-top: 4px;
}

/* Alert Styles */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: var(--color-accent-1);
    color: #166534;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #f87171;
    color: #dc2626;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: var(--color-accent-3);
    color: #d97706;
}

.alert-info {
    background-color: #eff6ff;
    border-color: var(--color-accent-2);
    color: #1d4ed8;
}

/* Navigation Enhancements */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile Menu Enhancement */
#mobile-menu-button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    z-index: 60;
    /* Higher than menu z-index */
    position: relative;
    cursor: pointer;
}

/* New Full-Screen Mobile Menu */
#mobile-menu {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.98);
    /* Fallback */
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glass Effect support */
@supports (backdrop-filter: blur(20px)) {
    #mobile-menu {
        background-color: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}

/* Dark mode glass override */
@media (prefers-color-scheme: dark) {
    #mobile-menu {
        background-color: rgba(17, 24, 39, 0.95);
    }

    @supports (backdrop-filter: blur(20px)) {
        #mobile-menu {
            background-color: rgba(17, 24, 39, 0.85);
        }
    }
}

/* Active State */
#mobile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Navigation Links */
.mobile-nav-link {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-gray-800);
    text-decoration: none;
    margin: 10px 0;
    position: relative;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.mobile-nav-link:hover {
    color: var(--color-primary);
    transform: scale(1.05);
}

/* Staggered Animation for links */
#mobile-menu.active .mobile-nav-link {
    animation: slideUpFade 0.5s forwards;
}

#mobile-menu.active .mobile-nav-link:nth-child(1) {
    animation-delay: 0.1s;
}

#mobile-menu.active .mobile-nav-link:nth-child(2) {
    animation-delay: 0.15s;
}

#mobile-menu.active .mobile-nav-link:nth-child(3) {
    animation-delay: 0.2s;
}

#mobile-menu.active .mobile-nav-link:nth-child(4) {
    animation-delay: 0.25s;
}

#mobile-menu.active .mobile-nav-link:nth-child(5) {
    animation-delay: 0.3s;
}

#mobile-menu.active .mobile-nav-link:nth-child(6) {
    animation-delay: 0.35s;
}

#mobile-menu.active .mobile-nav-link:nth-child(7) {
    animation-delay: 0.4s;
}

/* Language Switcher in Mobile */
.mobile-lang-switcher {
    margin-top: 2rem;
    padding: 10px 24px;
    border: 2px solid var(--color-gray-300);
    border-radius: 50px;
    font-weight: 600;
    color: var(--color-gray-700);
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

#mobile-menu.active .mobile-lang-switcher {
    animation: slideUpFade 0.5s forwards 0.45s;
}

.mobile-lang-switcher:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: rgba(96, 93, 186, 0.05);
}

/* CTA Button in Mobile */
.mobile-cta-btn {
    margin-top: 2rem;
    background: var(--color-primary);
    color: white;
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px -5px rgba(96, 93, 186, 0.4);
    opacity: 0;
    transform: translateY(20px);
}

#mobile-menu.active .mobile-cta-btn {
    animation: slideUpFade 0.5s forwards 0.5s;
}

@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section Styles */
.hero-gradient {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.hero-pattern {
    background-image: radial-gradient(circle at 1px 1px, rgba(96, 93, 186, 0.15) 1px, transparent 0);
    background-size: 20px 20px;
}

/* Section Divider */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--color-gray-300) 50%, transparent 100%);
    margin: 80px 0;
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: rgba(96, 93, 186, 0.1);
    color: var(--color-primary);
}

.badge-success {
    background: rgba(60, 180, 110, 0.1);
    color: var(--color-accent-1);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--color-accent-3);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Utilities */
@media (max-width: 640px) {
    .stat-number {
        font-size: 2rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-outline {
        width: 100%;
        justify-content: center;
    }

    .card-body {
        padding: 16px;
    }

    .icon-circle {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    .btn-primary,
    .btn-secondary,
    .btn-outline {
        border: 1px solid var(--color-gray-600) !important;
        background: white !important;
        color: var(--color-gray-900) !important;
    }
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
    :root {
        --color-gray-50: #1f2937;
        --color-gray-100: #374151;
        --color-gray-200: #4b5563;
        --color-gray-300: #6b7280;
        --color-gray-400: #9ca3af;
        --color-gray-500: #d1d5db;
        --color-gray-600: #e5e7eb;
        --color-gray-700: #f3f4f6;
        --color-gray-800: #f9fafb;
        --color-gray-900: #ffffff;
    }
}

/* Accessibility Improvements */
.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;
}

/* Focus styles for keyboard navigation */
*:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn-primary:focus,
.btn-secondary:focus,
.btn-outline:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(96, 93, 186, 0.3);
}

/* Smooth transitions for better UX */
* {
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: whatsapp-pulse 2s infinite;
}

/* Position based on language/direction */
html[dir="ltr"] .whatsapp-float {
    right: 40px;
}

html[dir="rtl"] .whatsapp-float {
    left: 40px;
}

.whatsapp-float:hover {
    background-color: #128c7e;
    color: #FFF;
    transform: scale(1.1);
}

@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        font-size: 25px;
    }

    html[dir="ltr"] .whatsapp-float {
        right: 20px;
    }

    html[dir="rtl"] .whatsapp-float {
        left: 20px;
    }
}