/* ============================================================================
   ARAÇ KARŞILAŞTIRMA — paylaşılan stiller
   Kullanan yüzeyler: /ikinci-el listesi, araç detay (benzer araçlar),
   anasayfa (yeni gelen araçlar). Global olarak _Layout üzerinden yüklenir.
   NOT: Kart üstündeki .compare-checkbox + .compare-label kartların içinde,
   floating bar + modal markup'ı _Karsilastirma.cshtml içinde bulunur.
   ============================================================================ */

/* === Kart üstü seçim kontrolü === */
.compare-checkbox-wrapper {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.compare-checkbox {
    display: none;
}

.compare-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.95);
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

    .compare-label:hover {
        border-color: #0078d6;
        transform: scale(1.1);
    }

.compare-label svg {
    width: 16px;
    height: 16px;
    opacity: 0.4;
    transition: all 0.2s ease;
}

.compare-checkbox:checked + .compare-label {
    background: #0078d6;
    border-color: #0078d6;
}

.compare-checkbox:checked + .compare-label svg {
    opacity: 1;
    color: #fff;
    fill: #fff;
    stroke: #fff;
}

.compare-checkbox:disabled + .compare-label {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Floating Compare Bar */
#compare-floating-bar {
    position: fixed;
    bottom: 24px;
    right: 100px;
    z-index: 1000;
    display: none;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.compare-bar-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.08);
}

.compare-preview-cars {
    display: flex;
    gap: -8px;
}

.compare-preview-item {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    /*overflow: hidden;*/
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin-left: -8px;
}

.compare-preview-item:first-child {
    margin-left: 0;
}

.compare-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius:10px;
}

.compare-preview-item .remove-preview {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index:9999;
}

.compare-preview-item:hover .remove-preview {
    opacity: 1;
}

.compare-preview-item .remove-preview svg {
    width: 10px;
    height: 10px;
    stroke: #fff;
    stroke-width: 3;
}

.compare-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0078d6;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    padding: 12px 24px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

    .compare-btn:hover {
        background: #006abc;
        transform: scale(1.02);
    }

.compare-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* === KARŞILAŞTIRMA POPUP === */
#compare-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#compare-modal-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

#compare-modal-overlay.visible {
    opacity: 1;
}

#compare-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

#compare-modal-overlay.visible #compare-modal {
    transform: translateY(0);
}

.compare-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    border-radius: 16px 16px 0 0;
}

.compare-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.compare-modal-title h2 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    text-transform:unset;
}

    .compare-modal-title span {
        color: #0078d6;
    }

.compare-modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0078d6;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    background: #006abc;
}

.close-modal-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    background: #e5e7eb;
}

.compare-modal-body {
    padding: 24px;
}

/* Tek tablo yapısı - hizalı kolonlar */
.compare-full-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.compare-full-table colgroup .col-label {
    width: 180px;
}

.compare-full-table colgroup .col-car {
    width: auto;
}

