/* Modern Luxurious Saudi Visa Website - Custom Styles */

/* Smooth Scrolling & Overflow Fix - PERFORMANCE OPTIMIZED */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
}

* {
    scroll-behavior: smooth !important;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
    -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
}

/* News Ticker Animation */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.animate-scroll {
    animation: scroll 40s linear infinite;
    will-change: transform;
}

/* News Ticker - Prevent Overflow */
.news-ticker {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.news-ticker:hover .animate-scroll {
    animation-play-state: paused;
}

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

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

::-webkit-scrollbar-thumb {
    background: #C9A35E;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #B8924D;
}

/* Blog Card Styles */
.blog-card {
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
}

.blog-card img {
    transition: transform 0.5s ease;
}

.blog-card:hover img {
    transform: scale(1.05);
}

/* FAQ Accordion */
.faq-question.active i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer.active {
    max-height: 500px;
}

/* Print Styles for PDF Generation */
@media print {
    @page {
        size: A4;
        margin: 20mm;
    }
    
    body {
        background: white;
    }
    
    .no-print,
    nav,
    footer,
    .floating-actions,
    #mobile-menu-btn,
    .whatsapp-float {
        display: none !important;
    }
    
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 30px;
        padding-bottom: 20px;
        border-bottom: 3px solid #C9A26A;
    }
    
    .print-header h1 {
        color: #1B2A41;
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .print-header .office-info {
        color: #475569;
        font-size: 14px;
        line-height: 1.8;
    }
    
    .print-content {
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
        color: #1B2A41 !important;
    }
    
    ul, ol {
        page-break-inside: avoid;
    }
}

/* Profession Database Table */
.profession-table {
    width: 100%;
    border-collapse: collapse;
}

.profession-table th {
    background: #1B2A41;
    color: white;
    padding: 12px;
    text-align: right;
    font-weight: 600;
}

.profession-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.profession-table tr:hover {
    background: #f9fafb;
}

/* Loader / Spinner */
.loader {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #C9A26A;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Mobile Menu */
#mobile-menu {
    transition: all 0.3s ease;
}

#mobile-menu.active {
    display: block !important;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

/* Card Shine Effect */
@keyframes shine {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.card-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: 0.5s;
}

.card-shine:hover::before {
    left: 100%;
}

/* Arabic Font Optimization */
/* Font Smoothing & Overflow Prevention */
* {
    box-sizing: border-box;
}

body {
    font-feature-settings: "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Focus Visible for Accessibility — keyboard-only */
*:focus { outline: none; }
*:focus-visible {
    outline: 2px solid rgba(201, 163, 94, 0.7);
    outline-offset: 2px;
}

/* Image Loading */
img {
    transition: opacity 0.3s ease;
}

img:not([src]):not([srcset]) {
    opacity: 0;
}

/* Responsive Typography */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
}

/* Calculator Specific Styles */
.calculator-result {
    background: linear-gradient(135deg, #1B2A41 0%, #2a3f5f 100%);
    border: 2px solid #C9A26A;
}

.calculator-input:focus {
    border-color: #C9A26A;
    box-shadow: 0 0 0 3px rgba(201, 162, 106, 0.1);
}

/* Professions Search */
.search-highlight {
    background: yellow;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Testimonial Stars */
.stars {
    color: #C9A26A;
    letter-spacing: 2px;
}

/* Map Styles */
iframe {
    border-radius: 16px;
}

/* Blog Post Content Styles */
.blog-content {
    line-height: 1.8;
}

.blog-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1B2A41;
}

.blog-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: #1B2A41;
}

.blog-content p {
    margin-bottom: 1rem;
    color: #475569;
}

.blog-content ul,
.blog-content ol {
    margin-bottom: 1rem;
    padding-right: 1.5rem;
}

.blog-content li {
    margin-bottom: 0.5rem;
    color: #475569;
}

.blog-content a {
    color: #C9A26A;
    text-decoration: underline;
}

.blog-content a:hover {
    color: #B58E56;
}

.blog-content blockquote {
    border-right: 4px solid #C9A26A;
    padding-right: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #64748b;
}

.blog-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.blog-content pre {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: #1B2A41;
    color: white;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    margin-bottom: 0.5rem;
}

.tooltip:hover::before {
    opacity: 1;
}

/* Print Button */
.print-btn {
    background: linear-gradient(135deg, #1B2A41 0%, #2a3f5f 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid #C9A26A;
}

.print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(201, 162, 106, 0.3);
}

/* Success Message */
.success-message {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Error Message */
.error-message {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* ========================================
   HERO SLIDER STYLES
   ======================================== */

/* Slider Container */
/* Hero Section - Overflow Fix */
#home {
    overflow: hidden !important;
    max-width: 100vw;
}

/* Hero Slider - Contain Everything */
.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden !important;
}

/* Slides - Fixed for RTL */
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, transform 1.5s ease-in-out;
    transform: scale(1);
    overflow: hidden;
}

.hero-slide.active {
    opacity: 1;
    z-index: 1;
    transform: scale(1);
}

