/* MotorJo Frontend Styles */

* {
    box-sizing: border-box;
}

.motorjo-home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
}

/* Sections */
.motorjo-section {
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease-in;
}

.motorjo-section h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 3px solid #0073aa;
    padding-bottom: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Carousel (Slides) */
.motorjo-carousel {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.slide-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide-item.active {
    opacity: 1;
    z-index: 10;
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-link {
    display: block;
    width: 100%;
    height: 100%;
}

.slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 30px;
    z-index: 20;
}

.slide-overlay h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.slide-overlay p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* Grid Layout */
.motorjo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Listing Card */
.listing-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.listing-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.listing-card:hover .listing-image img {
    transform: scale(1.05);
}

.listing-info {
    padding: 15px;
}

.listing-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-info .price {
    font-size: 20px;
    font-weight: bold;
    color: #dc3545;
    margin: 5px 0;
}

.listing-info .details {
    font-size: 14px;
    color: #666;
    margin: 5px 0 0 0;
}

/* Company Card */
.company-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.company-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.company-logo {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.company-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.company-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.company-card p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.company-card .phone {
    font-weight: bold;
    color: #0073aa;
    margin-top: 10px;
}

.company-card .company-description {
    color: #444;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 8px;
}

.company-card .company-website {
    display: inline-block;
    margin-top: 10px;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.company-card .company-website:hover {
    text-decoration: underline;
}

/* Offers Section */
.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.offer-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.offer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.offer-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
    cursor: pointer;
}

.offer-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.offer-card:hover .offer-image {
    transform: scale(1.05);
}

.offer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.offer-card:hover .offer-overlay {
    opacity: 1;
}

.offer-overlay h3 {
    color: white;
    text-align: center;
    margin: 0;
    font-size: 18px;
    padding: 10px;
}

.offer-info {
    padding: 15px;
    text-align: center;
}

.offer-phone {
    margin: 0;
    font-size: 14px;
    color: #333;
    font-weight: bold;
}

.offer-link {
    display: inline-block;
    margin-top: 10px;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.offer-link:hover {
    text-decoration: underline;
    color: #005a87;
}

/* Lightbox */
.offer-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    display: block;
}

.lightbox-content p {
    color: white;
    margin-top: 15px;
    font-size: 18px;
}

.lightbox-close {
    position: absolute;
    top: -30px;
    right: 0;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: #ddd;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .motorjo-home-container {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    .motorjo-section h2 {
        color: #e0e0e0;
    }
    
    .listing-card,
    .company-card,
    .offer-card {
        background: #2d2d2d;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    
    .listing-image,
    .offer-image-wrapper {
        background: #444;
    }
    
    .listing-info h3,
    .company-card h3,
    .offer-phone {
        color: #e0e0e0;
    }
    
    .listing-info .details,
    .company-card p {
        color: #b0b0b0;
    }
    
    .company-logo {
        background: #3a3a3a;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .motorjo-carousel {
        height: 250px;
    }
    
    .motorjo-grid,
    .offers-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .motorjo-section h2 {
        font-size: 22px;
    }
    
    .slide-overlay {
        padding: 15px;
    }
    
    .slide-overlay h3 {
        font-size: 18px;
    }
    
    .slide-overlay p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .motorjo-home-container {
        padding: 10px;
    }
    
    .motorjo-carousel {
        height: 200px;
    }
    
    .motorjo-grid,
    .offers-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .motorjo-section {
        margin-bottom: 20px;
    }
    
    .listing-image,
    .offer-image-wrapper {
        height: 150px;
    }
    
    .listing-info {
        padding: 10px;
    }
    
    .listing-info h3 {
        font-size: 14px;
    }
    
    .listing-info .price {
        font-size: 16px;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.listing-card,
.company-card {
    animation: slideIn 0.5s ease-out;
}