/* Araç Header Satırı */
.compare-full-table .car-header-row td {
    padding: 16px;
    vertical-align: top;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.compare-full-table .car-header-row td:first-child {
    background: transparent;
    border-bottom: 2px solid #e5e7eb;
}

.compare-car-cell {
    text-align: center;
}

.compare-car-cell img {
    width: 100%;
    max-width: 280px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.compare-car-price {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.compare-car-name {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

/* Bölüm Başlıkları */
.compare-full-table .section-header-row td {
    background: #e8eef3;
    color: #0078d6;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 16px;
    text-align: left;
}

/* Veri Satırları */
.compare-full-table .data-row td {
    padding: 12px 16px;
    font-size: 14px;
    color: #374151;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
}

.compare-full-table .data-row td:first-child {
    text-align: left;
    font-weight: 500;
    color: #6b7280;
    background: #fafafa;
}

.compare-full-table .data-row:last-child td {
    border-bottom: none;
}

.compare-full-table .data-row td.highlight {
        background: #f6f8fa;
        color: #0078d6;
        font-weight: 600;
    }

/* Share Dropdown */
.share-dropdown {
    position: relative;
}

.share-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 8px;
    min-width: 200px;
    display: none;
    z-index: 100;
}

.share-dropdown-menu.active {
    display: block;
}

.share-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.share-dropdown-item:hover {
    background: #f3f4f6;
}

.share-dropdown-item svg {
    width: 20px;
    height: 20px;
}

.share-dropdown-item.whatsapp svg { color: #25D366; }
.share-dropdown-item.copy svg { color: #6b7280; }

/* Loading overlay */
.compare-loading {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.9);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.compare-loading.active {
    display: flex;
}

.compare-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #0078d6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.compare-loading-text {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
}

/* Toast notification */
.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10002;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   RESPONSIVE TASARIM - TABLET (max-width: 992px)
   ============================================ */
@media (max-width: 992px) {
    .compare-modal-header {
        padding: 16px 20px;
    }

    .compare-modal-title h2 {
        font-size: 18px;
    }

    .share-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .compare-modal-body {
        padding: 16px;
    }

    .compare-full-table .car-header-row td {
        padding: 12px;
    }

    .compare-car-cell img {
        height: 120px;
    }

    .compare-car-price {
        font-size: 20px;
    }

    .compare-car-name {
        font-size: 14px;
    }

    .compare-full-table .data-row td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .compare-full-table colgroup .col-label {
        width: 140px;
    }
}

/* ============================================
   RESPONSIVE TASARIM - MOBİL (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    /* Floating Bar - Mobil */
    #compare-floating-bar {
        bottom: 20px;
        right: 12px;
        left: 12px;
    }

    .compare-bar-content {
        width: 70%;
        justify-content: space-between;
        padding: 8px 12px;
        gap: 8px;
    }

    .compare-preview-item {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .compare-btn {
        padding: 10px 16px;
        font-size: 13px;
        gap: 6px;
    }

    .compare-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Modal Overlay - Mobil */
    #compare-modal-overlay.active {
        padding: 0;
        align-items: flex-end;
    }

    #compare-modal {
        margin: 0;
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        animation: slideUpModal 0.3s ease;
    }

    @keyframes slideUpModal {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    /* Modal Header - Mobil */
    .compare-modal-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
        border-radius: 20px 20px 0 0;
    }

    .compare-modal-header::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #d1d5db;
        border-radius: 2px;
        margin: 0 auto 8px;
        flex-basis: 100%;
    }

    .compare-modal-title {
        flex: 1;
        min-width: 0;
    }

    .compare-modal-title h2 {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .compare-modal-actions {
        gap: 8px;
    }

    .share-btn {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 6px;
    }

    .share-btn svg {
        width: 14px;
        height: 14px;
    }

    .share-btn .share-btn-text {
        display: none;
    }

    .share-btn::after {
        content: 'Paylaş';
        font-size: 12px;
    }

    .close-modal-btn {
        width: 32px;
        height: 32px;
    }

    .close-modal-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Modal Body - Mobil */
    .compare-modal-body {
        padding: 8px;
        overflow-x: auto;
    }

    /* Tablo - Mobil Yatay Scroll */
    .compare-full-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .compare-full-table::-webkit-scrollbar {
        height: 4px;
    }

    .compare-full-table::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }

    .compare-full-table::-webkit-scrollbar-thumb {
        background: #0078d6;
        border-radius: 2px;
    }

    .compare-full-table colgroup .col-label {
        width: 100px;
    }

    .compare-full-table .car-header-row td {
        padding: 10px;
        min-width: 140px;
    }

    .compare-full-table .car-header-row td:first-child {
        min-width: 100px;
        position: sticky;
        left: 0;
        z-index: 2;
        background: #fff;
    }

    .compare-car-cell img {
        height: 80px;
        max-width: 120px;
        margin-bottom: 8px;
    }

    .compare-car-price {
        font-size: 14px;
        margin-bottom: 2px;
    }

    .compare-car-name {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }

    /* Veri Satırları - Mobil */
    .compare-full-table .section-header-row td {
        font-size: 12px;
        padding: 8px 12px;
        position: sticky;
        left: 0;
        z-index: 2;
        background: #e8eef3;
    }

    .compare-full-table .data-row td {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
        min-width: 120px;
    }

    .compare-full-table .data-row td:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
        min-width: 100px;
        max-width: 100px;
        white-space: normal;
        word-break: break-word;
        font-size: 11px;
        background: #f5f5f5;
        border-right: 1px solid #e5e7eb;
    }

    /* Share Dropdown - Mobil */
    .share-dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 16px 16px 0 0;
        padding: 12px;
        min-width: auto;
        z-index: 10001;
        animation: slideUpDropdown 0.2s ease;
    }

    @keyframes slideUpDropdown {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    .share-dropdown-menu::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #d1d5db;
        border-radius: 2px;
        margin: 0 auto 12px;
    }

    .share-dropdown-item {
        padding: 14px 16px;
        font-size: 15px;
    }

    /* Toast - Mobil */
    .toast-notification {
        bottom: 80px;
        left: 16px;
        right: 16px;
        transform: translateX(0) translateY(100px);
        text-align: center;
    }

    .toast-notification.show {
        transform: translateX(0) translateY(0);
    }
}