.hero-slide img {
    /* Removed kenburns animation to prevent horizontal overflow in RTL layout */
}

/* Ken Burns Effect - Fixed for RTL */
@keyframes kenburns {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Slider Dots */
.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot:hover {
    background: rgba(201, 163, 94, 0.8);
    transform: scale(1.2);
}

.slider-dot.active {
    background: #C9A35E;
    width: 40px;
    border-radius: 6px;
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

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

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

/* Fade In from Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

/* Fade In from Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

/* ========================================
   HOVER EFFECTS & INTERACTIONS
   ======================================== */

/* Card 3D Lift - Enhanced */
.card-3d {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-3d:hover {
    transform: translateY(-16px) rotateX(5deg) rotateY(-5deg) scale(1.03);
    box-shadow: 0 25px 80px rgba(27, 42, 65, 0.3), 
                0 15px 40px rgba(201, 163, 94, 0.2);
}

/* Button Pulse */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.btn-pulse:hover {
    animation: pulse 1s ease-in-out infinite;
}

/* Icon Rotate */
.icon-rotate {
    transition: transform 0.3s ease;
}

.icon-rotate:hover i {
    transform: rotate(360deg);
    transition: transform 0.6s ease;
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background: linear-gradient(270deg, #1B2A41, #C9A35E, #1B2A41);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #C9A35E 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.ripple:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* Glow Effect */
.glow {
    transition: all 0.3s ease;
}

.glow:hover {
    box-shadow: 0 0 20px rgba(201, 163, 94, 0.6),
                0 0 40px rgba(201, 163, 94, 0.4),
                0 0 60px rgba(201, 163, 94, 0.2);
}

/* ========================================
   SMOOTH TRANSITIONS
   ======================================== */

/* Page Load Animation */
body {
    animation: fadeIn 0.5s ease-in;
}

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

/* Link Underline Animation */
.link-underline {
    position: relative;
}

.link-underline::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #C9A35E;
    transition: width 0.3s ease;
}

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

/* Stagger Animation for Lists */
.stagger-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

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

/* ========================================
   RESPONSIVE ANIMATIONS
   ======================================== */

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


/* ==========================================
   ULTRA PERFORMANCE OPTIMIZATIONS (cleaned)
   Note: transform on body/html/section/div was REMOVED
   because it breaks position:fixed — modern browsers
   handle hardware acceleration automatically.
   ========================================== */

/* Optimize Links for Instant Feel */
a {
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

/* Disable transitions during scroll for smoothness */
.disable-transitions,
.disable-transitions * {
    transition: none !important;
}

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


/* ⚡ UX smoothness — keyboard focus لا يظهر مع الماوس (تم استبدال الإطار الكبير بتأثير الختم الذهبي stamp-fx) */

:focus { outline: none; }

/* Keyboard-only focus: خفيف وأنيق */
:focus-visible {
    outline: 2px solid rgba(201, 163, 94, 0.7);
    outline-offset: 2px;
    border-radius: 8px;
}

/* Buttons + links: لا box-shadow دائم — المستخدم يرى تأثير الختم (stamp-fx) بدلاً عنه */
button:focus-visible,
a:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid rgba(201, 163, 94, 0.7);
    outline-offset: 2px;
    box-shadow: none;
}

/* حقول النماذج: ربط لوني خفيف */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(201,163,94,0.25);
    border-color: #C9A35E !important;
}

/* Disable Tap Highlight on Mobile */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Disable Transitions on Scroll for Performance */
html.is-scrolling * {
    transition: none !important;
}

/* Optimize Hover States */
a:hover,
button:hover {
    transition: all 0.15s ease-out;
}

/* Remove Glow Effect on Links */
a {
    -webkit-appearance: none;
    appearance: none;
}

/* Smooth Link Transitions */
a, button {
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
}

/* Optimize Image Loading */
img {
    will-change: transform;
    backface-visibility: hidden;
}

/* Smooth Scrolling Performance */
@supports (scroll-behavior: smooth) {
    html {
        scroll-behavior: smooth;
    }
}

/* Mobile Performance Optimization */
@media (max-width: 768px) {
    * {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
}

/* Disable Animations on Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ⚡ Modal Optimization for Mobile & Desktop */
#professionModal {
    scroll-behavior: smooth;
}

#professionModal .inline-block {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#professionModal .px-8 {
    scroll-behavior: smooth;
}

/* Smooth scroll for requirements list */
#modalRequirementsList {
    scroll-behavior: smooth;
    scroll-margin-top: 50px;
}

/* Mobile optimization - ensure modal content is scrollable */
@media (max-width: 640px) {
    #professionModal .inline-block {
        max-height: 95vh;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    #professionModal .px-8 {
        padding: 1rem !important;
    }
    
    #professionModal .py-6 {
        padding: 1rem !important;
    }
    
    #modalRequirementsList {
        scroll-margin-top: 20px;
    }
}

/* Ensure smooth scrolling inside modal */
#professionModal .inline-block > div {
    scroll-behavior: smooth;
}
