/* ------------------- */
/* Custom Properties   */
/* ------------------- */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #555;
    --accent-color: #0066cc;
    --background-light: #f5f5f5;
    --background-white: #ffffff;
    --text-color: #333;
    --text-light: #ffffff;
    --border-color: #ddd;
    
    --font-primary: 'Segoe UI', 'Trebuchet MS', sans-serif;
    --font-secondary: 'Segoe UI', 'Trebuchet MS', sans-serif;
}

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

img {
    max-width: 100%;
    height: auto;
}

iframe {
    max-width: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    font-family: var(--font-secondary);
    line-height: 1.3;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

h1 { font-size: 3rem; font-weight: 700; }
h2 { font-size: 2.5rem; font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }

p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0052a3;
}

/* ------------------- */
/* Navigation         */
/* ------------------- */
.navbar {
    background: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    flex: 1;
    justify-content: center;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* ------------------- */
/* Language Switcher   */
/* ------------------- */
.language-switcher {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.lang-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.lang-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* ------------------- */
/* RTL/LTR Layout      */
/* ------------------- */
html[lang="en"] {
    direction: ltr;
    text-align: left;
}

html[lang="en"] .container {
    direction: ltr;
    text-align: left;
}

html[lang="en"] .nav-menu {
    flex-direction: row;
}

html[lang="en"] .navbar-container {
    direction: ltr;
}

html[lang="en"] .language-switcher {
    margin-right: 0;
    margin-left: auto;
}

/* Language Visibility Utilities */
html[lang="he"] .lang-en { display: none !important; }
html[lang="en"] .lang-he { display: none !important; }

html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] h4,
html[lang="en"] p {
    text-align: left;
}

html[lang="en"] .about h2,
html[lang="en"] .services h2,
html[lang="en"] .edge-title,
html[lang="en"] .contact h2 {
    text-align: left;
}

html[lang="en"] .hero-content {
    text-align: center;
}

html[lang="en"] .hero-content h1,
html[lang="en"] .hero-content p {
    text-align: center;
}

html[lang="en"] .about-content p {
    text-align: left;
    color: #fff;
}

html[lang="en"] .service-card,
html[lang="en"] .advantage-card {
    text-align: left;
}

html[lang="en"] .footer-content {
    direction: ltr;
    text-align: left;
}

html[lang="en"] .footer-section h4,
html[lang="en"] .footer-section p,
html[lang="en"] .footer-section ul {
    text-align: left;
}

html[lang="en"] .contact {
    text-align: left;
}

html[lang="en"] .form-group input,
html[lang="en"] .form-group textarea {
    text-align: left;
}

/* ------------------- */
/* Hero Section       */
/* ------------------- */
.hero {
    background: #ffffff;
    color: var(--text-color);
    padding: 8rem 0;
    text-align: center;
}

.hero-content h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 3.5rem;
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: #fff;
    padding: 15px 40px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,102,204,0.3);
}

.cta-button.secondary {
    background-color: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.cta-button.secondary:hover {
    background-color: var(--accent-color);
    color: #fff;
}

.hero-image-placeholder {
    width: 100%;
    max-width: 200px;
    margin: 0 auto 3rem auto;
    position: relative;
}

.hero-image-placeholder img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.hero-image-placeholder-box {
    width: 100%;
    aspect-ratio: 16/9;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    font-weight: 500;
}

/* ------------------- */
/* About Section      */
/* ------------------- */
.about {
    padding: 5rem 0;
    background: #1a1a1a;
    color: #fff;
}

.about .container {
    display: flex;
    gap: 2rem;
    align-items: stretch;
}

.about h2 {
    text-align: right;
    margin-bottom: 3rem;
    color: #fff;
}

.about-wrapper {
    display: flex;
    gap: 2rem;
    align-items: stretch;
    flex: 1;
    width: 100%;
}

.about-text {
    flex: 0 0 45%;
}

.about-text h2 {
    text-align: right;
    margin-bottom: 1.5rem;
    color: #fff;
}

.about-text p {
    text-align: justify;
    margin-bottom: 1.5rem;
    line-height: 1.9;
}

.about-image {
    position: relative;
    flex: 0 0 55%;
}

.about-image img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: block;
    object-fit: cover;
}

