/* Global Styles - Chery Theme */
:root {
    --primary-color: #c41e3a;
    --secondary-color: #8b0000;
    --accent-color: #ff6b6b;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    --gray-color: #6c757d;
    --gold-color: #ffd700;
    --success-color: #28a745;
    --chery-red: #c41e3a;
    --chery-dark-red: #8b0000;
    --chery-light-red: #ff6b6b;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

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

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

.section-padding {
    padding: 5rem 0;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--chery-red) 0%, var(--chery-dark-red) 100%);
    box-shadow: 0 4px 20px rgba(196, 30, 58, 0.3);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo h1 {
    font-size: 2rem;
    margin: 0;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 800;
}

.logo p {
    margin: 0;
    font-size: 1rem;
    color: var(--light-color);
    font-weight: 600;
}

nav ul {
    display: flex;
}

nav ul li {
    margin-right: 1.5rem;
}

nav ul li:last-child {
    margin-right: 0;
}

nav ul li a {
    color: #fff;
    font-weight: 600;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: var(--chery-light-red);
    transform: translateY(-2px);
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--chery-light-red);
    bottom: 0;
    right: 0;
    transition: var(--transition);
}

nav ul li a:hover::after {
    width: 100%;
    right: auto;
    left: 0;
}

.mobile-menu {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.9) 0%, rgba(139, 0, 0, 0.8) 100%), url('../images/hero-bg.jpg') no-repeat center center/cover;
    height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    color: #fff;
    margin-top: 0;
    position: relative;
    overflow: hidden;
}

.hero::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="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    font-weight: 800;
    position: relative;
    z-index: 2;
}

.hero p {
    font-size: 1.6rem;
    margin-bottom: 2.5rem;
    color: var(--light-color);
    position: relative;
    z-index: 2;
}

/* Buttons */
.cta-button, .brand-button, .submit-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--chery-red) 0%, var(--chery-dark-red) 100%);
    color: #fff;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
}

.cta-button:hover, .brand-button:hover, .submit-btn:hover {
    background: linear-gradient(135deg, var(--chery-light-red) 0%, var(--chery-red) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(196, 30, 58, 0.4);
    color: #fff;
}

/* Brands Section */
.brands {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--light-color) 0%, #fff 100%);
}

.brands h2 {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 800;
}

.brands h2::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--chery-red), var(--chery-light-red));
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.brand-card {
    background: linear-gradient(135deg, #fff 0%, var(--light-color) 100%);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.brand-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.1), transparent);
    transition: var(--transition);
}

.brand-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: var(--chery-red);
}

.brand-card:hover::before {
    left: 100%;
}

.brand-card img {
    max-width: 150px;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
}

