/**
 * Mixcar React Components Styles
 * 
 * Lightweight styles for React components
 * Maintains original Mixcar design while adding React functionality
 * 
 * @package Mixcar_Plugins
 * @since 2.0.0
 */

/* ========================================
   Base Styles
   ======================================== */
.mixcar-react-component {
    position: relative;
}

.mixcar-react-app {
    display: none;
}

/* ========================================
   Vehicle Comparison Widget
   ======================================== */
.mixcar-comparison-widget-react {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.mixcar-compare-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.mixcar-compare-header h2 {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 700;
    color: #181d4d;
}

.mixcar-compare-header p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

.mixcar-compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.mixcar-compare-card {
    position: relative;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.mixcar-compare-card:hover {
    border-color: #38b981;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.mixcar-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #dc3545;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mixcar-remove-btn:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

.mixcar-vehicle-image {
    height: 200px;
    background: #fff;
    overflow: hidden;
}

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

.mixcar-compare-card:hover .mixcar-vehicle-image img {
    transform: scale(1.05);
}

.mixcar-vehicle-info {
    padding: 20px;
}

.mixcar-brand-badge {
    display: inline-block;
    background: #38b981;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.mixcar-vehicle-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.mixcar-price {
    font-size: 20px;
    font-weight: 700;
    color: #181d4d;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mixcar-currency-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.mixcar-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mixcar-specs span,
.spec-item {
    background: #f5f5f5;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

/* Add Vehicle Card */
.mixcar-add-vehicle-card {
    border: 2px dashed #ccc;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.mixcar-add-vehicle-card:hover {
    border-color: #38b981;
    background: #f0f8ff;
}

.mixcar-add-content {
    text-align: center;
    color: #666;
}

.mixcar-add-content i {
    font-size: 48px;
    margin-bottom: 10px;
    color: #38b981;
}

.mixcar-add-content p {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.mixcar-add-content span {
    font-size: 14px;
    color: #999;
}

/* ========================================
   Comparison Table
   ======================================== */
.mixcar-comparison-table {
    margin-top: 40px;
}

.mixcar-comparison-table > h2 {
    margin: 0 0 30px 0;
    font-size: 28px;
    font-weight: 700;
    color: #181d4d;
    text-align: center;
}

.mixcar-spec-category {
    margin-bottom: 30px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.mixcar-category-header {
    background: linear-gradient(135deg, #38b981 0%, #2d9668 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mixcar-category-header i {
    font-size: 20px;
}

.mixcar-category-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.mixcar-spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1px;
    background: #e0e0e0;
}

.mixcar-spec-column {
    background: white;
    padding: 20px;
}

.mixcar-spec-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mixcar-spec-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
}

.mixcar-spec-list li:last-child {
    border-bottom: none;
}

.mixcar-spec-list li i {
    color: #38b981;
    margin-right: 8px;
}

/* ========================================
   Modal
   ======================================== */
.mixcar-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mixcar-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.mixcar-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.mixcar-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #181d4d;
}

.mixcar-modal-close {
    width: 32px;
    height: 32px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #666;
    transition: all 0.2s ease;
}

.mixcar-modal-close:hover {
    background: #dc3545;
    color: white;
}

.mixcar-modal-body {
    padding: 20px 30px;
    overflow-y: auto;
    flex: 1;
}

.mixcar-search-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.mixcar-search-input:focus {
    outline: none;
    border-color: #38b981;
}

.mixcar-vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mixcar-vehicle-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mixcar-vehicle-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.mixcar-vehicle-thumb {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.mixcar-vehicle-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mixcar-vehicle-details {
    flex: 1;
}

.mixcar-vehicle-details h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.mixcar-price-small {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.mixcar-add-btn-small {
    width: 32px;
    height: 32px;
    background: #38b981;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s ease;
}

.mixcar-add-btn-small:hover {
    background: #2d9668;
    transform: scale(1.1);
}

/* ========================================
   Vehicle Card
   ======================================== */
.mixcar-vehicle-card-react {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mixcar-vehicle-card-react:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    border-color: #38b981;
}

.mixcar-card-image {
    height: 200px;
    background: #f5f5f5;
    overflow: hidden;
}

.mixcar-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mixcar-vehicle-card-react:hover .mixcar-card-image img {
    transform: scale(1.05);
}

.mixcar-card-content {
    padding: 20px;
}

.mixcar-compare-btn {
    width: 100%;
    padding: 12px 20px;
    background: #38b981;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-top: 15px;
}

.mixcar-compare-btn:hover {
    background: #2d9668;
}

.mixcar-compare-btn.active {
    background: #dc3545;
}

.mixcar-compare-btn.active:hover {
    background: #c82333;
}

/* ========================================
   Search Filter
   ======================================== */
.mixcar-search-filter-react {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.mixcar-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.mixcar-filter-select,
.mixcar-filter-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.mixcar-filter-select:focus,
.mixcar-filter-input:focus {
    outline: none;
    border-color: #38b981;
}

.mixcar-filter-submit,
.mixcar-filter-reset {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.mixcar-filter-submit {
    background: #38b981;
    color: white;
}

.mixcar-filter-submit:hover {
    background: #2d9668;
}

.mixcar-filter-reset {
    background: #f5f5f5;
    color: #666;
}

.mixcar-filter-reset:hover {
    background: #e0e0e0;
}

/* ========================================
   Loading & Empty States
   ======================================== */
.mixcar-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.mixcar-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* ========================================
   RTL Support
   ======================================== */
.rtl .mixcar-remove-btn {
    right: auto;
    left: 10px;
}

.rtl .mixcar-vehicle-item:hover {
    transform: translateX(-5px);
}

.rtl .mixcar-spec-list li i {
    margin-right: 0;
    margin-left: 8px;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .mixcar-comparison-widget-react {
        padding: 20px 15px;
    }
    
    .mixcar-compare-header h2 {
        font-size: 24px;
    }
    
    .mixcar-compare-grid {
        grid-template-columns: 1fr;
    }
    
    .mixcar-spec-grid {
        grid-template-columns: 1fr;
    }
    
    .mixcar-modal-content {
        max-width: 95%;
    }
    
    .mixcar-modal-header,
    .mixcar-modal-body {
        padding: 15px 20px;
    }
    
    .mixcar-filter-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .mixcar-remove-btn,
    .mixcar-add-vehicle-card,
    .mixcar-compare-btn,
    .mixcar-search-filter-react {
        display: none;
    }
}
