/* CSS Variables for Colors - Following 60-30-10 Rule */
:root {
    --primary-color: #f8f9fa; /* 60% - Light background */
    --secondary-color: #1e3a5f; /* 30% - Navy blue */
    --accent-color: #c0c0c0; /* 10% - Silver */
    --text-color: #333333;
    --light-text: #ffffff;
    --highlight: #2a5a9c;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* ===== IRANYEKANX FONT FACES ===== */
@font-face {
    font-family: 'IRANYekanX';
    src: url('../fonts/iranyekanx/IRANYekanX-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANYekanX';
    src: url('../fonts/iranyekanx/IRANYekanX-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANYekanXFaNum';
    src: url('../fonts/iranyekanx/IRANYekanXFaNum-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANYekanXFaNum';
    src: url('../fonts/iranyekanx/IRANYekanXFaNum-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Default English font */
}

/* ===== RTL & PERSIAN FONT STYLES ===== */
.rtl {
    direction: rtl;
    text-align: right;
    font-family: 'IRANYekanX', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Apply Persian font to ALL elements first */
.rtl * {
    font-family: 'IRANYekanX', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* FIX: Protect ONLY pure Font Awesome icons (not elements that contain both text and icons) */
.rtl i[class^="fa-"]:not(span):not(div):not(p):not(a):not(button),
.rtl i[class*=" fa-"]:not(span):not(div):not(p):not(a):not(button),
.rtl .fas:not(span):not(div):not(p):not(a):not(button),
.rtl .far:not(span):not(div):not(p):not(a):not(button),
.rtl .fab:not(span):not(div):not(p):not(a):not(button),
.rtl .fa:not(span):not(div):not(p):not(a):not(button) {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 6 Solid" !important;
}

/* Use FaNum for numbers and prices */
.rtl .car-price,
.rtl .spec span,
.rtl .search-counter,
.rtl .pagination-btn,
.rtl .btn,
.rtl .car-specs .spec,
.rtl .search-box input,
.rtl .form-control {
    font-family: 'IRANYekanXFaNum', 'IRANYekanX', sans-serif !important;
}
/* Specific element adjustments for better Persian readability */
.rtl .hero h1 {
    font-size: 3rem;
    line-height: 1.4;
    font-weight: 700;
}

.rtl .hero p {
    font-size: 1.15rem;
    line-height: 1.9;
}

.rtl .section-title {
    font-size: 2.3rem;
    font-weight: 700;
}

.rtl .car-info h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

/* ===== REST OF YOUR STYLES (UNCHANGED) ===== */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header & Navigation */
header {
    background-color: var(--secondary-color);
    color: var(--light-text);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--light-text);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 10px;
    color: var(--accent-color);
}

.rtl .logo i {
    margin-right: 0;
    margin-left: 10px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 2rem;
}

.rtl nav ul li {
    margin-left: 0;
    margin-right: 2rem;
}

nav ul li a {
    color: var(--light-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
    position: relative;
}

nav ul li a:hover {
    color: var(--accent-color);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s;
}

.rtl nav ul li a::after {
    left: auto;
    right: 0;
}

nav ul li a:hover::after {
    width: 100%;
}

.language-switcher {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.language-switcher:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-option {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    transition: background 0.3s, color 0.3s;
}

.lang-active {
    background: var(--accent-color);
    color: var(--secondary-color);
    font-weight: 600;
}

.mobile-menu {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(30, 58, 95, 0.8), rgba(30, 58, 95, 0.9)), url('https://images.unsplash.com/photo-1494976388531-d1058494cdd8?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    color: var(--light-text);
    padding: 8rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--secondary-color);
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background-color: var(--light-text);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Section Styling */
section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--secondary-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--accent-color);
}

.rtl .section-title::after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* Cars Section */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 5px 15px var(--shadow);
    border-radius: 30px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    box-shadow: 0 8px 25px var(--shadow);
    transform: translateY(-2px);
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    outline: none;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.search-box input:focus {
    background: #f8f9fa;
}

.search-box button {
    background-color: var(--secondary-color);
    color: var(--light-text);
    border: none;
    padding: 0 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    background-color: var(--highlight);
}

.clear-search {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    padding: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    font-size: 0.9rem;
}

.clear-search.visible {
    opacity: 1;
    visibility: visible;
}

.clear-search:hover {
    background: rgba(0, 0, 0, 0.15);
    color: var(--secondary-color);
    transform: translateY(-50%) scale(1.1);
}

.rtl .clear-search {
    right: auto;
    left: 70px;
}

.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.car-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.car-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--shadow);
}

.car-image {
    height: 200px;
    overflow: hidden;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.car-card:hover .car-image img {
    transform: scale(1.1);
}

.car-info {
    padding: 1.5rem;
}

.car-info h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.car-specs {
    display: flex;
    flex-wrap: wrap;
    margin: 1rem 0;
    gap: 10px;
}

.spec {
    background-color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.spec i {
    margin-right: 5px;
    color: var(--secondary-color);
}

.rtl .spec i {
    margin-right: 0;
    margin-left: 5px;
}

.car-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 1rem 0;
}

.contact-btn {
    width: 100%;
    text-align: center;
    background-color: var(--secondary-color);
    color: var(--light-text);
}

.contact-btn:hover {
    background-color: var(--highlight);
}

/* No Results Styling */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-color);
}

.no-results-content i {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.no-results-content h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-results-content p {
    color: #666;
    font-size: 1.1rem;
}

/* Search Counter */
.search-counter {
    text-align: center;
    margin: 1rem 0 2rem;
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.search-counter.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Contact Section */
.contact {
    background-color: var(--secondary-color);
    color: var(--light-text);
}

.contact .section-title {
    color: var(--light-text);
}

.contact .section-title::after {
    background-color: var(--accent-color);
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.rtl .contact-item {
    flex-direction: row-reverse;
}

.contact-icon {
    background-color: var(--accent-color);
    color: var(--secondary-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.contact-details h3 {
    margin-bottom: 0.5rem;
}

.contact-form {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 10px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    background-color: var(--accent-color);
    color: var(--secondary-color);
    width: 100%;
}

.submit-btn:hover {
    background-color: var(--light-text);
}

/* Footer */
footer {
    background-color: #1a1a1a;
    color: var(--light-text);
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.footer-logo i {
    margin-right: 10px;
    color: var(--accent-color);
}

.rtl .footer-logo i {
    margin-right: 0;
    margin-left: 10px;
}

.footer-links h3, .footer-social h3 {
    margin-bottom: 1.5rem;
    position: relative;
}

.footer-links h3::after, .footer-social h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
}

.rtl .footer-links h3::after, .rtl .footer-social h3::after {
    left: auto;
    right: 0;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 0.8rem;
}

.footer-links ul li a {
    color: #cccccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links ul li a:hover {
    color: var(--accent-color);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--light-text);
    text-decoration: none;
    transition: all 0.3s;
}

.social-icons a:hover {
    background-color: var(--accent-color);
    color: var(--secondary-color);
    transform: translateY(-5px);
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #aaaaaa;
}

/* Pagination Styles */
.pagination-container {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn, .page-btn {
    padding: 10px 16px;
    border: 2px solid var(--accent-color);
    background: white;
    color: var(--secondary-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.pagination-btn:hover:not(.disabled), .page-btn:hover:not(.active) {
    background: var(--accent-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pagination-btn.disabled:hover {
    background: white;
    color: var(--secondary-color);
    transform: none;
    box-shadow: none;
}

.page-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-ellipsis {
    padding: 10px 8px;
    color: var(--text-color);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pagination {
        gap: 0.25rem;
    }
    
    .pagination-btn, .page-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-width: 40px;
        justify-content: center;
    }
    
    .page-numbers {
        gap: 0.25rem;
    }
    
    .pagination-ellipsis {
        padding: 8px 4px;
    }
    
    .mobile-menu {
        display: block;
    }
    
    nav {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease;
    }
    
    nav.active {
        max-height: 300px;
    }
    
    nav ul {
        flex-direction: column;
        padding: 1rem 0;
    }
    
    nav ul li {
        margin: 0.5rem 0;
    }
    
    .rtl nav ul li {
        margin: 0.5rem 0;
    }
    
    .hero {
        padding: 5rem 0;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    section {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .pagination {
        flex-direction: column;
        gap: 1rem;
    }
    
    .page-numbers {
        order: -1;
    }
    
    .pagination-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .btn {
        padding: 10px 20px;
    }
    
    .cars-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
}   

/* Simplified Contact Section Styles */
.contact-simple {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.contact-card {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
}

/* Default LTR styles for English */
.contact-item-simple {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
    direction: ltr;
    text-align: left;
}

.contact-item-simple:last-child {
    margin-bottom: 0;
}

.contact-icon-simple {
    background: #f8f9fa;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon-simple i {
    color: #2c3e50;
    font-size: 1.2rem;
}

.contact-details-simple h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.contact-details-simple p {
    color: #666;
    line-height: 1.5;
}

.phone-numbers-simple {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.phone-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    direction: ltr;
}

.phone-item:last-child {
    border-bottom: none;
}

.phone-name {
    font-weight: 500;
    color: #333;
}

.phone-number {
    font-family: monospace;
    background: #f8f9fa;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    color: #2c3e50;
    direction: ltr;
    display: inline-block;
}

.contact-email {
    color: #3498db !important;
    font-weight: 500;
    direction: ltr;
    text-align: left;
}

/* RTL styles for Farsi */
body[dir="rtl"] .contact-item-simple {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] .contact-card {
    text-align: right;
}

body[dir="rtl"] .contact-details-simple {
    text-align: right;
}

body[dir="rtl"] .contact-details-simple p {
    text-align: right;
}

body[dir="rtl"] .phone-item {
    direction: rtl;
    flex-direction: row-reverse;
}

body[dir="rtl"] .phone-name {
    text-align: right;
}

/* Keep phone numbers and email LTR in both languages */
body[dir="rtl"] .phone-number,
body[dir="rtl"] .contact-email {
    direction: ltr;
    text-align: left;
}

/* Responsive */
@media (max-width: 768px) {
    .contact-card {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .contact-item-simple {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }
    
    body[dir="rtl"] .contact-item-simple {
        flex-direction: column;
        text-align: center;
    }
    
    .phone-item {
        flex-direction: column;
        gap: 0.3rem;
        text-align: center;
    }
    
    body[dir="rtl"] .phone-item {
        flex-direction: column;
        text-align: center;
    }
    
    body[dir="rtl"] .phone-name {
        text-align: center;
    }
}