/**
 * Frontend Styles
 * RTL-compatible styles for car warning lights display
 *
 * @package Car_Warning_Lights
 * @since 1.0.0
 */

/* =============================================================================
   Container & Layout
   ========================================================================== */

.car-warning-lights-wrapper {
    direction: rtl;
    text-align: right;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: "Discovery", sans-serif;
}

/* =============================================================================
   Page Title
   ========================================================================== */

.event_page_title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}

/* =============================================================================
   Intro Text
   ========================================================================== */

.intro-text {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
    line-height: 1.6;
}

.intro-text p {
    margin-bottom: 10px;
}

.intro-text strong {
    display: block;
    font-size: 18px;
    margin-top: 10px;
    color: #333;
}

/* =============================================================================
   Brands Grid - Circular Logos
   ========================================================================== */

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 25px;
    margin: 30px 0;
    justify-items: center;
}

.car-brand-logo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.car-brand-logo:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-color: #00a0d2;
}

.car-brand-logo.active {
    border-color: #00a0d2;
    border-width: 4px;
    box-shadow: 0 5px 15px rgba(0, 160, 210, 0.4);
}

.car-brand-logo img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* =============================================================================
   Models Section
   ========================================================================== */

#car-models-container {
    margin: 30px 0;
}

.models-wrapper h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: #333;
}

.models-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.car-model-btn {
    padding: 12px 24px;
    background: #00a0d2;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.car-model-btn:hover {
    background: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.car-model-btn.active {
    background: #005177;
}

/* =============================================================================
   Warning Lights Section
   ========================================================================== */

#car-lights-container {
    margin: 30px 0;
}

.lights-wrapper h3 {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}

.lights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    justify-items: center;
}

/* New image-only display style */
.light-item-image-only {
    width: 120px;
    height: 120px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.light-item-image-only:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-color: #00a0d2;
}

.light-item-image-only::after {
    content: "לחץ לפרטים";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 160, 210, 0.9);
    color: white;
    font-size: 11px;
    padding: 4px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.light-item-image-only:hover::after {
    transform: translateY(0);
}

.light-item-image-only img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Legacy styles (kept for backward compatibility) */
.light-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.light-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
    border-color: #00a0d2;
}

.light-image {
    margin-bottom: 12px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.light-image img {
    width: 100%;
    max-width: 100px;
    height: auto;
}

.light-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.light-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin: 0;
}

.light-description {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin: 0;
    text-align: center;
}

/* =============================================================================
   Popup Modal Styles
   ========================================================================== */

.light-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.light-popup-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    direction: rtl;
}

.light-popup-header {
    background: #00a0d2;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.light-popup-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.light-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.light-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.light-popup-content {
    padding: 20px;
    text-align: center;
}

.light-popup-image {
    margin-bottom: 15px;
}

.light-popup-image img {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.light-popup-description {
    text-align: right;
}

.light-popup-description p {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

/* =============================================================================
   Loading & Error States
   ========================================================================== */

.loading,
.error,
.no-lights {
    text-align: center;
    padding: 20px;
    font-size: 16px;
}

.loading {
    color: #666;
}

.error {
    color: #d63638;
    background: #fef7f7;
    border: 1px solid #d63638;
    border-radius: 4px;
}

.no-lights {
    color: #666;
    font-style: italic;
}

.cache-info {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 15px;
}

/* =============================================================================
   Responsive Design
   ========================================================================== */

/* Tablets */
@media (max-width: 768px) {
    .brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }

    .car-brand-logo {
        width: 100px;
        height: 100px;
    }

    .lights-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }

    .light-item-image-only {
        width: 100px;
        height: 100px;
        padding: 8px;
    }

    .light-popup-modal {
        width: 95%;
        max-width: 400px;
    }

    .light-popup-image img {
        max-width: 150px;
        max-height: 150px;
    }

    .models-buttons {
        flex-direction: column;
    }

    .car-model-btn {
        width: 100%;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .car-warning-lights-wrapper {
        padding: 10px;
    }

    .event_page_title {
        font-size: 22px;
    }

    .intro-text strong {
        font-size: 16px;
    }

    .brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }

    .car-brand-logo {
        width: 80px;
        height: 80px;
        padding: 5px;
    }

    .lights-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }

    .light-item-image-only {
        width: 80px;
        height: 80px;
        padding: 6px;
    }

    .light-item-image-only::after {
        font-size: 9px;
        padding: 2px;
    }

    .light-popup-modal {
        width: 95%;
        max-width: 320px;
    }

    .light-popup-header {
        padding: 12px 15px;
    }

    .light-popup-header h4 {
        font-size: 16px;
    }

    .light-popup-content {
        padding: 15px;
    }

    .light-popup-image img {
        max-width: 120px;
        max-height: 120px;
    }

    .light-popup-description p {
        font-size: 14px;
    }

    .models-wrapper h3,
    .lights-wrapper h3 {
        font-size: 18px;
    }
}
