/* ========================================
   EthioCarZone - Main Stylesheet
   Beautiful Ethiopian Car Marketplace
   ======================================== */

/* ----- Variables & Reset ----- */
:root {
    --ethio-green: #078930;
    --ethio-yellow: #FCDD09;
    --ethio-red: #DA121A;
    --primary: #078930;
    --primary-dark: #056d24;
    --secondary: #FCDD09;
    --accent: #DA121A;
    --dark: #1a1a1a;
    --gray-dark: #333;
    --gray: #666;
    --gray-light: #f5f5f5;
    --white: #ffffff;
    --shadow: 0 5px 20px rgba(0,0,0,0.1);
    --shadow-hover: 0 10px 30px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #fafafa;
}

/* ========================================
   Navigation Bar
   ======================================== */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 0.5rem 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 2rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(135deg, var(--ethio-green), var(--ethio-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand span {
    background: linear-gradient(135deg, var(--ethio-yellow), var(--ethio-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--dark) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 0.2rem;
    border-radius: 5px;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--ethio-green), var(--ethio-red));
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link:hover {
    color: var(--ethio-green) !important;
}

.nav-link.active {
    color: var(--ethio-red) !important;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    background: linear-gradient(135deg, rgba(0,0,0,0.7), rgba(0,0,0,0.5)), 
                url('../assets/images/hero-bg.jpg') center/cover fixed;
    min-height: 600px;
    display: flex;
    align-items: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--ethio-green), transparent);
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero h1 span {
    color: var(--ethio-yellow);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s both;
}

/* ========================================
   Search Box
   ======================================== */
.search-box {
    background: var(--white);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeInUp 1s ease 0.4s both;
    max-width: 800px;
    margin: 0 auto;
}

.search-box .input-group {
    display: flex;
}

.search-box input,
.search-box select {
    flex: 1;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    outline: none;
    border-right: 1px solid #eee;
}

.search-box select {
    cursor: pointer;
    background: var(--white);
}

.search-box button {
    background: linear-gradient(135deg, var(--ethio-green), var(--ethio-red));
    color: var(--white);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.search-box button:hover {
    background: linear-gradient(135deg, var(--ethio-red), var(--ethio-green));
}

/* ========================================
   Section Titles
   ======================================== */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title h2::before,
.section-title h2::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--ethio-green), var(--ethio-red));
}

.section-title h2::before {
    left: -70px;
}

.section-title h2::after {
    right: -70px;
}

.section-title h2 span {
    color: var(--ethio-red);
}

.section-title p {
    color: var(--gray);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   Car Cards
   ======================================== */
.car-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    margin-bottom: 2rem;
    position: relative;
}

.car-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.car-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.car-card:hover .car-image img {
    transform: scale(1.1);
}

.car-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--ethio-red), #ff4d4d);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(218,18,26,0.3);
}

.car-badge.featured {
    background: linear-gradient(135deg, var(--ethio-green), #0aa03a);
}

.car-details {
    padding: 1.5rem;
}

.car-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.car-price {
    color: var(--ethio-green);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.car-price small {
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: normal;
}

.car-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.car-specs span {
    font-size: 0.9rem;
    color: var(--gray);
    display: flex;
    align-items: center;
}

.car-specs i {
    color: var(--ethio-red);
    margin-right: 0.3rem;
    width: 16px;
}

.car-location {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.car-location i {
    color: var(--ethio-green);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--ethio-green), #0aa03a);
    color: var(--white);
    box-shadow: 0 5px 15px rgba(7,137,48,0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0aa03a, var(--ethio-green));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(7,137,48,0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--ethio-yellow), #ffd700);
    color: var(--dark);
    box-shadow: 0 5px 15px rgba(252,221,9,0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #ffd700, var(--ethio-yellow));
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--ethio-green);
    border: 2px solid var(--ethio-green);
}

.btn-outline:hover {
    background: var(--ethio-green);
    color: var(--white);
}

.btn-block {
    display: block;
    width: 100%;
}

/* ========================================
   Features Section
   ======================================== */
.features-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.feature-box {
    text-align: center;
    padding: 2rem;
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--ethio-green), var(--ethio-red));
    transform: scaleX(0);
    transition: var(--transition);
}

.feature-box:hover::before {
    transform: scaleX(1);
}

.feature-box:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, rgba(7,137,48,0.1), rgba(218,18,26,0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--ethio-red);
    transition: var(--transition);
}

.feature-box:hover .feature-icon {
    transform: rotateY(180deg);
    color: var(--ethio-green);
}

/* ========================================
   Car Detail Gallery
   ======================================== */
.car-gallery {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.main-image-container {
    position: relative;
    height: 500px;
    background: #f5f5f5;
    cursor: pointer;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
}

.thumbnail-item {
    position: relative;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.thumbnail-item:hover {
    transform: scale(1.05);
}

.thumbnail-item.active {
    border-color: var(--ethio-red);
    box-shadow: 0 0 0 3px rgba(218,18,26,0.2);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.thumbnail-item:hover .thumbnail-overlay {
    opacity: 1;
}

.thumbnail-overlay i {
    color: var(--white);
    font-size: 1.5rem;
}

/* ========================================
   Modal (Lightbox)
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    overflow: auto;
}

.modal.show {
    display: block;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: 30px auto;
    text-align: center;
}

.modal-image {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: var(--white);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.modal-close:hover {
    color: var(--ethio-red);
}

.modal-prev,
.modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-prev:hover,
.modal-next:hover {
    background: var(--ethio-red);
}

.modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    background: rgba(0,0,0,0.5);
    padding: 0.5rem 1rem;
    border-radius: 25px;
}

/* ========================================
   Contact Form
   ======================================== */
.contact-section {
    padding: 5rem 0;
}

.contact-info {
    background: linear-gradient(135deg, var(--ethio-green), var(--ethio-red));
    color: var(--white);
    padding: 3rem;
    border-radius: 20px;
    height: 100%;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.contact-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.contact-info-icon {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
}

.contact-form {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--ethio-green);
    box-shadow: 0 0 0 3px rgba(7,137,48,0.1);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 4rem 0 1rem;
    margin-top: 4rem;
}

.footer h4 {
    color: var(--ethio-yellow);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #aaa;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--ethio-yellow);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--ethio-red);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 3rem;
    margin-top: 3rem;
    border-top: 1px solid #333;
    color: #aaa;
}

/* ========================================
   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);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    .section-title h2::before,
    .section-title h2::after {
        width: 30px;
    }
    
    .section-title h2::before {
        left: -50px;
    }
    
    .section-title h2::after {
        right: -50px;
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: 500px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .search-box .input-group {
        flex-direction: column;
    }
    
    .search-box input,
    .search-box select,
    .search-box button {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .search-box button {
        border-radius: 0 0 50px 50px;
    }
    
    .section-title h2::before,
    .section-title h2::after {
        display: none;
    }
    
    .main-image-container {
        height: 300px;
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .car-image {
        height: 180px;
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .contact-info,
    .contact-form {
        padding: 2rem;
    }
}

/* ========================================
   Loading Spinner
   ======================================== */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--ethio-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   Alert Messages
   ======================================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border-left: 5px solid #28a745;
}

.alert-error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border-left: 5px solid #dc3545;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    color: #856404;
    border-left: 5px solid #ffc107;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    border-left: 5px solid #17a2b8;
}

/* ========================================
   Ethiopian Flag Banner
   ======================================== */
.flag-banner {
    height: 5px;
    background: linear-gradient(90deg, var(--ethio-green) 33.33%, var(--ethio-yellow) 33.33% 66.66%, var(--ethio-red) 66.66%);
}