/**
 * Jawad Brothers Redesign 2026
 * Custom Stylesheet & Design System
 */

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */
:root {
    /* Brand Colors */
    --primary-color: #E44322;
    --primary-hover: #C53213;
    --primary-rgb: 228, 67, 34;
    --accent-color: #F59E0B;
    --accent-rgb: 245, 158, 11;
    
    /* Bootstrap Primary Override (Blue to Emerald Green) */
    --bs-primary: #10B981;
    --bs-primary-rgb: 16, 185, 129;
    --bs-primary-bg-subtle: rgba(16, 185, 129, 0.12);
    --bs-primary-border-subtle: rgba(16, 185, 129, 0.3);
    
    /* Typography */
    --font-headings: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    /* Animation Speeds */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-bs-theme="light"] {
    --bg-main: #F7F7FA;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.9);
    --border-glass: rgba(0, 0, 0, 0.08);
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 40px -15px rgba(228, 67, 34, 0.15), 0 1px 10px rgba(0, 0, 0, 0.05);
    --glass-blur: blur(12px);
    --navbar-bg: rgba(247, 247, 250, 0.8);
    --gradient-hero: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(240,240,245,0.7));
}

/* Dark Theme Variables */
[data-bs-theme="dark"] {
    --bg-main: #0B0C10;
    --bg-card: rgba(25, 28, 36, 0.45);
    --bg-card-hover: rgba(35, 40, 52, 0.6);
    --border-glass: rgba(255, 255, 255, 0.06);
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.5), 0 1px 5px rgba(255, 255, 255, 0.02);
    --shadow-hover: 0 20px 40px -15px rgba(228, 67, 34, 0.35), 0 1px 10px rgba(255, 255, 255, 0.05);
    --glass-blur: blur(16px);
    --navbar-bg: rgba(11, 12, 16, 0.75);
    --gradient-hero: linear-gradient(135deg, rgba(11, 12, 16, 0.95), rgba(25, 28, 36, 0.8));
}

/* ==========================================================================
   Global Resets & Typographical Styles
   ========================================================================== */
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.transition-all {
    transition: all var(--transition-normal) !important;
}

.hover-primary:hover {
    color: var(--primary-color) !important;
}

/* Page Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-main);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

/* ==========================================================================
   Button Modifications
   ========================================================================== */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-family: var(--font-headings);
    font-weight: 600;
    transition: all var(--transition-fast);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(var(--primary-rgb), 0.5) !important;
}

.btn-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-glass {
    background-color: var(--bg-card);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    backdrop-filter: var(--glass-blur);
}
.btn-glass:hover {
    background-color: var(--bg-card-hover);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.hover-lift {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.hover-lift:hover {
    transform: translateY(-4px);
}

/* ==========================================================================
   Navigation Bar Styles
   ========================================================================== */
.navbar-glass {
    background-color: var(--navbar-bg);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-glass);
    transition: all var(--transition-normal);
}

.navbar-brand .logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

[data-bs-theme="dark"] .logo-light {
    display: none !important;
}
[data-bs-theme="dark"] .logo-dark {
    display: block !important;
}
[data-bs-theme="light"] .logo-light {
    display: block !important;
}
[data-bs-theme="light"] .logo-dark {
    display: none !important;
}

.nav-link {
    font-family: var(--font-headings);
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all var(--transition-fast);
}
.nav-link:hover, .nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(var(--primary-rgb), 0.05);
}

/* Custom hamburger toggler */
.navbar-toggler-icon-custom {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
}
.navbar-toggler-icon-custom span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

/* Dropdown styling */
.dropdown-menu-glass {
    background-color: var(--bg-main);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    backdrop-filter: var(--glass-blur);
    min-width: 280px;
    padding: 0.75rem;
}
.dropdown-item {
    border-radius: 10px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}
.dropdown-item:hover {
    background-color: rgba(var(--primary-rgb), 0.08);
    color: var(--primary-color);
}
.dropdown-icon-bg {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* ==========================================================================
   Home Hero Banner Slider (Swiper)
   ========================================================================== */
.hero-slider {
    width: 100%;
    height: 90vh;
    min-height: 600px;
    position: relative;
}
.hero-slide {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.hero-slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4);
    transform: scale(1);
    transition: transform 6s ease-out;
}
.swiper-slide-active .hero-slide-bg {
    transform: scale(1.1);
}

.hero-glass-card {
    background: rgba(var(--bg-main) === '#0B0C10' ? '15,18,25' : '255,255,255', 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    backdrop-filter: blur(18px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    position: relative;
}

/* ==========================================================================
   Cards / Glassmorphism
   ========================================================================== */
.glass-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal);
}
.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    background-color: var(--bg-card-hover);
}

/* Service/Intro Grid Item */
.service-card-icon {
    font-size: 2.2rem;
    color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.08);
    width: 70px;
    height: 70px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: all var(--transition-fast);
}
.glass-card:hover .service-card-icon {
    background-color: var(--primary-color);
    color: #fff;
    transform: rotateY(180deg);
}

/* Feature categories home */
.product-cat-card {
    position: relative;
    border-radius: 20px;
    height: 380px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}
