/* assets/css/style.css */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&family=Outfit:wght@300;400;500;700&display=swap');

:root {
    --brand-primary: #002B5C;
    /* Deep Navy Blue */
    --brand-secondary: #C5A059;
    /* Classic Gold */
    --brand-dark: #1a1a2e;

    --bg-body: #f4f7f6;
    --bg-surface: #ffffff;
    --text-main: #2d3436;
    --text-light: #636e72;

    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Outfit', 'Tajawal', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
}

/* --- Top Bar (Gold) --- */
.top-bar {
    background-color: var(--brand-secondary);
    color: #fff;
    padding: 8px 0;
    font-size: 0.9rem;
}

.top-bar a {
    color: #fff;
    text-decoration: none;
    margin: 0 10px;
    font-weight: 500;
}

.top-bar i {
    opacity: 0.8;
}

/* --- Main Header (White) --- */
.main-header {
    background-color: var(--bg-surface);
    color: var(--text-main);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 100;
}

.brand-section {
    display: flex;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand-primary);
    line-height: 1.2;
    margin: 0 15px;
}

/* --- Navbar (Deep Navy) --- */
.navbar-custom {
    background: linear-gradient(to right, #001f3f, #003366);
    /* Richer gradient */
    padding: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.navbar-custom .container {
    position: relative;
    /* For absolute positioning of lang btn if needed, or just flex */
}

/* Navbar Hover: Sleek Underline & Glow */
.navbar-custom .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 18px 25px !important;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: none;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: var(--brand-secondary) !important;
    background-color: transparent;
    /* Removed boxy bg */
    transform: translateY(-2px);
    text-shadow: 0 0 15px rgba(197, 160, 89, 0.4);
}

/* Elegant Underline Animation */
.navbar-custom .nav-link::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 30px;
    height: 2px;
    background-color: var(--brand-secondary);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

.navbar-custom .nav-link:hover::after,
.navbar-custom .nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
    width: 60%;
}

/* --- 3D Gold Button --- */
.btn-gold {
    background: linear-gradient(to bottom, #d4af37, #C5A059);
    color: #fff;
    border-radius: 12px;
    padding: 12px 35px;
    font-weight: 800;
    font-size: 1rem;
    border: none;
    position: relative;
    transition: all 0.1s ease;
    box-shadow:
        0px 6px 0px #8a6d3b,
        0px 10px 20px rgba(0, 0, 0, 0.2),
        inset 0px 1px 0px rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: translateY(0);
}

.btn-gold:hover {
    color: #fff;
    transform: translateY(-2px);
    background: linear-gradient(to bottom, #ddb945, #cfac65);
    box-shadow:
        0px 8px 0px #8a6d3b,
        0px 15px 25px rgba(0, 0, 0, 0.3),
        inset 0px 1px 0px rgba(255, 255, 255, 0.4);
}

.btn-gold:active {
    transform: translateY(4px);
    box-shadow:
        0px 2px 0px #8a6d3b,
        0px 5px 10px rgba(0, 0, 0, 0.2),
        inset 0px 1px 0px rgba(255, 255, 255, 0.4);
}

.btn-gold::after {
    content: none;
}

/* --- 3D Language Button --- */
.btn-lang {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    padding: 8px 25px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0px 4px 0px rgba(0, 0, 0, 0.3),
        0px 5px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transform: translateY(0);
}

.btn-lang:hover {
    background-color: var(--brand-secondary);
    border-color: var(--brand-secondary);
    color: #001f3f !important;
    transform: translateY(-2px);
    box-shadow:
        0px 6px 0px #8a6d3b,
        0px 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-lang:active {
    transform: translateY(2px);
    box-shadow:
        0px 2px 0px #8a6d3b,
        0px 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-lang i {
    transition: transform 0.4s ease;
}

.btn-lang:hover i {
    transform: rotate(360deg);
}

/* --- Hero Section (Professional Slider) --- */
.hero-section {
    /* Background handled by Carousel */
    color: #fff;
    padding: 180px 0;
    /* Increased height for impact */
    text-align: center;
    overflow: hidden;
    position: relative;
}

/* 1. Cinematic Pan & Zoom Effect */
.carousel-item {
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    /* Ensure image doesn't overflow during pan */
}

.carousel-item .bg-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: none;
    /* Disable default transition to use animation */
}

/* Define Animations */
@keyframes panRightZoom {
    0% {
        transform: scale(1) translate(0, 0);
    }

    100% {
        transform: scale(1.2) translate(40px, 0);
    }
}

@keyframes panLeftZoom {
    0% {
        transform: scale(1.2) translate(0, 0);
    }

    100% {
        transform: scale(1) translate(-40px, 0);
    }
}

/* Alternating Animations for Dynamic Feel */
.carousel-item:nth-child(odd) .bg-img {
    animation: panRightZoom 15s infinite alternate linear;
}

.carousel-item:nth-child(even) .bg-img {
    animation: panLeftZoom 15s infinite alternate linear;
}


/* Note: .carousel-item.active .bg-img animation is applied by nth-child rules above */


/* 2. Premium Gradient Overlay (Darker for Readability) */
.hero-overlay {
    background: linear-gradient(to bottom,
            rgba(0, 43, 92, 0.8) 0%,
            rgba(0, 20, 50, 0.6) 50%,
            rgba(0, 43, 92, 0.9) 100%);
}

/* 3. Text Styles (Static & Bold) */
.hero-title,
.hero-subtitle,
.hero-btns {
    position: relative;
    z-index: 10;
}

/* General Hero Text Styles */
.hero-title {
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.5);
    letter-spacing: -1px;
    animation: fadeInUp 1s ease-out forwards;
    position: relative;
    z-index: 10;
}

/* Shatter/Glitch Effect for Title */
@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(-2deg);
    }

    40% {
        transform: skew(2deg);
    }

    60% {
        transform: skew(-1deg);
    }

    80% {
        transform: skew(1deg);
    }

    100% {
        transform: skew(0deg);
    }
}

