/* 
    Arabam Şarj - Canlı Yardım Widget Tasarımı
    Glassmorphism & Modern UI 
*/

:root {
    --support-primary: #3b82f6;
    --support-bg: rgba(30, 41, 59, 0.7);
    --support-glass: rgba(255, 255, 255, 0.1);
    --support-text: #f8fafc;
}

#support-widget-container {
    position: fixed;
    bottom: 110px; /* Alttaki harita/rota kontrolleriyle çakışmaması için biraz daha yukarı çektik */
    right: 30px;
    z-index: 2147483647 !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Floating Button */
.support-trigger {
    width: 60px;
    height: 60px;
    background: var(--support-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.support-trigger:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
}

.support-trigger i {
    color: white;
    font-size: 24px;
}

/* Badge for notifications */
.support-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid #1e293b;
    display: none;
}

/* Chat Window */
.support-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: var(--support-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--support-glass);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    z-index: 2147483647 !important;
}

.support-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Header */
.support-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.7), rgba(37, 99, 235, 0.7));
    border-bottom: 1px solid var(--support-glass);
    display: flex;
    align-items: center;
    gap: 12px;
}

.support-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.support-avatar i {
    color: white;
    font-size: 20px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.4));
    animation: pulse-bolt 2s infinite ease-in-out;
}

@keyframes pulse-bolt {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.9; }
}

.support-info h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.01em;
}

#clearChat {
    background: none;
    border: none;
    color: #ef4444; /* Kırmızı/Renkli */
    cursor: pointer;
    margin-left: auto;
    padding: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.support-status {
    font-size: 12px;
    color: #4ade80; /* Varsayılan yeşil (Online) */
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80; /* Yeşil */
    border-radius: 50%;
    box-shadow: 0 0 10px #4ade80;
    transition: all 0.3s;
}

.status-dot.offline {
    background: #ef4444 !important; /* Kırmızı */
    box-shadow: 0 0 10px #ef4444 !important;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.support-status.offline {
    color: #ef4444 !important; /* Kırmızı */
}

.support-trigger.offline {
    background: #475569;
    filter: grayscale(0.5);
    opacity: 0.8;
}

/* Chat Body */
.support-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--support-glass) transparent;
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 5px 0 15px 0;
    animation: fadeIn 0.5s ease;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--support-glass);
}

.btn-quick {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-quick:hover {
    background: var(--support-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

/* Messages */
.msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideIn 0.3s ease-out;
}

.msg-bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-bottom-left-radius: 4px;
}

.msg-user {
    align-self: flex-end;
    background: var(--support-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

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

/* Footer Input */
.support-footer {
    padding: 15px;
    background: rgba(15, 23, 42, 0.3);
    border-top: 1px solid var(--support-glass);
}

.input-group {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--support-glass);
}

#support-input {
    background: transparent;
    border: none;
    color: white;
    flex: 1;
    padding: 8px;
    outline: none;
    font-size: 14px;
}

.btn-send {
    background: var(--support-primary);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-send:hover {
    transform: scale(1.05);
    background: #2563eb;
}

#clearChat {
    opacity: 0.6;
    transition: all 0.2s;
}

#clearChat:hover {
    opacity: 1;
    color: #ef4444 !important;
    transform: scale(1.1);
}

.typing .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    margin-right: 3px;
    animation: typing 1.4s infinite;
}

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Confirm Modal - Full Screen Fixed */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2147483647; /* En üstte olmalı */
    opacity: 0;
    transition: all 0.3s ease;
}

.confirm-modal.active {
    opacity: 1;
}

.confirm-content {
    background: #1e293b;
    padding: 35px 25px;
    border-radius: 28px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 90%;
    max-width: 340px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    transform: scale(0.85);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-modal.active .confirm-content {
    transform: scale(1);
}

.confirm-content p {
    color: white;
    margin: 0 0 20px 0;
    font-size: 15px;
    line-height: 1.4;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions button {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

#confirm-yes {
    background: #ef4444;
    color: white;
}

#confirm-yes:hover {
    background: #dc2626;
}

#confirm-no {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

#confirm-no:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Markdown Elements */
.chat-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa !important;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid rgba(96, 165, 250, 0.3);
    margin-top: 8px;
    font-size: 13px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer !important;
    pointer-events: auto !important;
}

.chat-link:hover {
    background: var(--support-primary);
    color: white !important;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.chat-link::before {
    content: '\f3c5'; /* FontAwesome Map Marker */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 10px 0;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

th {
    background: rgba(59, 130, 246, 0.3);
    padding: 10px;
    color: #93c5fd;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

tr:last-child td {
    border-bottom: none;
}

strong {
    color: var(--support-primary);
    font-weight: 700;
}

/* Responsive Customizations */
@media (max-width: 480px) {
    .support-window {
        width: calc(100vw - 20px);
        height: 75vh;
        bottom: 80px;
        right: 10px;
    }
    
    .confirm-modal {
        align-items: flex-start; /* Üstten başla */
        padding-top: 15vh; /* Biraz boşluk bırak */
    }

    .confirm-content {
        max-width: 85%;
        padding: 25px 20px;
    }

    #support-widget-container {
        bottom: 160px !important; /* Rota alt paneli açıldığında dahi üstte ve görünür kalması için */
        right: 15px !important;
        z-index: 2147483647 !important;
    }
    .support-trigger {
        width: 52px !important;
        height: 52px !important;
        z-index: 2147483647 !important;
    }
    .support-trigger i {
        font-size: 20px !important;
    }
}
