/* Root Variables and Font Settings */
:root {
    --primary-color: #2c5aa0;
    --secondary-color: #f39c12;
    --accent-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-gray: #ecf0f1;
    --text-color: #34495e;
    --border-color: #bdc3c7;

    /* Font Variables */
    --font-arabic: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-english: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Base Font Settings */
body {
    font-family: var(--font-english);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

/* Arabic Language Support */
html[lang="ar"],
html[lang="ar"] body,
html[lang="ar"] .card,
html[lang="ar"] .btn,
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] p,
html[lang="ar"] span,
html[lang="ar"] div,
html[lang="ar"] .navbar-brand,
html[lang="ar"] .nav-link,
html[lang="ar"] .dropdown-item,
html[lang="ar"] .form-control,
html[lang="ar"] .form-label,
html[lang="ar"] .btn {
    font-family: var(--font-arabic) !important;
    font-weight: 400;
}

/* English Language Support */
html[lang="en"],
html[lang="en"] body,
html[lang="en"] .card,
html[lang="en"] .btn,
html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] h4,
html[lang="en"] h5,
html[lang="en"] h6,
html[lang="en"] p,
html[lang="en"] span,
html[lang="en"] div,
html[lang="en"] .navbar-brand,
html[lang="en"] .nav-link,
html[lang="en"] .dropdown-item,
html[lang="en"] .form-control,
html[lang="en"] .form-label,
html[lang="en"] .btn {
    font-family: var(--font-english) !important;
}

/* Arabic Headings - Bold Weight */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6 {
    font-weight: 700 !important;
}

/* English Headings - Bold Weight */
html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] h4,
html[lang="en"] h5,
html[lang="en"] h6 {
    font-weight: 600 !important;
}

/* Additional Styles for X-Elevator RFID Landing Page */

/* Enhanced animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Loading animation for page */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Enhanced hero section */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
    width: 10px;
    height: 10px;
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    width: 15px;
    height: 15px;
    left: 20%;
    animation-delay: 1s;
}

.particle:nth-child(3) {
    width: 8px;
    height: 8px;
    left: 30%;
    animation-delay: 2s;
}

.particle:nth-child(4) {
    width: 12px;
    height: 12px;
    left: 40%;
    animation-delay: 3s;
}

.particle:nth-child(5) {
    width: 18px;
    height: 18px;
    left: 50%;
    animation-delay: 4s;
}

.particle:nth-child(6) {
    width: 6px;
    height: 6px;
    left: 60%;
    animation-delay: 5s;
}

.particle:nth-child(7) {
    width: 14px;
    height: 14px;
    left: 70%;
    animation-delay: 6s;
}

.particle:nth-child(8) {
    width: 11px;
    height: 11px;
    left: 80%;
    animation-delay: 7s;
}

.particle:nth-child(9) {
    width: 16px;
    height: 16px;
    left: 90%;
    animation-delay: 8s;
}

/* Enhanced feature cards */
.feature-card-enhanced {
    position: relative;
    overflow: hidden;
}

.feature-card-enhanced::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(9, 132, 227, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.feature-card-enhanced:hover::before {
    opacity: 1;
    transform: rotate(45deg) translateX(100%);
}

/* Progress indicators */
.progress-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid #eee;
    border-top: 4px solid var(--primary-color);
    position: relative;
    margin: 0 auto 15px;
}

.progress-circle::after {
    content: attr(data-percent);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--primary-color);
}

/* Statistics counters */
.stat-counter {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    font-size: 1.1rem;
    color: #666;
    margin-top: 10px;
}

/* Enhanced testimonials */
.testimonial-carousel {
    position: relative;
}

.testimonial-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.testimonial-nav:hover {
    background: var(--accent-color);
    color: var(--dark-color);
    transform: translateY(-50%) scale(1.1);
}

.testimonial-nav.prev {
    left: -25px;
}