.hero-title:hover {
    animation: glitch-skew 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    color: var(--brand-secondary);
    text-shadow: 4px 4px 0px #001f3f;
}

.hero-subtitle {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 500;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.5s forwards;
    /* Delay for sequence */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- General Components --- */
.section-title {
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    display: inline-block;
    border-bottom: 2px solid var(--brand-secondary);
    padding-bottom: 5px;
}

.display-title {
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

/* Pulse Animation */
@keyframes pulse-gold {
    0% {
        box-shadow: 0 0 0 0 rgba(197, 160, 89, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(197, 160, 89, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(197, 160, 89, 0);
    }
}

.btn-gold {
    background: linear-gradient(45deg, var(--brand-secondary), #d4af37);
    color: #fff;
    border-radius: 50px;
    padding: 12px 35px;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy transition */
    position: relative;
    overflow: hidden;
}


.btn-gold::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
}

.btn-gold:hover::after {
    left: 100%;
    transition: 0.7s ease-in-out;
}

.btn-gold:active {
    transform: translateY(-1px) scale(0.98);
}

/* --- Premium Services Cards (Glassmorphism) --- */
.service-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 15px;
    padding: 40px 30px;
    transition: all 0.4s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--brand-secondary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon-box {
    width: 70px;
    height: 70px;
    background: rgba(0, 43, 92, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.service-card:hover .service-icon-box {
    background: var(--brand-primary);
    color: var(--brand-secondary);
}

.service-icon-box i {
    font-size: 1.8rem;
    color: var(--brand-primary);
    transition: all 0.3s ease;
}

.service-card:hover .service-icon-box i {
    color: #fff;
}

/* --- About Section --- */
.about-img-wrapper {
    position: relative;
    padding: 20px;
}

.about-img-main {
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.about-badge {
    position: absolute;
    bottom: 50px;
    right: 0;
    /* Left for RTL handled by dir */
    background: #fff;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--brand-secondary);
}

/* --- Stats Section --- */
.stats-section {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #001f3f 100%);
    position: relative;
    overflow: hidden;
}

.stats-box h3 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--brand-secondary);
    margin-bottom: 0;
}

/* --- Footer (Dark & Corporate) --- */
footer {
    background-color: #0b111e;
    color: #a0aec0;
    padding-top: 40px;
    padding-bottom: 20px;
    font-size: 0.9rem;
}

footer h5 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 15px;
}

footer h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    /* Handle RTL */
    width: 40px;
    height: 3px;
    background: var(--brand-secondary);
}

body[dir="rtl"] footer h5::after {
    left: auto;
    right: 0;
}

footer a {
    color: #a0aec0;
    text-decoration: none;
    transition: all 0.3s;
}

footer a:hover {
    color: var(--brand-secondary);
    padding-right: 5px;
    /* RTL aware padding logic requires directional awareness, simpler to just change color */
}

/* --- Common Transitions --- */
body,
.main-header,
.navbar-custom,
.form-control {
    transition: all 0.3s ease;
}

/* RTL Specifics */
body[dir="rtl"] {
    text-align: right;
}

body[dir="rtl"] .me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

body[dir="rtl"] .ms-2 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* ========================================
   DARK MODE STYLES
   ======================================== */

/* Dark Mode Variables */
.dark-mode,
[data-theme="dark"] {
    --bg-body: #0d1117;
    --bg-surface: #161b22;
    --text-main: #e6edf3;
    --text-light: #8b949e;
    --brand-primary: #1a3a5c;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Auto Dark Mode based on system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-body: #0d1117;
        --bg-surface: #161b22;
        --text-main: #e6edf3;
        --text-light: #8b949e;
        --brand-primary: #1a3a5c;
        --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
}

/* Dark Mode Specific Overrides */
.dark-mode .main-header,
[data-theme="dark"] .main-header {
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
}

.dark-mode .site-title,
[data-theme="dark"] .site-title {
    color: #e6edf3;
}

.dark-mode .card,
[data-theme="dark"] .card {
    background-color: #161b22;
    border-color: #30363d;
    color: #e6edf3;
}

.dark-mode .card-body,
[data-theme="dark"] .card-body {
    background-color: #161b22;
}

.dark-mode footer,
[data-theme="dark"] footer {
    background-color: #010409;
}

.dark-mode .service-card,
[data-theme="dark"] .service-card {
    background: #161b22;
    border-color: #30363d;
}

.dark-mode .service-card h5,
[data-theme="dark"] .service-card h5 {
    color: #e6edf3;
}

.dark-mode .form-control,
[data-theme="dark"] .form-control {
    background-color: #0d1117;
    border-color: #30363d;
    color: #e6edf3;
}

.dark-mode .form-control:focus,
[data-theme="dark"] .form-control:focus {
    border-color: var(--brand-secondary);
    background-color: #161b22;
}

.dark-mode .text-primary,
[data-theme="dark"] .text-primary {
    color: var(--brand-secondary) !important;
}

.dark-mode .text-muted,
[data-theme="dark"] .text-muted {
    color: #8b949e !important;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(20deg);
}

.dark-mode-toggle i {
    transition: transform 0.3s ease;
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #001f3f 100%);
    padding: 30px;
    border-radius: 12px;
    margin-top: 30px;
}

.newsletter-section h5 {
    color: var(--brand-secondary);
    margin-bottom: 15px;
}

.newsletter-section .form-control {
    border-radius: 25px 0 0 25px;
    border: none;
    padding: 12px 20px;
}

.newsletter-section .btn {
    border-radius: 0 25px 25px 0;
    padding: 12px 25px;
}

body[dir="rtl"] .newsletter-section .form-control {
    border-radius: 0 25px 25px 0;
}

body[dir="rtl"] .newsletter-section .btn {
    border-radius: 25px 0 0 25px;
}

/* Comments Section */
.comments-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.dark-mode .comments-section,
[data-theme="dark"] .comments-section {
    border-top-color: #30363d;
}

.comment-item {
    padding: 20px;
    background: var(--bg-surface);
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .comment-item,
[data-theme="dark"] .comment-item {
    background: #161b22;
    border-color: #30363d;
}

.comment-item .comment-author {
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 5px;
}

.dark-mode .comment-item .comment-author,
[data-theme="dark"] .comment-item .comment-author {
    color: var(--brand-secondary);
}

.comment-item .comment-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.comment-item .comment-text {
    margin-top: 10px;
    line-height: 1.7;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* Lazy Loading Placeholder */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([src=""]) {
    opacity: 1;
}

/* Smooth transitions for theme switching */
body,
.main-header,
.navbar-custom,
.card,
footer,
.service-card,
.form-control {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}