/*
 * Custom styles for City Cars landing page
 * The design follows a modern, mobile‑first approach with responsive layouts.
 * Colors and fonts are inspired by the official CityCars website【813857092957770†L68-L82】, which uses
 * a combination of deep blue (#006db7) and warm orange (#f5991e) accents【813857092957770†L100-L112】.
 */

/* CSS Reset and basic typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Cairo", sans-serif;
    background-color: #ffffff;
    color: #333333;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

input,
select,
textarea,
button {
    font-family: "Cairo", sans-serif;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    /* center images like the logo by default */
    margin-inline: auto;
}

a {
    text-decoration: none;
}

/* Color variables */
:root {
    --primary-color: #006db7; /* main blue hue from CityCars site【813857092957770†L100-L112】 */
    --secondary-color: #f5991e; /* warm accent tone for highlights【813857092957770†L73-L76】 */
    --text-color: #333333;
    --background-color: #f9f9f9;
}

/* Utility classes */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: "Cairo", sans-serif;
}

.primary-btn {
    background-color: var(--primary-color);
    color: #ffffff;
}

.primary-btn:hover {
    background-color: #004f86;
}

.secondary-btn {
    background-color: var(--secondary-color);
    color: #ffffff;
}

.secondary-btn:hover {
    background-color: #d47f0a;
}

/* Hero Section */
.hero-section {
    background-color: var(--background-color);
    padding-top: 1rem;
    padding-bottom: 3rem;
}

.hero-section .logo {
    text-align: center;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #555555;
    text-align: center;
    margin-bottom: 2rem;
}

/* Offer Cards */
.offers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.offer-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex: 1 1 300px;
    max-width: 350px;
    display: flex;
    flex-direction: column;
}

.offer-card .card-img {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
}

.offer-card .card-img img {
    width: 100%;
    height: 100%;
    /* Use contain to ensure the full car appears without cropping */
    object-fit: contain;
}