.product-cat-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.product-cat-card:hover .product-cat-img {
    transform: scale(1.15);
}
.product-cat-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(11, 12, 16, 0.95) 10%, rgba(11, 12, 16, 0.4) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    transition: background var(--transition-normal);
}
.product-cat-card:hover .product-cat-overlay {
    background: linear-gradient(to top, rgba(var(--primary-rgb), 0.95) 10%, rgba(11, 12, 16, 0.4) 60%, transparent 100%);
}

/* ==========================================================================
   Business Network Sectors & Map
   ========================================================================== */
.sector-badge {
    background-color: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}
.sector-badge i {
    color: var(--primary-color);
    font-size: 1.1rem;
    transition: all var(--transition-fast);
}
.sector-badge:hover {
    border-color: var(--primary-color);
    background-color: rgba(var(--primary-rgb), 0.05);
    transform: translateY(-2px);
}
.sector-badge:hover i {
    transform: scale(1.2);
}

.map-card-glow {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}
.map-card-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

/* Countries Tag Grid */
.country-tag {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}
.country-tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

/* ==========================================================================
   Timeline (About Page)
   ========================================================================== */
.timeline-container {
    position: relative;
    padding-left: 3rem;
}
.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15px;
    width: 2px;
    height: 100%;
    background-color: var(--border-glass);
}
.timeline-item {
    position: relative;
    margin-bottom: 3.5rem;
}
.timeline-badge {
    position: absolute;
    left: -3rem;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 6px solid var(--bg-main);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
    z-index: 2;
}
.timeline-year {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Product Catalog System
   ========================================================================== */
.catalog-tabs .nav-link {
    border: 1px solid var(--border-glass) !important;
    background-color: var(--bg-card);
    color: var(--text-primary) !important;
    border-radius: 50px;
    padding: 0.6rem 1.8rem !important;
    font-weight: 600;
}
.catalog-tabs .nav-link.active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
    box-shadow: 0 10px 20px -8px rgba(var(--primary-rgb), 0.4);
}

.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-card-img-wrapper {
    position: relative;
    height: 240px;
    overflow: hidden;
    border-top-left-radius: 19px;
    border-top-right-radius: 19px;
    background-color: rgba(0, 0, 0, 0.05);
}
.product-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.product-card:hover .product-card-img {
    transform: scale(1.1);
}
.product-card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(var(--primary-rgb), 0.9);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
}
.product-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ==========================================================================
   Footer Elements
   ========================================================================== */
.footer-bg {
    background-color: #08090C;
}
.footer-logo-light {
    height: 48px;
    width: auto;
}
.newsletter-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.footer-links a {
    color: #9CA3AF;
    transition: all var(--transition-fast);
}
.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 6px;
}
.footer-accent-glow {
    bottom: -150px;
    right: -150px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.12) 0%, transparent 70%);
    pointer-events: none;
}

/* ==========================================================================
   Floating Widgets & WhatsApp Widget
   ========================================================================== */
.whatsapp-floating-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
}
.whatsapp-trigger-btn {
    width: 60px;
    height: 60px;
    background-color: #25D366;
    font-size: 2rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.whatsapp-trigger-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.5);
}
.chat-bubble {
    width: 280px;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: absolute;
    bottom: 75px;
    right: 0;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-normal);
}
.chat-bubble.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.animate-pulse {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Responsive Modifiers
   ========================================================================== */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--bg-main);
        padding: 1.5rem;
        border-radius: 16px;
        border: 1px solid var(--border-glass);
        margin-top: 1rem;
    }
    .hero-slider {
        height: 75vh;
    }
}

/* ==========================================================================
   Custom Section Spacing Utilities (100px)
   ========================================================================== */
.py-6 {
    padding-top: 100px !important;
    padding-bottom: 100px !important;
}
@media (min-width: 992px) {
    .py-lg-7 {
        padding-top: 100px !important;
        padding-bottom: 100px !important;
    }
}

/* ==========================================================================
   Contrast Adjustments for Dark Background Sections in Light Mode
   ========================================================================== */
.bg-dark,
.footer-bg,
.stats-section {
    color: rgba(255, 255, 255, 0.75) !important;
}

.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6,
.footer-bg h1, .footer-bg h2, .footer-bg h3, .footer-bg h4, .footer-bg h5, .footer-bg h6,
.stats-section h1, .stats-section h2, .stats-section h3, .stats-section h4, .stats-section h5, .stats-section h6 {
    color: #ffffff !important;
}

.bg-dark p, .bg-dark span, .bg-dark .text-secondary,
.footer-bg p, .footer-bg span, .footer-bg .text-secondary, .footer-bg .text-secondary-emphasis,
.stats-section p, .stats-section span, .stats-section .text-secondary, .stats-section .text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

.bg-dark a,
.footer-bg a {
    color: rgba(255, 255, 255, 0.75);
}
.bg-dark a:hover,
.footer-bg a:hover {
    color: var(--bs-primary) !important;
}

/* ==========================================================================
   FAQ Accordion Question Color Adjustments
   ========================================================================== */
.faq-question {
    color: #4B5563 !important; /* Dark Grey (equivalent to slate-600) */
}
[data-bs-theme="dark"] .faq-question {
    color: #E5E7EB !important; /* Light Grey in dark theme for high contrast */
}

/* ==========================================================================
   Hero Slider Text Color Adjustments
   ========================================================================== */
.hero-glass-card h1,
.hero-glass-card h2,
.hero-glass-card p,
.hero-glass-card .hero-subtitle,
.hero-glass-card .text-secondary-emphasis {
    color: #ffffff !important;
}
