/* Shared Car Modal Styles - Used by both analytics and account pages */

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 2% auto;
    width: 90%;
    max-width: 1200px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
    position: relative;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 36px;
    font-weight: bold;
    color: #6e6e73;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #667eea;
}

/* Modal Navigation Buttons */
.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #667eea;
    color: #667eea;
    padding: 16px 12px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 700;
    z-index: 1001;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-nav:hover {
    background: #667eea;
    color: white;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.modal-nav-prev {
    left: 2%;
}

.modal-nav-next {
    right: 2%;
}

.modal-nav-label {
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .modal-nav {
        padding: 12px 8px;
    }

    .modal-nav-label {
        display: none;
    }
}

.modal-body {
    display: flex;
    gap: 30px;
    padding: 40px;
}

.modal-images {
    flex: 1;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.more-images-indicator {
    position: relative;
    width: 100%;
    height: 200px;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
}

.more-images-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 2;
    transition: background 0.3s;
}

.more-images-indicator:hover .more-images-overlay {
    background: rgba(0, 0, 0, 0.85);
}

.more-images-icon {
    font-size: 40px;
}

.more-images-text {
    color: white;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.more-images-indicator img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.gallery-image:first-child {
    grid-column: span 2;
    height: 300px;
}

.no-images {
    grid-column: span 2;
    padding: 60px;
    text-align: center;
    color: #6e6e73;
    background: #f5f5f7;
    border-radius: 12px;
}

.modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-info h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: #1d1d1f;
}

.modal-price {
    font-size: 36px;
    font-weight: 800;
    color: #667eea;
}

.modal-vat-info {
    font-size: 18px;
    font-weight: 600;
    color: #2e7d32;
    margin-top: 8px;
}

.modal-vat-percent {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.modal-vat-info.modal-no-vat {
    color: #e65100;
    font-size: 16px;
}

.modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.modal-badge.badge-excellent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-badge.badge-good {
    background: #e8f5e9;
    color: #2e7d32;
}

.modal-badge.badge-neutral {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
}

.modal-badge.modal-badge-neutral {
    background: #f5f5f5;
    color: #424242;
    border: 1px solid #e0e0e0;
}

.modal-badge.badge-bad {
    background: #ffebee;
    color: #c62828;
}

.modal-badge.badge-leverage-low {
    background: #ffebee;
    color: #c62828;
}

.modal-badge.badge-leverage-fair {
    background: #e3f2fd;
    color: #1565c0;
}

.modal-badge.badge-leverage-good {
    background: #e8f5e9;
    color: #2e7d32;
}

.modal-badge.badge-leverage-high {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: white;
}

.modal-specs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: #f5f5f7;
    border-radius: 12px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
}

.spec-label {
    font-weight: 600;
    color: #6e6e73;
}

.spec-value {
    font-weight: 600;
    color: #1d1d1f;
}

.modal-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.modal-section:last-of-type {
    margin-bottom: 24px;
}

.modal-section h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
}

.ai-insights {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.ai-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: #1d1d1f;
}

.ai-loader {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6e6e73;
    font-size: 14px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-error {
    margin: 0;
    color: #c62828;
    font-size: 14px;
}

/* Vehicle Options Styles */
.vehicle-options {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e8e8e8;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.options-category {
    background: white;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.options-category-title {
    font-size: 16px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.option-item {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #e3f2fd 0%, #e8f5e9 100%);
    color: #1565c0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #bbdefb;
    transition: all 0.2s;
}

.option-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.15);
}

.options-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.options-column .option-item {
    display: block;
    text-align: left;
}

.option-badge {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #e3f2fd 0%, #e8f5e9 100%);
    color: #1565c0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #bbdefb;
    transition: all 0.2s;
}

.option-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.15);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.modal-btn-primary {
    flex: 1;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
    transition: transform 0.2s;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
}

.modal-btn-secondary {
    padding: 16px 24px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* Listing Analytics Styles */
.listing-analytics {
    margin-top: 12px;
}

.listing-analytics .analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.analytics-item {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.analytics-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-value {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
}

.analytics-value.positive {
    color: #10b981;
}

.analytics-value.negative {
    color: #ef4444;
}

.analytics-value.neutral {
    color: #f59e0b;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease-in;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.lightbox-content img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 48px;
    font-weight: 300;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: #667eea;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 48px;
    padding: 20px 30px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 8px;
    z-index: 2001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

.lightbox-caption {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 24px;
    border-radius: 20px;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .modal-body {
        flex-direction: column;
    }

    .lightbox-content {
        padding: 20px;
    }

    .lightbox-nav {
        font-size: 32px;
        padding: 10px 20px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .listing-analytics .analytics-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal heart button uses shared heart-button.css styles */
#modalSaveBtn {
    /* Inherits from .heart-btn.heart-btn-lg in heart-button.css */
}
