/* Custom CSS for PRIME Company Website */

/* Root Variables - Updated PRIME Brand Color Palette */
:root {
    /* Primary Colors */
    --primary-color: #b50612; /* Saturated Red - Main brand color */
    --secondary-color: #000000; /* Pure Black */
    --accent-color: #ffffff; /* White */
    
    /* Secondary Colors - Red Shades */
    --dark-red: #841225; /* Dark Red/Burgundy */
    --medium-red: #d81e46; /* Medium Red/Crimson */
    --bright-red: #f74646; /* Bright Red/Coral */
    
    /* Secondary Colors - Gray Shades */
    --light-gray: #b2b2b2; /* Light Gray */
    --dark-gray: #333333; /* Dark Gray for backgrounds */
    
    /* Supporting Colors */
    --light-red: rgba(181, 6, 18, 0.1); /* Light red with transparency */
    --medium-red-transparent: rgba(216, 30, 70, 0.8); /* Medium red with transparency */
    
    --transition: all 0.3s ease;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--secondary-color);
    overflow-x: hidden;
}

/* Arabic Language Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .me-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

[dir="rtl"] .me-3 {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

[dir="rtl"] .me-1 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

[dir="rtl"] .text-md-end {
    text-align: left !important;
}

/* RTL Navigation Layout */
[dir="rtl"] .navbar-brand {
    order: 2;
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .navbar-nav.me-auto {
    order: 1;
    margin-right: 0 !important;
    margin-left: auto !important;
}

[dir="rtl"] .navbar-nav:last-child {
    order: 0;
    margin-left: 0 !important;
    margin-right: auto !important;
}

[dir="rtl"] .navbar-nav .nav-link {
    text-align: right;
}

[dir="rtl"] .navbar-nav .nav-link::after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* RTL Button Adjustments */
[dir="rtl"] .btn-outline-light {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .btn i {
    margin-left: 0.25rem;
    margin-right: 0;
}

/* RTL Container and Flexbox - Keep Menu Order */
[dir="rtl"] .container {
    direction: rtl;
}

[dir="rtl"] .navbar > .container {
    flex-direction: row-reverse;
}

[dir="rtl"] .navbar-collapse {
    flex-direction: row-reverse;
}

/* Mobile Menu RTL Fix - Override desktop RTL for mobile dropdown */
@media (max-width: 991.98px) {
    /* Reset all RTL positioning for mobile */
    [dir="rtl"] .navbar > .container {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    /* Hamburger menu button positioning */
    [dir="rtl"] .navbar-toggler {
        order: 1 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        position: relative !important;
        left: 0 !important;
        right: auto !important;
    }
    
    /* Logo positioning - move to top of mobile menu */
    [dir="rtl"] .navbar-brand {
        order: 2 !important;
        margin-bottom: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        align-self: center !important;
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        transform: none !important;
        width: auto !important;
    }
    
    /* Navbar collapse - contains menu items and language toggle */
    [dir="rtl"] .navbar-collapse {
        flex-direction: column !important;
        align-items: flex-start !important;
        order: 3 !important;
        width: 100% !important;
        margin-top: 1rem !important;
    }
    
    /* Language toggle should be at bottom */
    [dir="rtl"] .navbar-nav:last-child {
        order: 3 !important;
        margin-top: 1rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        align-self: flex-start !important;
    }
    
    /* Main menu items in middle */
    [dir="rtl"] .navbar-nav.me-auto {
        order: 2 !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        align-self: stretch !important;
    }
    
    [dir="rtl"] .navbar-nav.me-auto .nav-item {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }
    
    [dir="rtl"] .navbar-nav.me-auto .nav-link {
        text-align: right !important;
        padding: 0.75rem 1rem !important;
    }
}

/* Keep the original menu order, just change layout direction */
[dir="rtl"] .navbar-nav.me-auto {
    flex-direction: row;
    justify-content: flex-end;
}

[dir="rtl"] .navbar-nav.me-auto .nav-item {
    margin-left: 0;
    margin-right: 1rem;
}

[dir="rtl"] .navbar-nav.me-auto .nav-item:last-child {
    margin-right: 0;
}

/* RTL Logo Positioning */
[dir="rtl"] .navbar-brand {
    margin-right: 0;
    margin-left: auto;
}

/* RTL Language Toggle */
[dir="rtl"] .navbar-nav:last-child {
    margin-right: 0;
    margin-left: auto;
}

/* Navigation */
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, 0.95) !important;
    transition: var(--transition);
    border-bottom: 2px solid var(--primary-color);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.8rem;
}

/* PRIME Logo Styling */
.logo-text {
    display: flex;
    align-items: center;
    font-weight: 900;
    letter-spacing: -1px;
}

.logo-img {
    height: 50px;
    width: auto;
    max-width: 200px;
    background-color: var(--accent-color);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo-p, .logo-r {
    color: var(--accent-color);
}

.logo-1 {
    color: var(--primary-color);
    font-size: 1.2em;
    margin: 0 -2px;
}

/* Arabic logo styling for the alif in برايم */
.arabic-logo-alif {
    color: #b50612 !important;
    font-size: 1.2em;
    margin: 0 -2px;
    display: inline;
}

/* Override hero section color for Arabic logo alif */
.hero-section h1 span {
    color: #b50612 !important;
}

/* More specific override for Arabic alif */
.hero-section .display-4 span {
    color: #b50612 !important;
    font-size: 1.2em !important;
    margin: 0 -2px !important;
}

/* Even more specific for any span in hero h1 */
.hero-section h1.display-4.fw-bold.mb-4 span {
    color: #b50612 !important;
    font-size: 1.2em !important;
    margin: 0 -2px !important;
}

/* CSS for strong tag in hero h1 */
.hero-section h1 strong {
    color: #b50612 !important;
    font-size: 1.2em !important;
    margin: 0 -2px !important;
    font-weight: bold !important;
}

/* Most specific override for strong in hero h1 */
.hero-section h1.display-4.fw-bold.mb-4 strong {
    color: #b50612 !important;
    font-size: 1.2em !important;
    margin: 0 -2px !important;
    font-weight: bold !important;
}

/* CSS for mark tag in hero h1 */
.hero-section h1 mark {
    color: #b50612 !important;
    background: transparent !important;
    font-size: 1.2em !important;
    margin: 0 -2px !important;
    padding: 0 !important;
}

/* Most specific override for mark in hero h1 */
.hero-section h1.display-4.fw-bold.mb-4 mark {
    color: #b50612 !important;
    background: transparent !important;
    font-size: 1.2em !important;
    margin: 0 -2px !important;
    padding: 0 !important;
}

.logo-m {
    color: var(--accent-color);
    position: relative;
}

.logo-e {
    color: var(--accent-color);
    position: relative;
}

/* Connected M-E Design */
.logo-m::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -2px;
    width: 12px;
    height: 2px;
    background: var(--primary-color);
    transform: rotate(45deg);
}

.logo-e::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -2px;
    width: 12px;
    height: 2px;
    background: var(--primary-color);
}