/* Vehicles Section */
.vehicles {
    padding: 5rem 0;
    background: linear-gradient(135deg, #fff 0%, var(--light-color) 100%);
}

.vehicle-filters {
    text-align: center;
    margin-bottom: 2rem;
}

.filter-btn {
    background: linear-gradient(135deg, var(--chery-red) 0%, var(--chery-dark-red) 100%);
    border: 2px solid var(--chery-red);
    color: #fff;
    padding: 0.8rem 2rem;
    margin: 0 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.2);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.filter-btn:hover, .filter-btn.active {
    background: linear-gradient(135deg, var(--chery-light-red) 0%, var(--chery-red) 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.vehicle-card {
    background: linear-gradient(135deg, #fff 0%, var(--light-color) 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
    border: 2px solid transparent;
}

.vehicle-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: var(--chery-red);
}

.vehicle-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.vehicle-card:hover .vehicle-image {
    transform: scale(1.03);
}

.vehicle-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.vehicle-title {
    font-size: 1.25rem;
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-weight: 700;
    min-height: 3rem;
    display: flex;
    align-items: center;
}

.vehicle-description {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.6;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 4.5em;
    /* Standard property for line clamping */
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.vehicle-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 0.9rem;
}

.spec-item {
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px;
    transition: all 0.2s ease;
    border: 1px solid #eee;
}

.spec-item i {
    color: var(--chery-red);
    font-size: 0.9em;
}

.spec-item:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.vehicle-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--chery-red);
    margin-top: auto;
    text-align: center;
    padding: 12px 0;
    background: linear-gradient(to right, #f8f9fa, #fff);
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.vehicle-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(45deg, var(--chery-red), var(--chery-dark-red));
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 3;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vehicle-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    gap: 10px;
}

.vehicle-actions .btn {
    flex: 1;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.vehicle-actions .btn i {
    font-size: 0.9em;
}

.vehicle-image-container {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contact Form */
.contact {
    background: linear-gradient(135deg, var(--chery-red) 0%, var(--chery-dark-red) 100%);
    padding: 5rem 0;
    color: #fff;
}

.contact h2 {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
    color: #fff;
    font-size: 2.5rem;
    font-weight: 800;
}

.contact h2::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--chery-light-red), var(--gold-color));
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.contact-form {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
    background: #f9f9f9;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--chery-red);
    outline: none;
    background: #fff;
}

.form-group label {
    position: absolute;
    right: 1rem;
    top: 1rem;
    color: var(--gray-color);
    transition: var(--transition);
    pointer-events: none;
    background: #f9f9f9;
    padding: 0 0.5rem;
    border-radius: 3px;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group select:focus + label,
.form-group select:not([value=""]) + label {
    top: -0.6rem;
    font-size: 0.8rem;
    color: var(--chery-red);
    background: #fff;
}

/* Form Validation Styles */
.form-group input.error,
.form-group select.error {
    border-color: #e63946 !important;
    background-color: #fff5f5;
}

.form-group label.error {
    color: #e63946;
}

.form-group .error-message {
    color: #e63946;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
    color: #fff;
    padding: 4rem 0 0;
    position: relative;
    overflow: hidden;
}

footer::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="footer-grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23footer-grain)"/></svg>');
    opacity: 0.3;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: #fff;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 2px;
    background: var(--chery-red);
    bottom: 0;
    right: 0;
}

.footer-section p, .footer-section a, .footer-section i {
    color: #adb5bd;
    margin-bottom: 0.8rem;
    display: block;
}

.footer-section a:hover {
    color: #fff;
    padding-right: 5px;
}

.footer-section i {
    margin-left: 10px;
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    nav {
        position: fixed;
        top: 90px;
        right: -100%;
        width: 80%;
        height: calc(100vh - 90px);
        background: #fff;
        transition: var(--transition);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding: 2rem;
        overflow-y: auto;
    }
    
    nav.active {
        right: 0;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        margin: 0 0 1.5rem 0;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .hero {
        margin-top: 80px;
        height: calc(100vh - 80px);
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .brands-grid, .vehicles-grid, .footer-content {
        grid-template-columns: 1fr;
    }
    
    .vehicle-card {
        max-width: 400px;
        margin: 0 auto;
    }
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 40px 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
    display: flex;
    align-items: center;
    max-width: 90%;
    min-width: 300px;
}

.notification.success {
    background-color: #28a745;
    border-right: 5px solid #218838;
}

.notification.error {
    background-color: #dc3545;
    border-right: 5px solid #c82333;
}

.notification.info {
    background-color: #17a2b8;
    border-right: 5px solid #138496;
}

.notification.warning {
    background-color: #ffc107;
    color: #212529;
    border-right: 5px solid #e0a800;
}

.close-notification {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.close-notification:hover {
    opacity: 1;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* About Chery Section */
.about-chery {
    padding: 5rem 0;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.about-chery h2 {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 800;
}

.about-chery h2::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--chery-red), var(--chery-light-red));
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.about-feature {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
}

.about-feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.about-feature i {
    font-size: 2.5rem;
    color: var(--chery-red);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.about-feature h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.about-feature p {
    color: #555;
    line-height: 1.7;
}

/* Custom Color Input Styles */
.form-group input[type="text"]#custom-car-color {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
    background: #f9f9f9;
    margin-top: 10px;
}

.form-group input[type="text"]#custom-car-color:focus {
    border-color: var(--primary-color);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 0.2rem rgba(196, 30, 58, 0.25);
}

.btn-secondary {
    background-color: var(--gray-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    padding: 0.5rem 1.5rem;
    font-weight: 600;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Submission State */
.form-submitting .submit-btn {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles for Keyboard Navigation */
:focus-visible {
    outline: 3px solid var(--chery-light-red);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .vehicle-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
