/* CSS Variables */
:root {
    --blue: #3D46C6;
    --indigo: #292E7A;
    --gold: #C89B3C;
    --slate: #2B2F36;
    --silver: #E9EAED;
    --white: #FFFFFF;
    
    /* Typography */
    --font-heading: "Agency FB", "Oswald", Arial, sans-serif;
    --font-body: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    
    /* Spacing */
    --container-max: 1180px;
    --gutter: 24px;
    --section-padding: 80px 0;
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--slate);
    background: var(--white);
    line-height: 1.6;
    font-size: 16px;
}

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* Language Toggle */
.language-toggle {
    background: var(--white);
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 6px;
    display: flex;
    gap: 4px;
    margin-left: 16px;
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.whatsapp-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: var(--white);
    padding: 12px 16px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.whatsapp-btn:hover {
    background: #20BA5A;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.whatsapp-text {
    white-space: nowrap;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    }
    50% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.6);
    }
    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    }
}

.lang-link {
    padding: 6px 12px;
    text-decoration: none;
    color: var(--slate);
    border-radius: 20px;
    font-weight: 500;
    transition: var(--transition);
    font-size: 13px;
}

.lang-link.active,
.lang-link:hover {
    background: var(--blue);
    color: var(--white);
}

/* Language Sections */
.language-section {
    display: none;
}

.language-section:target {
    display: block;
}

#en:target ~ #ar,
#ar:target ~ #en {
    display: none;
}

/* Default to English */
#en {
    display: block;
}

#ar {
    display: none;
}

#ar:target {
    display: block;
}

/* RTL Support */
.rtl {
    direction: rtl;
    text-align: right;
}

.rtl .container {
    text-align: right;
}

.rtl .header-content {
    flex-direction: row-reverse;
}

.rtl .hero-cta {
    flex-direction: row-reverse;
}

.rtl .contact-content {
    flex-direction: row-reverse;
}

.rtl .about-content {
    flex-direction: row-reverse;
}

.rtl .licenses-content {
    flex-direction: row-reverse;
}

.rtl .footer-content {
    flex-direction: row-reverse;
}

/* Buttons */
.btn-primary,
.btn-outline {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    min-width: 140px;
}

.btn-primary {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--indigo);
    border-color: var(--indigo);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(61, 70, 198, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border-color: var(--gold);
}

.btn-outline:hover,
.btn-outline:focus {
    background: var(--gold);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 155, 60, 0.3);
}

/* Top Bar */
.top-bar {
    background: var(--slate);
    color: var(--white);
    padding: 8px 0;
    font-size: 14px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.contact-info {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.contact-info span {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.logo img {
    height: 50px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

/* Navigation */
.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle-label span {
    width: 25px;
    height: 3px;
    background: var(--slate);
    margin: 3px 0;
    transition: var(--transition);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--slate);
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 0;
}

.nav-menu a:hover {
    color: var(--blue);
}

.nav-menu .btn-primary {
    margin-left: 16px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--silver) 0%, rgba(233, 234, 237, 0.8) 100%);
    padding: var(--section-padding);
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.hero-video iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw; /* 16:9 aspect ratio */
    min-height: 100vh;
    min-width: 177.77vh; /* 16:9 aspect ratio */
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--indigo) 0%, var(--blue) 50%, var(--slate) 100%);
    z-index: -1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(61, 70, 198, 0.05) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    color: var(--white);
}

.hero-badge {
    display: inline-block;
    background: var(--gold);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--white);
    margin-bottom: 24px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 32px;
    color: var(--white);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Mobile Video Section */
.mobile-video-section {
    display: none;
    padding: var(--section-padding);
    background: var(--silver);
    text-align: center;
}

.mobile-video-section h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--indigo);
    margin-bottom: 32px;
}

.video-container {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    aspect-ratio: 16/9;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Trust Row */
.trust-row {
    background: var(--white);
    padding: 40px 0;
    border-bottom: 1px solid rgba(41, 46, 122, 0.12);
}

.trust-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
}

.badge {
    background: var(--silver);
    color: var(--slate);
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid rgba(41, 46, 122, 0.1);
}

/* Services */
.services {
    padding: var(--section-padding);
    background: var(--white);
}

.services h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--indigo);
    text-align: center;
    margin-bottom: 48px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.service-card {
    background: var(--white);
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: var(--transition);
    border-top: 3px solid transparent;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-top-color: var(--gold);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--indigo);
    margin-bottom: 16px;
}

.service-card p {
    color: var(--slate);
    line-height: 1.6;
}

/* Sectors */
.sectors {
    padding: var(--section-padding);
    background: var(--silver);
}

.sectors h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--indigo);
    text-align: center;
    margin-bottom: 48px;
}

.sectors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.sector-tile {
    background: var(--white);
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: var(--slate);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: var(--transition);
}

.sector-tile:hover {
    background: var(--blue);
    color: var(--white);
    transform: translateY(-4px);
}

/* Why SAFE */
.why-safe {
    padding: var(--section-padding);
    background: var(--white);
}

.why-safe h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--indigo);
    text-align: center;
    margin-bottom: 48px;
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 48px;
}

.why-item {
    text-align: center;
}

.why-icon {
    font-size: 3rem;
    margin-bottom: 24px;
}

.why-item h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--indigo);
    margin-bottom: 16px;
}

.why-item p {
    color: var(--slate);
    line-height: 1.6;
}

/* Licenses */
.licenses {
    padding: var(--section-padding);
    background: var(--silver);
}

.licenses-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
    align-items: center;
}

.licenses h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--indigo);
    margin-bottom: 24px;
}