.nav-link {
    position: relative;
    font-weight: 500;
    transition: var(--transition);
    color: var(--accent-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

/* Hero Section with Background Image */
.hero-section {
    background: url('images/homepagepic.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--accent-color);
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.90);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-image {
    animation: float 6s ease-in-out infinite;
    position: relative;
    display: inline-block;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, rgba(181, 6, 18, 0.1), rgba(0, 0, 0, 0.1));
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.hero-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(181, 6, 18, 0.05), rgba(0, 0, 0, 0.05));
    border-radius: 18px;
    z-index: 1;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    width: auto;
    border-radius: 15px;
    position: relative;
    z-index: 2;
    filter: brightness(1.1) contrast(1.1) saturate(1.1);
    transition: all 0.3s ease;
}

.hero-image:hover img {
    transform: scale(1.02);
    filter: brightness(1.2) contrast(1.2) saturate(1.2);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Cards */
.card {
    transition: var(--transition);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--light-gray);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(181, 6, 18, 0.15) !important;
    border-color: var(--primary-color);
}

.card-body {
    padding: 2rem;
}

/* Service Items */
.service-item {
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: var(--transition);
    margin-bottom: 1rem;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(181, 6, 18, 0.15);
}

.service-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--dark-red));
    border-radius: 50%;
    color: white;
}

