:root {
    --primary-color: #00b4d8;
    --primary-dark: #0077b6;
    --secondary-color: #caf0f8;
    --accent-color: #03045e;
    --text-color: #333;
    --text-light: #666;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-dark: #1a1a2e;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.1);
    --font-main: 'Cairo', sans-serif;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-white);
    overflow-x: hidden;
}

/* Utilities */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 180, 216, 0.3);
    border: none;
    padding: 14px 32px;
    /* Compensate for 2px border removal */
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 180, 216, 0.4);
}

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

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-lg {
    padding: 15px 40px;
    font-size: 1.1rem;
}

.btn-xl {
    padding: 18px 50px;
    font-size: 1.3rem;
    border-radius: 10px;
}

.section-padding {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.bg-dark {
    background-color: var(--bg-dark);
}

.text-white {
    color: white;
}

/* Header */
.main-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: var(--transition);
}

.main-nav a:hover {
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    position: relative;
    padding-top: 180px;
    /* Header height + spacing */
    padding-bottom: 100px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    align-items: center;
    background-image: url('../images/hero_bg.png');
    /* Use local image */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.7) 100%);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--bg-dark);
}

.hero-title .highlight {
    color: var(--primary-color);
    position: relative;
    z-index: 1;
}

.hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 0;
    width: 100%;
    height: 15px;
    background-color: var(--secondary-color);
    z-index: -1;
    opacity: 0.6;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
    max-width: 90%;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

/* Physical ID Card Design */
.id-card-physical {
    position: relative;
    width: 340px;
    height: 240px;
    /* Increased height to fit content */
    background: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%);
    border-radius: 12px;
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.08),
        0 15px 35px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: rotate(-5deg);
    overflow: hidden;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    /* Standard card font usually sans */
}

.card-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Guilloche pattern simulation for security feel */
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 180, 216, 0.03) 10px, rgba(0, 180, 216, 0.03) 11px),
        radial-gradient(circle at 10% 10%, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 15px 15px;
    z-index: 0;
}

.card-header-strip {
    position: absolute;
    top: 0;
    left: 0;
    width: 30%;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-dark), var(--primary-color));
    z-index: 1;
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%);
}