.offer-card .card-content {
    padding: 1rem 1.25rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.offer-card .car-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.offer-card .installment {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.offer-card .benefits {
    list-style: none;
    margin-bottom: 1rem;
}

.offer-card .benefits li {
    position: relative;
    padding-inline-start: 1.5rem;
    margin-bottom: 0.5rem;
    color: #555555;
    font-size: 0.95rem;
}

.offer-card .benefits li::before {
    content: "\2714";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    color: var(--secondary-color);
    font-size: 1rem;
}

.offer-card .btn {
    margin-top: auto;
    text-align: center;
}

/* Features Section */
.features-section {
    background-color: var(--background-color);
    padding: 3rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
}

.features-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    justify-content: center;
}

.features-image {
    flex: 1 1 300px;
    max-width: 400px;
}

.features-content {
    flex: 1 1 300px;
    max-width: 600px;
}

.features-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-content li {
    font-size: 1rem;
    color: #555555;
    margin-bottom: 0.75rem;
    padding-inline-start: 1.5rem;
    position: relative;
}

.features-content li::before {
    content: "\2022";
    position: absolute;
    inset-inline-start: 0;
    top: 0.1rem;
    font-size: 1.2rem;
    color: var(--secondary-color);
}

/* Steps Section */
.steps-section {
    background-color: #ffffff;
    padding: 3rem 0;
}

.steps-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.step {
    background-color: var(--background-color);
    border-radius: 10px;
    padding: 1.5rem;
    flex: 1 1 200px;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.step-number {
    background-color: var(--secondary-color);
    color: #ffffff;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.step h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.step p {
    font-size: 0.95rem;
    color: #555555;
}

/* Offer Banner */
.offer-banner {
    background-color: var(--primary-color);
    color: #ffffff;
    text-align: center;
    padding: 2.5rem 0;
}

.offer-banner h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.offer-banner p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* FAQ Section */
.faq-section {
    background-color: var(--background-color);
    padding: 3rem 0;
}

.faq {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: #ffffff;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: right;
    background-color: #ffffff;
    color: var(--primary-color);
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: "+";
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #fdfdfd;
    padding: 0 1rem;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding: 1rem;
}

.faq-answer p {
    font-size: 0.95rem;
    color: #555555;
}

/* CTA Section */
.cta-section {
    background-color: var(--secondary-color);
    color: #ffffff;
    text-align: center;
    padding: 2.5rem 0;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.cta-section p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Footer */
.footer {
    background-color: #0e4d85;
    color: #ffffff;
    text-align: center;
    padding: 1.5rem 0;
}

.footer-logo {
    width: 120px;
    margin: 0 auto 0.5rem;
}

.footer p {
    font-size: 0.9rem;
}

/* Banner Section */
.banner-section {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-top: 0;
    background-color: var(--background-color);
}

.banner-slider {
    width: 100%;
    display: block;
    position: relative;
}

.banner-slider img {
    width: 100%;
    height: auto;
    display: block;
}

/* Hide desktop banners on small screens and mobile banners on larger screens */
.desktop-banner {
    display: block;
}
.mobile-banner {
    display: none;
}

@media (max-width: 767px) {
    .desktop-banner {
        display: none !important;
    }
    .mobile-banner {
        display: block !important;
    }
}

/* Contact Form Section */
.contact-form-section {
    background-color: #ffffff;
    padding: 3rem 0;
}
.contact-form {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}
@media (max-width: 768px) {
    .contact-form {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
.form-group label {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
    font-family: "Cairo", sans-serif; /* Setup font for inputs */
}
.contact-form .btn {
    grid-column: 1 / -1;
    margin-top: 1rem;
    width: 100%;
    text-align: center;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}
.alert-error ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Dashboard styles */
#admin-panel table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
#admin-panel th,
#admin-panel td {
    text-align: center;
    padding: 0.75rem;
    border: 1px solid #ccc;
}
.check-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: var(--secondary-color);
    color: #ffffff;
    font-weight: 600;
    transition: background-color 0.3s ease;
}
.check-btn:hover {
    background-color: #d47f0a;
}
.check-btn.contacted {
    background-color: #9fa5a9;
    color: #ffffff;
    cursor: default;
}
.contacted-row {
    background-color: #f1f1f1;
    color: #888888;
}

/* Responsive Design */
@media (max-width: 991px) {
    .hero-title {
        font-size: 2rem;
    }
    .offers-grid {
        flex-direction: column;
        align-items: center;
    }
    .features-grid,
    .steps-grid {
        flex-direction: column;
        align-items: center;
    }
    .features-image,
    .features-content,
    .step {
        max-width: none;
        flex: 1 1 100%;
    }
}

/* Adjust car images and layout on small screens to ensure the entire car photo appears first and at a larger size */
@media (max-width: 767px) {
    .offer-card {
        max-width: 100%;
    }
    .offer-card .card-img {
        width: 100%;
        height: auto;
        padding: 0;
        margin-bottom: 1rem;
        overflow: visible;
        display: block;
    }
    .offer-card .card-img img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    .offer-card .card-content {
        padding: 0 1rem 1.5rem;
    }
}

/* Scroll animation base styles */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition:
        opacity 0.6s ease-out,
        transform 0.6s ease-out;
}

.animate-on-scroll.show {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   News Ticker Styles
   ========================================= */
.news-ticker {
    width: 100%;
    background-color: var(--primary-color); /* Blue background */
    color: #ffffff;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 999; /* Ensure it stays on top */
    border-bottom: 2px solid #fff;
}

.news-ticker:hover .ticker-content {
    animation-play-state: paused;
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    animation: ticker-move 60s linear infinite;
    /* Use translate for positioning, no padding hack needed */
}

.ticker-content span {
    display: inline-block;
    padding: 0 6rem;
    font-size: 1.1rem;
    font-weight: bold;
}

/* Move from Right to Left across the screen */
@keyframes ticker-move {
    0% {
        transform: translate3d(100vw, 0, 0); /* Start off-screen Right */
    }
    100% {
        transform: translate3d(calc(-100vw - 100%), 0, 0); /* Move all the way to off-screen Left */
    }
}

/* =========================================
   Top Branding Banner Styles
   ========================================= */
.top-branding-banner {
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #eee;
    padding: 0;
}

.top-branding-banner .container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    text-align: center;
    position: relative; /* For dots overlay */
}

.top-branding-banner img {
    width: 100%;
    height: auto;
    max-height: none; /* Allow full height based on aspect ratio */
    display: block;
}

/* Placeholder style */
.banner-placeholder {
    padding: 40px;
    background: #f8f9fa;
    color: #6c757d;
    border: 2px dashed #dee2e6;
    margin: 10px auto;
    width: 90%;
    max-width: 1100px;
    text-align: center;
    font-weight: bold;
}

/* =========================================
   Banner Navigation Dots
   ========================================= */
.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    z-index: 10;
}

.banner-dots .dot {
    height: 12px;
    width: 12px;
    margin: 0 6px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.banner-dots .dot:hover {
    background-color: #777;
}

.banner-dots .dot.active {
    background-color: var(--primary-color);
}