.testimonial-nav.next {
    right: -25px;
}

/* Enhanced modal */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: var(--gradient);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Form enhancements */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(9, 132, 227, 0.25);
}

.form-floating>label {
    color: #666;
}

.form-floating>.form-control:focus~label,
.form-floating>.form-control:not(:placeholder-shown)~label {
    color: var(--primary-color);
}

/* Success messages */
.alert-success-custom {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.2);
    color: #155724;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

/* Loading states */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1030;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--accent-color);
    color: var(--dark-color);
    transform: translateY(-3px);
}

/* RTL Adjustments */
[dir="rtl"] .scroll-to-top {
    right: auto;
    left: 30px;
}

/* Print styles */
@media print {

    .language-switcher,
    .sticky-cta,
    .scroll-to-top,
    .hero-section,
    .video-section {
        display: none !important;
    }

    body {
        color: black !important;
        background: white !important;
    }

    .section-padding {
        padding: 20px 0 !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0066cc;
        --accent-color: #ff6600;
        --dark-color: #000000;
    }

    .feature-card,
    .use-case-card,
    .testimonial-card,
    .download-card {
        border: 2px solid var(--dark-color);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-icon {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #333;
        --dark-color: #f8f9fa;
    }

    body {
        background: #1a1a1a;
        color: #f8f9fa;
    }

    .feature-card,
    .use-case-card,
    .testimonial-card,
    .download-card {
        background: #2d2d2d;
        color: #f8f9fa;
    }

    .modal-content {
        background: #2d2d2d;
        color: #f8f9fa;
    }
}

/* Critical Font Loading - Ensure Cairo loads for Arabic */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

/* Explicit font definitions for better compatibility */
.arabic-text,
[lang="ar"],
[dir="rtl"] {
    font-family: 'Cairo', 'Segoe UI Arabic', 'Tahoma', sans-serif !important;
}

.english-text,
[lang="en"],
[dir="ltr"] {
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Force font application on language switch */
body.rtl-mode,
body.rtl-mode * {
    font-family: 'Cairo', 'Segoe UI Arabic', 'Tahoma', sans-serif !important;
}

body.ltr-mode,
body.ltr-mode * {
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Specific elements that need font override */
.navbar-brand,
.nav-link,
.btn,
.card-title,
.card-text,
.section-title,
.hero-title,
.hero-subtitle {
    font-family: inherit !important;
}

/* Enhanced Products Section Styles - Old Style (Commented Out)
.product-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
    height: 100%;
    position: relative;
    border: 1px solid rgba(9, 132, 227, 0.1);
}

.product-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 50px rgba(9, 132, 227, 0.25);
    border-color: var(--primary-color);
}

.product-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}
*/

/*
.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 8px 15px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(9, 132, 227, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.product-content {
    padding: 25px;
}

.product-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--dark-color);
    line-height: 1.3;
}

.product-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.7;
    font-size: 0.95rem;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.feature-tag {
    background: linear-gradient(135deg, rgba(9, 132, 227, 0.1), rgba(116, 185, 255, 0.1));
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(9, 132, 227, 0.2);
    transition: all 0.3s ease;
}

.product-card:hover .feature-tag {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    transform: translateY(-2px);
}

.product-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
}

.view-details {
    position: relative;
    overflow: hidden;
}

.view-details::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

.product-card:hover .view-details::after {
    width: 100%;
}

.product-action i {
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.product-card:hover .product-action i {
    transform: translateX(8px);
    color: var(--accent-color);
}
*/

/* RTL Support for Enhanced Products - Old Style (Commented Out)
[dir="rtl"] .product-action i {
    transform: scaleX(-1);
}

[dir="rtl"] .product-card:hover .product-action i {
    transform: scaleX(-1) translateX(-8px);
    color: var(--accent-color);
}
*/

/*
[dir="rtl"] .product-badge {
    right: auto;
    left: 15px;
}

/* Mobile Responsiveness for Products */
/*@media (max-width: 768px) {
    .product-card {
        margin-bottom: 20px;
    }

    .product-image {
        height: 200px;
    }

    .product-content {
        padding: 20px;
    }

    .product-title {
        font-size: 1.2rem;
    }

    .product-features {
        gap: 8px;
        margin-bottom: 20px;
    }

    .feature-tag {
        font-size: 0.8rem;
        padding: 5px 12px;
    }
}*/

/* Products Section Background Enhancement */
#products {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    position: relative;
}

#products::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23ffffff" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

/* Product Cards - Feature Style */
.product-card-feature {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    border: 3px solid transparent;
    cursor: pointer;
    position: relative;
}

.product-card-feature:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.product-icon {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(9, 132, 227, 0.1);
    transition: all 0.3s ease;
}

.product-icon img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.product-card-feature:hover .product-icon {
    transform: scale(1.1);
    background: rgba(9, 132, 227, 0.2);
    box-shadow: 0 10px 30px rgba(9, 132, 227, 0.3);
}

.product-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(9, 132, 227, 0.4);
    z-index: 2;
    animation: pulse 2s infinite;
}

.product-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.product-text {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Special Colors for Product Icons */
.product-card-feature:nth-child(1) .product-icon {
    background: linear-gradient(135deg, rgba(9, 132, 227, 0.1), rgba(9, 132, 227, 0.2));
}

.product-card-feature:nth-child(1):hover .product-icon {
    background: linear-gradient(135deg, rgba(9, 132, 227, 0.2), rgba(9, 132, 227, 0.3));
    box-shadow: 0 10px 30px rgba(9, 132, 227, 0.3);
}

.product-card-feature:nth-child(2) .product-icon {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(39, 174, 96, 0.2));
}

.product-card-feature:nth-child(2):hover .product-icon {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.2), rgba(39, 174, 96, 0.3));
    box-shadow: 0 10px 30px rgba(39, 174, 96, 0.3);
}

