/*
 * Galeri Işık — Site Geneli Özelleştirmeler
 *
 * TURUNCU BUTON STANDARDI
 * Referans: _SearchBar.cshtml › sell-cta-button
 *   bg  : var(--bs-brand-2) = #fe5708
 *   text: #ffffff (beyaz)
 *
 * main.css'teki btn-primary ve btn-brand-2 tanımları
 * tema dosyasından geldiği için yazı rengi siyah/koyu.
 * Bu dosya o tanımları beyaz yazıya override eder.
 */

/* ─── Turuncu buton: beyaz yazı + beyaz SVG ──────────────────────── */

.btn.btn-primary {
    color: var(--bs-white) !important;
}

.btn.btn-primary svg,
.btn.btn-primary svg path {
    stroke: currentColor;
}

.btn.btn-primary:hover {
    color: var(--bs-white) !important;
}

.btn.btn-primary:hover svg,
.btn.btn-primary:hover svg path {
    stroke: currentColor;
}

/* btn-brand-2 (arama çubuğu "Ara" butonu vb.) */

.btn.btn-brand-2 {
    color: var(--bs-white) !important;
}

.btn.btn-brand-2 svg,
.btn.btn-brand-2 svg path {
    stroke: currentColor;
}

.btn.btn-brand-2:hover {
    color: var(--bs-white) !important;
}

/* ─── SellVehicle wizard: btn-primary zaten eziyet etmeden devral ─── */
/* SellVehicle.cshtml kendi #sellVehicleWizard .btn-primary stilini
   tanımladığından çakışma olmaz; wizard butonları zaten renk alır. */

/* ─── AI Chat Widget ─────────────────────────────────────────────── */

.ai-chat-widget {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

/* Toggle button */
.ai-chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #fe5708, #ff8a50);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(254,87,8,0.4);
    transition: all 0.3s ease;
}

.ai-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(254,87,8,0.5);
}

.ai-chat-toggle--active {
    background: linear-gradient(135deg, #333, #555);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Panel */
.ai-chat-panel {
    width: min(380px, calc(100vw - 2rem));
    border-radius: 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    max-height: min(560px, 75vh);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.ai-chat-panel--open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Header */
.ai-chat-header {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #fff;
    padding: 1rem 1.125rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 1rem 1rem 0 0;
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fe5708, #ff8a50);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-chat-header-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.ai-chat-header-status {
    font-size: 0.75rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ai-chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
    animation: aiPulse 2s infinite;
}

@keyframes aiPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.ai-chat-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-chat-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Messages */
.ai-chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8f9fb;
    scrollbar-width: thin;
}

.ai-chat-msg {
    display: flex;
    gap: 0.5rem;
    max-width: 88%;
    animation: aiMsgIn 0.3s ease;
}

@keyframes aiMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-chat-msg--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-chat-msg--error {
    align-self: flex-start;
}

.ai-chat-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-chat-msg-bubble {
    padding: 0.625rem 0.875rem;
    border-radius: 1rem;
    font-size: 0.84rem;
    line-height: 1.55;
    word-wrap: break-word;
}

.ai-chat-msg--ai .ai-chat-msg-bubble {
    background: #fff;
    color: #1a1a1a;
    border-bottom-left-radius: 0.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.ai-chat-msg--user .ai-chat-msg-bubble {
    background: linear-gradient(135deg, #fe5708, #ff8a50);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}

.ai-chat-msg--error .ai-chat-msg-bubble {
    background: #fff0f0;
    color: #c0392b;
    font-size: 0.8rem;
}

/* Quick replies */
.ai-chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-left: 2.25rem;
}

.ai-chat-quick-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ai-chat-quick-btn:hover {
    border-color: #fe5708;
    color: #fe5708;
    background: #fff7f3;
}

/* Typing */
.ai-chat-typing {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: #f8f9fb;
}

.ai-chat-typing.active {
    display: flex;
}

.ai-chat-typing-dots {
    display: flex;
    gap: 0.25rem;
}

.ai-chat-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: aiTypingBounce 1.2s infinite ease-in-out;
}

.ai-chat-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.ai-chat-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes aiTypingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Input */
.ai-chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0.875rem;
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

.ai-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 1.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.84rem;
    outline: none;
    background: #f8f9fb;
    color: #1a1a1a;
    transition: border-color 0.2s;
}

.ai-chat-input:focus {
    border-color: #fe5708;
    background: #fff;
}

.ai-chat-input::placeholder {
    color: #94a3b8;
}

.ai-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #fe5708, #ff8a50);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-chat-send:hover {
    transform: scale(1.05);
}

.ai-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.ai-chat-footer {
    text-align: center;
    padding: 0.4rem;
    font-size: 0.65rem;
    color: #94a3b8;
    background: #fff;
    border-radius: 0 0 1rem 1rem;
}

/* ─── Mobile responsive ─────────────────────────────────────────── */

@media (max-width: 767.98px) {
    .ai-chat-widget {
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .ai-chat-panel {
        width: calc(100vw - 1.5rem);
        max-height: min(480px, 70vh);
    }

    .ai-chat-toggle {
        width: 50px;
        height: 50px;
    }

    .ai-chat-messages {
        max-height: 280px;
    }
}

/* ─── Slider background fix ──────────────────────────────────────── */

.item-banner-slide {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

/* ─── Car detail gallery fix ─────────────────────────────────────── */
/* Gallery mobile fix is now in CarDetail.cshtml inline <style> for specificity */

/* ─── Mobile header: hamburger menu sağda ────────────────────────── */

@media (max-width: 1399.98px) {
    .header .main-header {
        justify-content: space-between;
    }
}

/* ─── Car Detail page fixes ─────────────────────────────────────── */

.vehicle-summary-card {
    border-radius: 0.75rem;
    scrollbar-width: thin;
}

.vehicle-summary-card::-webkit-scrollbar {
    width: 4px;
}

.vehicle-summary-card::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

@media (max-width: 991.98px) {
    .vehicle-summary-card {
        position: static !important;
        max-height: none !important;
        overflow-y: visible !important;
    }

    #mobileDetailTabs .nav-link {
        color: #64748b;
        border: none;
        border-bottom: 2px solid transparent;
        padding: 0.6rem 0.5rem;
    }

    #mobileDetailTabs .nav-link.active {
        color: #0f172a;
        border-bottom-color: var(--bs-brand-2, #fe5708);
        background: transparent;
    }

    /* Alt bar icin sayfa sonu bosluğu */
    body {
        padding-bottom: 70px;
    }
}