/* ============================================
   RESPONSIVE TASARIM - KÜÇÜK MOBİL (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    #compare-floating-bar {
        bottom: 12px;
        right: 8px;
        left: 8px;
    }

    .compare-bar-content {
        padding: 6px 10px;
    }

    .compare-preview-item {
        width: 32px;
        height: 32px;
    }

    .compare-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    #compare-modal {
        max-height: 92vh;
    }

    .compare-modal-header {
        padding: 10px 12px;
    }

    .compare-modal-title h2 {
        font-size: 14px;
    }

    .compare-modal-body {
        padding: 6px;
    }

    .compare-full-table .car-header-row td {
        padding: 8px;
        min-width: 110px;
    }

    .compare-car-cell img {
        height: 60px;
        max-width: 100px;
    }

    .compare-car-price {
        font-size: 12px;
    }

    .compare-car-name {
        font-size: 10px;
        max-width: 100px;
    }

    .compare-full-table .section-header-row td {
        font-size: 11px;
        padding: 6px 10px;
    }

    .compare-full-table .data-row td {
        padding: 6px 8px;
        font-size: 11px;
        min-width: 100px;
    }

    .compare-full-table .data-row td:first-child {
        min-width: 80px;
        max-width: 80px;
        font-size: 10px;
    }

    .close-modal-btn {
        width: 28px;
        height: 28px;
    }

    .share-btn {
        padding: 6px 10px;
    }
}

/* ============================================
   LANDSCAPE MOBİL
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
    #compare-modal {
        max-height: 90vh;
    }

    .compare-full-table .car-header-row td {
        min-width: 160px;
    }

    .compare-car-cell img {
        height: 70px;
    }
}

/* ============================================================================
   MH MARKA GÖRÜNÜMÜ — kart footer'ında fiyat yanı minimal ink ikon + ink çubuk/modal.
   Tüm yüzeylerde aynı (liste / yeni gelen / benzer). .vc kartlarına uygulanır.
   ============================================================================ */
.vc__actions .compare-checkbox { display: none; }

.vc__actions .compare-label {
    width: auto;
    height: auto;
    padding: 5px;
    border: 0 !important;
    border-radius: 8px;
    background: none !important;
    box-shadow: none !important;
    color: var(--gri, #8B8C8E);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

    .vc__actions .compare-label svg { width: 20px; height: 20px; opacity: 1 !important; color: inherit; }
    .vc__actions .compare-label:hover { color: var(--ink, #14171A); background: var(--soft, #F5F6F8) !important; transform: none; }

.vc__actions .compare-checkbox:checked + .compare-label {
    background: var(--soft, #F5F6F8) !important;
    color: var(--ink, #14171A);
    border-color: transparent !important;
}

/* Karşılaştırma çubuğu + modal — ink */
.compare-btn { background: var(--ink, #14171A) !important; }
    .compare-btn:hover { background: var(--gri-dark, #6A6C6E) !important; }
.share-btn { background: var(--ink, #14171A) !important; }
    .share-btn:hover { background: var(--gri-dark, #6A6C6E) !important; }
.compare-full-table .data-row td.highlight { color: var(--ink, #14171A) !important; }
.compare-car-price { color: var(--ink, #14171A) !important; }
.compare-loading-spinner { border-top-color: var(--ink, #14171A) !important; }
.compare-modal-title h2 span { color: var(--ink, #14171A) !important; }
.share-dropdown-item.whatsapp svg { color: #25D366 !important; }