.licenses p {
    font-size: 1.1rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.license-badge {
    display: flex;
    justify-content: center;
    align-items: center;
}

.badge-stamp {
    background: var(--gold);
    color: var(--white);
    padding: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 8px 24px rgba(200, 155, 60, 0.3);
    transform: rotate(-15deg);
}

/* Callout Banner */
.callout-banner {
    background: var(--blue);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.banner-content h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 24px;
}

.callout-banner .btn-primary {
    background: var(--gold);
    border-color: var(--gold);
}

.callout-banner .btn-primary:hover {
    background: var(--white);
    color: var(--gold);
    border-color: var(--white);
}

/* About */
.about {
    padding: var(--section-padding);
    background: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.about h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--indigo);
    margin-bottom: 24px;
}

.about p {
    margin-bottom: 16px;
    line-height: 1.6;
}

.image-placeholder {
    background: var(--silver);
    height: 300px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate);
    font-weight: 600;
    border: 2px dashed var(--gold);
}

.team-photo {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.team-photo:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

/* Careers */
.careers {
    padding: var(--section-padding);
    background: var(--silver);
    text-align: center;
}

.careers h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--indigo);
    margin-bottom: 24px;
}

.careers p {
    font-size: 1.1rem;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Contact */
.contact {
    padding: var(--section-padding);
    background: var(--white);
}

.contact h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--indigo);
    text-align: center;
    margin-bottom: 48px;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--silver);
    border-radius: 8px;
    font-size: 16px;
    font-family: var(--font-body);
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 155, 60, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-details h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--indigo);
    margin-bottom: 24px;
}

.contact-item {
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--silver);
}

.contact-item strong {
    color: var(--indigo);
    display: inline-block;
    min-width: 100px;
}

.contact-item a {
    color: var(--blue);
    text-decoration: none;
    transition: var(--transition);
}

.contact-item a:hover {
    color: var(--gold);
    text-decoration: underline;
}

.contact-item.availability {
    background: var(--silver);
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
    border-left: 4px solid var(--gold);
}

.contact-item.availability strong {
    color: var(--gold);
    min-width: auto;
}

.map-placeholder {
    margin-top: 32px;
}

.map-box {
    background: var(--silver);
    height: 200px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate);
    font-weight: 600;
    border: 2px dashed var(--gold);
}

/* Footer */
.footer {
    background: var(--slate);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo img {
    height: 40px;
    width: auto;
    max-width: 180px;
    margin-bottom: 16px;
    object-fit: contain;
}

.footer h4 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--gold);
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 8px;
}

.footer a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--gold);
}

.social-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --gutter: 16px;
        --section-padding: 60px 0;
    }
    
    .hero {
        height: 40vh;
    }
    
    .mobile-video-section {
        display: block;
    }
    
    .nav-toggle-label {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }
    
    .nav-toggle:checked ~ .nav-menu {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .nav-menu .btn-primary {
        margin-left: 0;
        margin-top: 16px;
    }
    
    .language-toggle {
        margin-left: 0;
        margin-top: 16px;
        align-self: center;
    }
    
    .top-bar-content {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-info {
        justify-content: center;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .sectors-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .why-grid {
        grid-template-columns: 1fr;
    }
    
    .licenses-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .lang-link {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .whatsapp-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .whatsapp-text {
        display: none;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .services h2,
    .sectors h2,
    .why-safe h2,
    .licenses h2,
    .about h2,
    .contact h2,
    .careers h2 {
        font-size: 2rem;
    }
    
    .trust-badges {
        gap: 12px;
    }
    
    .badge {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    .language-toggle,
    .top-bar,
    .nav,
    .hero-cta,
    .callout-banner,
    .footer {
        display: none;
    }
    
    .hero {
        background: none;
        padding: 20px 0;
    }
    
    .hero h1 {
        color: var(--slate);
        font-size: 2rem;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .services,
    .sectors,
    .why-safe,
    .about,
    .contact {
        padding: 20px 0;
        break-inside: avoid;
    }
    
    .contact-details {
        background: var(--silver);
        padding: 20px;
        border-radius: 8px;
    }
    
    .footer-logo {
        display: block;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .footer-logo img {
        height: 60px;
        max-width: 250px;
    }
    
    a {
        text-decoration: none;
        color: var(--slate);
    }
    
    .btn-primary,
    .btn-outline {
        border: 1px solid var(--slate);
        background: none;
        color: var(--slate);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .whatsapp-btn {
        animation: none;
    }
}

/* Focus Styles */
.btn-primary:focus,
.btn-outline:focus,
input:focus,
textarea:focus,
a:focus,
.whatsapp-btn:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --blue: #0000FF;
        --indigo: #000080;
        --gold: #FFD700;
        --slate: #000000;
        --silver: #C0C0C0;
        --white: #FFFFFF;
    }
    
    .service-card,
    .sector-tile {
        border: 2px solid var(--slate);
    }
}

/* Comments for customization */
/*
To customize contact information:
1. Replace +961 70 000 000 with actual phone number
2. Replace info@safeco.example with actual email
3. Replace "Tripoli, North Lebanon" with actual address
4. Update WhatsApp number if different from phone
5. Replace careers@safeco.example with actual careers email

To add actual logo:
1. Replace the SVG data URLs in logo img src attributes
2. Update alt text accordingly
3. Adjust logo height in CSS if needed

To add real map:
1. Replace .map-box placeholder with actual map embed
2. Update .map-placeholder styling as needed

To add social media links:
1. Replace # placeholders in footer social links
2. Add actual social media URLs

To add PDF downloads:
1. Replace # placeholders in download links
2. Upload actual PDF files and update href attributes
*/