.product-card-feature:nth-child(3) .product-icon {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(231, 76, 60, 0.2));
}

.product-card-feature:nth-child(3):hover .product-icon {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.2), rgba(231, 76, 60, 0.3));
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.3);
}

.product-card-feature:nth-child(4) .product-icon {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.1), rgba(155, 89, 182, 0.2));
}

.product-card-feature:nth-child(4):hover .product-icon {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(155, 89, 182, 0.3));
    box-shadow: 0 10px 30px rgba(155, 89, 182, 0.3);
}

/* Product Badge Colors */
.product-card-feature:nth-child(1) .product-badge {
    background: linear-gradient(135deg, #0984e3, #74b9ff);
}

.product-card-feature:nth-child(2) .product-badge {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.product-card-feature:nth-child(3) .product-badge {
    background: linear-gradient(135deg, #e74c3c, #e67e22);
}

.product-card-feature:nth-child(4) .product-badge {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

/* RTL Support for Product Cards */
[dir="rtl"] .product-badge {
    right: auto;
    left: -8px;
}

/* Mobile Responsiveness for Product Cards */
@media (max-width: 768px) {
    .product-card-feature {
        margin-bottom: 20px;
        padding: 1.5rem;
    }

    .product-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 1rem;
    }

    .product-icon img {
        width: 60px;
        height: 60px;
    }

    .product-title {
        font-size: 1.1rem;
    }

    .product-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .product-card-feature {
        padding: 1.2rem;
    }

    .product-icon {
        width: 70px;
        height: 70px;
    }

    .product-icon img {
        width: 50px;
        height: 50px;
    }
}

/* Product Card Links */
.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
}

.product-card-link:hover {
    transform: translateY(-5px);
    text-decoration: none;
    color: inherit;
}

.product-card-link:hover .product-card-feature {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.product-card-link:focus {
    outline: none;
    text-decoration: none;
    color: inherit;
}