/* ------------------- */
/* Services Section   */
/* ------------------- */
.services {
    padding: 5rem 0;
    background: linear-gradient(to right, #d9d9d9 0%, #ffffff 100%);
    position: relative;
}

.services h2 {
    text-align: right;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

/* ------------------- */
/* Our Edge Section   */
/* ------------------- */
.edge {
    padding: 5rem 0;
    background: url('images/analytics-bg.jpg') center/cover no-repeat;
    position: relative;
}

.edge-title {
    text-align: right;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.edge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.service-card,
.advantage-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
    text-align: center;
    position: relative;
    opacity: 0;
    transform: perspective(1000px) rotateX(90deg) translateY(50px);
}

.service-card.visible,
.advantage-card.visible {
    opacity: 1;
    transform: perspective(1000px) rotateX(0) translateY(0);
}

.service-card:hover,
.advantage-card:hover {
    transform: scale(1.25);
    z-index: 10;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.service-card-image {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
}

.data-driven-img,
.forecast-img,
.menu-img,
.process-img,
.consult-img,
.startup-img {
    width: 100%;
    opacity: 0.6;
    margin-top: 1rem;
    margin-bottom: 0rem;
    position: relative;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.service-card h3,
.advantage-card h3 {
    margin-bottom: 1rem;
}

.service-card p,
.advantage-card p {
    color: var(--secondary-color);
    line-height: 1.7;
    position: relative;
    z-index: 2;
}

.service-text-overlap {
    margin-bottom: 0;
}

.data-driven-img,
.forecast-img,
.menu-img,
.consult-img,
.startup-img {
    margin-top: -15%;
}

.service-card:hover .data-driven-img,
.service-card:hover .forecast-img,
.service-card:hover .process-img,
.service-card:hover .consult-img,
.service-card:hover .startup-img {
    opacity: 1;
}

.edge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.edge-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* ------------------- */
/* Contact Section    */
/* ------------------- */
.contact {
    padding: 5rem 0;
    background: linear-gradient(to right, #d9d9d9 0%, #ffffff 100%);
    text-align: right;
}

.contact h2 {
    text-align: right;
    margin-bottom: 3rem;
}

.contact-form {
    flex: 1;
}

.contact-wrapper {
    display: flex;
    gap: 2rem;
    align-items: stretch;
}

.contact-image {
    flex: 1;
    position: relative;
}

.contact-image img {
    width: 100%;
    height: 77%;
    object-fit: cover;
    border-radius: 5px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: var(--font-primary);
    font-size: 1rem;
    resize: vertical;
    text-align: right;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(0,102,204,0.3);
}

.submit-button {
    width: 100%;
    padding: 15px;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    background-color: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,102,204,0.3);
}

/* ------------------- */
/* Footer             */
/* ------------------- */
.footer {
    background: #1a1a1a;
    color: #fff;
    padding: 4rem 0 2rem 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-section {
    color: #fff;
}

.footer-main {
    flex: 2; /* Approx 40% */
    min-width: 280px;
}

.footer-links,
.footer-contact {
    flex: 1.5; /* Approx 30% */
    min-width: 200px;
}

.footer-section h4 {
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.footer-section p {
    color: #ccc;
    margin-bottom: 1rem;
}

.footer-logo-img {
    max-height: 80px;
    width: auto;
    margin-top: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 1rem;
}

.footer-section a {
    color: #fff;
    text-decoration: underline;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.footer-section a:hover {
    color: #aaa;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #333;
    color: #999;
}

/* ------------------- */
/* Responsive Design   */
/* ------------------- */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.8rem; }
    
    .hero {
        padding: 4rem 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .navbar-container {
        flex-wrap: wrap;
    }

    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
        width: 100%;
        order: 3;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .about .container {
        display: block;
    }
    .about-wrapper {
        display: block;
    }
    .about-image {
        grid-column: auto;
        grid-row: auto;
        margin-top: 2rem;
    }
    .image-placeholder {
        height: auto;
        aspect-ratio: 4/3;
    }

    .services,
    .about,
    .contact {
        padding: 3rem 0;
    }
    
    .services-grid,
    .advantages-grid {
        grid-template-columns: 1fr;
    }

    .contact-wrapper {
        flex-direction: column;
    }

    .contact-image {
        height: 300px;
    }
    
    .footer-main,
    .footer-links,
    .footer-contact {
        min-width: 100%;
    }
}

/* ------------------- */
/* Modal               */
/* ------------------- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
}

/* ------------------- */
/* Privacy Policy      */
/* ------------------- */
.privacy-policy {
    padding: 5rem 0;
    background: #fff;
}

.privacy-policy h1 {
    margin-bottom: 2rem;
}

.privacy-policy h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.privacy-policy ul {
    list-style: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.privacy-policy li {
    margin-bottom: 0.5rem;
}

/* ------------------- */
/* Accessibility       */
/* ------------------- */
.accessibility-statement {
    padding: 5rem 0;
    background: #fff;
}

/* ------------------- */
/* 404 Error Page      */
/* ------------------- */
.error-page {
    padding: 5rem 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
    background: #fff;
}

.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.error-image, 
.error-content {
    flex: 1; /* 50% width each */
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.error-image img {
    width: 100%;
    max-width: 400px; /* Ensure logo doesn't get too large */
    height: auto;
    object-fit: contain;
}

.error-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    line-height: 1.4;
}

/* ------------------- */
/* Mobile Breakpoint   */
/* ------------------- */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
}

/* Responsive Iframe Container */
.responsive-iframe {
    position: relative;
    overflow: hidden;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
}
.responsive-iframe iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ------------------- */
/* App Embed Section   */
/* ------------------- */
.app-embed-section {
    position: relative;
    width: 100%;
    height: 85vh; /* Occupy most of the viewport height */
    background: #f9f9f9;
}

.app-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