.card-content {
    position: relative;
    z-index: 2;
    padding: 25px 20px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-top {
    display: flex;
    flex-direction: column;
    width: 90px;
    /* Aligned with the strip roughly */
    align-items: center;
    text-align: center;
    margin-bottom: 0;
    margin-right: -10px;
    /* Offset to sit in blue strip */
    color: var(--primary-dark);
    z-index: 3;
}

.card-logo-icon {
    font-size: 2rem;
    margin-bottom: 5px;
    color: var(--primary-dark);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.card-header-text {
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-body-flex {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.photo-section {
    flex-shrink: 0;
}

.photo-frame {
    width: 85px;
    height: 85px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 2.5rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.info-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 15px;
}

.card-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--bg-dark);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.card-title {
    font-size: 0.8rem;
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-id-row {
    font-size: 0.7rem;
    color: #64748b;
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: block;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.id-label {
    color: #94a3b8;
    margin-left: 0;
    margin-right: 5px;
}

.card-footer-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.chip-sim {
    width: 40px;
    height: 30px;
    background: linear-gradient(135deg, #e0cba8 0%, #d4af37 50%, #e0cba8 100%);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    border: 1px solid #bba570;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

.chip-line {
    position: absolute;
    background: rgba(0, 0, 0, 0.15);
}

.chip-line:nth-child(1) {
    width: 100%;
    height: 1px;
    top: 33%;
}

.chip-line:nth-child(2) {
    width: 100%;
    height: 1px;
    top: 66%;
}

.chip-line:nth-child(3) {
    width: 1px;
    height: 100%;
    left: 50%;
}

.verified-badge-phys {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 800;
    border: none;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 119, 182, 0.1);
}

/* Update animation to retain float but remove old styles if any */
@keyframes float {
    0% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-10px) rotate(-5deg);
    }

    100% {
        transform: translateY(0) rotate(-5deg);
    }
}

.float-anim {
    animation: float 6s ease-in-out infinite;
}

/* About & Features */
.section-header {
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--bg-dark);
    margin-bottom: 15px;
}

.bg-dark .section-header h2 {
    color: white;
}

.divider {
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 0 auto;
    border-radius: 2px;
}

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

.feature-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
    border-top: 5px solid transparent;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-top-color: var(--primary-color);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background-color: var(--secondary-color);
    color: var(--primary-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 25px;
}

.feature-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* Audience */
.audience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.audience-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.audience-card h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.audience-card ul li {
    list-style: none;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.audience-card i {
    color: var(--primary-color);
}

.highlight-card {
    background: linear-gradient(135deg, rgba(3, 4, 94, 0.8), rgba(0, 119, 182, 0.6));
    border-color: var(--primary-dark);
}

/* How It Works */
.steps-container {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
    position: relative;
}

.steps-container::before {
    content: '';
    position: absolute;
    top: 40px;
    right: 50px;
    left: 50px;
    height: 2px;
    background-color: var(--secondary-color);
    z-index: 0;
    display: none;
    /* Hidden on mobile */
}

@media(min-width: 992px) {
    .steps-container::before {
        display: block;
    }
}

.step-item {
    flex: 1;
    min-width: 250px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 80px;
    height: 80px;
    background-color: white;
    border: 3px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    margin: 0 auto 25px;
    box-shadow: var(--shadow-md);
}

.step-content h3 {
    margin-bottom: 15px;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('hero_bg.png');
    background-size: cover;
    background-attachment: fixed;
    padding: 100px 0;
    color: white;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    line-height: 1.4;
}

/* Footer */
.main-footer {
    padding: 40px 0;
    background-color: var(--bg-white);
    border-top: 1px solid #eee;
    color: var(--text-light);
}

.footer-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 991px) {
    .hero-section {
        padding-top: 120px;
        text-align: center;
    }

    .hero-section .container {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        justify-content: center;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        padding: 20px;
        box-shadow: var(--shadow-md);
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .header-actions {
        display: none;
        /* Simplify header for mobile, maybe move to nav menu */
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .section-header h2 {
        font-size: 2rem;
    }
}

/* Legal Pages Styling */
.legal-content .container {
    max-width: 900px;
    /* Narrower width for reading */
    background: #fff;
    padding: 60px 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-top: 40px;
    margin-bottom: 40px;
}

.legal-content h1 {
    font-size: 2.2rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
    text-align: center;
}

.last-updated {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 50px;
    font-size: 0.9rem;
}

.legal-content h2 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-top: 40px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    display: inline-block;
}

.legal-content h3 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-top: 25px;
    margin-bottom: 15px;
}

.legal-content p {
    margin-bottom: 15px;
    text-align: justify;
}

.legal-content ul {
    margin-bottom: 20px;
    padding-right: 20px;
}

.legal-content li {
    margin-bottom: 8px;
}

.info-box,
.warning-box,
.danger-box {
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border-right: 4px solid;
}

.info-box {
    background-color: #e3f9ff;
    border-color: var(--primary-color);
}

.warning-box {
    background-color: #fff8e1;
    border-color: #ffc107;
}

.danger-box {
    background-color: #ffebee;
    border-color: #f44336;
}

.contact-section {
    background-color: var(--bg-light);
    padding: 30px;
    border-radius: 10px;
    margin-top: 50px;
    text-align: center;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    border: 1px solid #eee;
    text-align: right;
}

.data-table th {
    background-color: var(--bg-light);
    color: var(--primary-dark);
    font-weight: 700;
}

/* Footer Legal Links */
.footer-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.footer-legal-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-legal-link:hover {
    color: var(--primary-color);
}

.footer-divider {
    color: #ddd;
}

/* Language Switcher UI */
.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    border: 1px solid var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: var(--font-main);
    font-size: 0.9rem;
    margin-right: 15px;
    /* Default RTL spacing */
}

.lang-switch:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.lang-switch i {
    font-size: 1rem;
}

/* LTR Overrides & Card Fixes */
html[dir="ltr"] .lang-switch {
    margin-right: 0;
    margin-left: 15px;
    /* LTR spacing */
}

/* ID Card Standardized Layout (English matches Arabic Shape) */
html[dir="ltr"] .id-card-physical {
    font-family: 'Inter', sans-serif;
}

/* 1. Strip and Badge on Left (Same as Arabic) */
html[dir="ltr"] .card-header-strip {
    left: 0;
    right: auto;
    transform: none;
}

html[dir="ltr"] .verified-badge-phys {
    left: 20px;
    right: auto;
}

/* 2. Logo on Right - push using auto margin */
html[dir="ltr"] .card-top {
    margin-left: auto;
    margin-right: 0;
}

/* 3. Photo on Right, Text on Left - with proper margin to avoid blue strip */
html[dir="ltr"] .card-body-flex {
    flex-direction: row-reverse;
}

html[dir="ltr"] .info-section {
    text-align: left;
    padding-left: 0;
    padding-right: 0;
    margin-left: 35%;
    /* Push text to the right, away from the 30% width blue strip */
}

/* 4. Chip on Right - push to the right side AND ensure footer is at bottom */
html[dir="ltr"] .card-footer-flex {
    justify-content: flex-end;
    /* Push chip to the right */
    margin-top: auto;
    /* Push footer to the bottom of the flex column */
}

/* 5. Reduce English font sizes to match Arabic visual proportions */
html[dir="ltr"] .card-name {
    font-size: 1rem;
    /* Smaller than Arabic 1.2rem */
}

html[dir="ltr"] .card-title {
    font-size: 0.65rem;
    /* Smaller to match */
}

html[dir="ltr"] .card-header-text {
    font-size: 0.75rem;
    /* Smaller header text */
}

/* Ensure table text align flips */
html[dir="ltr"] .data-table th,
html[dir="ltr"] .data-table td {
    text-align: left;
}

/* 6. Fix chip visibility in LTR - add right margin to push away from edge */
/* 6. Fix chip visibility in LTR - Use Absolute Positioning to force it visible */
html[dir="ltr"] .chip-sim {
    position: absolute;
    bottom: 20px;
    right: 20px;
    margin-right: 0;
    z-index: 10;
}

/* 7. Fix Verified badge - make smaller and position deeper in blue strip */
html[dir="ltr"] .verified-badge-phys {
    left: 8px;
    /* Move more into the blue area */
    font-size: 0.6rem;
    /* Smaller font */
    padding: 3px 8px;
    /* Smaller padding */
}