.service-content h5 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Strength Numbers */
.strength-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--dark-red));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(181, 6, 18, 0.3);
}

/* Team and Leadership Photo Grids */
.team-photos-grid,
.leadership-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.team-photo-item,
.leadership-photo-item {
    text-align: center;
}

.team-photo-item img,
.leadership-photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.team-photo-item img:hover,
.leadership-photo-item img:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.2);
}

/* Coverage Map */
.coverage-map-container {
    position: relative;
    margin: 3rem 0;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.coverage-map-container img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 3px solid var(--accent-color);
    background: var(--accent-color);
    padding: 20px;
}

.coverage-map-container img:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(181, 6, 18, 0.2);
    border-color: var(--primary-color);
}

.coverage-map-container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    /* background: linear-gradient(135deg, var(--primary-color), var(--dark-red)); */
    border-radius: 25px;
    z-index: -1;
    opacity: 0.1;
}

/* Team and Leadership Photo Placeholders */
.team-photos-placeholder,
.leadership-photos-placeholder,
.coverage-map-placeholder {
    border: 2px dashed var(--primary-color);
    border-radius: 10px;
    transition: var(--transition);
    background-color: var(--light-red);
}

.team-photos-placeholder:hover,
.leadership-photos-placeholder:hover,
.coverage-map-placeholder:hover {
    border-color: var(--dark-red);
    background-color: rgba(181, 6, 18, 0.1);
}

/* Contact Section Enhancements */
.contact-office-card {
    transition: var(--transition);
}

.contact-office-card:hover {
    transform: translateY(-5px);
}

.contact-office-card .card-body {
    position: relative;
}

.contact-office-card .card-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--dark-red));
    border-radius: 2px;
}

/* Contact Form */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(181, 6, 18, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.75rem 2rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-red));
    border: none;
    box-shadow: 0 4px 15px rgba(181, 6, 18, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(181, 6, 18, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.btn-outline-light {
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.btn-outline-light:hover {
    background: var(--accent-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Social Links */
.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding-top: 100px;
    }
    
    .hero-image {
        margin-top: 2rem;
    }
    
    .service-item {
        text-align: center;
    }
    
    .service-icon {
        margin: 0 auto 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .strength-number {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .strength-number {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
.loading {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.loading.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-red);
}

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Remove focus outline from navigation links */
.nav-link:focus {
    outline: none;
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .social-links {
        display: none !important;
    }
    
    body {
        color: black;
        background: white;
    }
}

/* About Us Section - Title styling to match mission section */
#about h2.display-5 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

/* Typography - English (Verdana) */
body, p, span, div, li, a {
    font-family: 'Verdana', 'Tahoma', 'Geneva', sans-serif;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Verdana', 'Tahoma', 'Geneva', sans-serif;
    font-weight: 700;
}

/* Typography - Arabic (Tajwal) */
[dir="rtl"] body, [dir="rtl"] p, [dir="rtl"] span, [dir="rtl"] div, [dir="rtl"] li, [dir="rtl"] a {
    font-family: 'Tajawal', 'Arial', 'sans-serif';
    font-weight: 400;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    font-family: 'Tajawal', 'Arial', 'sans-serif';
    font-weight: 700;
}

/* Specific font weights for different elements */
.display-4, .display-5 {
    font-weight: 800;
}

[dir="rtl"] .display-4, [dir="rtl"] .display-5 {
    font-weight: 800;
}

.lead {
    font-weight: 400;
}

[dir="rtl"] .lead {
    font-weight: 400;
}

.nav-link {
    font-weight: 500;
}

[dir="rtl"] .nav-link {
    font-weight: 500;
}

.btn {
    font-weight: 600;
}

[dir="rtl"] .btn {
    font-weight: 600;
}
