/**
 * NAMA Chatbot CSS
 * WordPress için chatbot stilleri
 */

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

/* Chatbot Button */
.nama-chatbot-button {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999998; /* WhatsApp butonunun üzerinde olması için yüksek değer */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.nama-chatbot-button:hover {
    transform: scale(1.1);
}

.nama-chatbot-button:active {
    transform: scale(0.95);
}

.nama-chatbot-button-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nama-chatbot-button-ping {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(to right, #2563eb, #4f46e5);
    opacity: 0.4;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.nama-chatbot-button-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(to right, #2563eb, #4f46e5);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
    color: white;
    transition: all 0.2s;
}

.nama-chatbot-status-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nama-chatbot-status-dot::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #10b981;
    opacity: 0.75;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.nama-chatbot-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #111827;
    color: white;
    font-size: 14px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.nama-chatbot-button:hover .nama-chatbot-tooltip {
    opacity: 1;
}

.nama-chatbot-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 16px;
    border: 4px solid transparent;
    border-top-color: #111827;
}

/* Chatbot Window */
.nama-chatbot-window {
    position: fixed;
    bottom: 90px;
    left: 24px;
    z-index: 999999;
    width: 450px; /* Genişlik artırıldı: 380px -> 450px */
    max-width: calc(100vw - 48px);
    height: 700px; /* Yükseklik artırıldı: 600px -> 700px */
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    visibility: hidden;
}

/* Chatbot açıkken */
.nama-chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}

/* Büyük ekranlar için daha da büyük boyut (Opsiyonel) */
@media (min-width: 1280px) {
    .nama-chatbot-window {
        width: 500px;
        height: 750px;
    }
}

@media (max-width: 768px) {
    .nama-chatbot-button {
        bottom: 20px;
        left: 20px;
        right: auto;
    }

    .nama-chatbot-window {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.95);
        width: calc(100vw - 32px);
        height: calc(100vh - 80px);
        max-width: calc(100vw - 32px);
        max-height: calc(100vh - 80px);
        border-radius: 16px;
        margin: 0;
        border: 1px solid #e5e7eb;
        z-index: 2147483647; /* Maksimum z-index değeri */
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
    
    .nama-chatbot-window.active {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        pointer-events: auto;
        visibility: visible;
    }

    .nama-chatbot-header {
        padding: 12px 16px;
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .nama-chatbot-messages {
        padding: 12px;
        height: 100%;
    }

    .nama-chatbot-input-container {
        padding: 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

/* Header */
.nama-chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(to right, #2563eb, #4f46e5);
}

.nama-chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nama-chatbot-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.nama-chatbot-status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #2563eb;
}

.nama-chatbot-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nama-chatbot-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    margin: 0;
}

.nama-chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nama-chatbot-icon-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nama-chatbot-icon-button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

/* Messages */
.nama-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nama-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.nama-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.nama-chatbot-messages::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 10px;
}

.nama-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.7);
}

.nama-chatbot-message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease-out;
}

.nama-chatbot-message-user {
    justify-content: flex-end;
}

.nama-chatbot-message-assistant {
    justify-content: flex-start;
}

.nama-chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(to bottom right, #3b82f6, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nama-chatbot-message-avatar-user {
    background: linear-gradient(to bottom right, #9ca3af, #6b7280);
}

.nama-chatbot-message-content {
    max-width: 80%;
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.nama-chatbot-message-user .nama-chatbot-message-content {
    background: linear-gradient(to right, #2563eb, #4f46e5);
    color: white;
    border-bottom-left-radius: 4px;
}

.nama-chatbot-message-assistant .nama-chatbot-message-content {
    background: white;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-bottom-right-radius: 4px;
}

.nama-chatbot-message-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.nama-chatbot-message-markdown {
    font-size: 14px;
    line-height: 1.5;
}

.nama-chatbot-message-markdown p {
    margin: 0 0 8px 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.nama-chatbot-message-markdown p:last-child {
    margin-bottom: 0;
}

.nama-chatbot-message-markdown strong {
    font-weight: 600;
    color: #1e40af;
}

.nama-chatbot-message-markdown a {
    color: #2563eb;
    text-decoration: underline;
    word-break: break-all;
}

.nama-chatbot-message-markdown a:hover {
    color: #1d4ed8;
}

.nama-chatbot-message-markdown h1 {
    font-size: 18px;
    font-weight: 700;
    margin: 12px 0 8px 0;
    word-break: break-word;
}

.nama-chatbot-message-markdown h1:first-child {
    margin-top: 0;
}

.nama-chatbot-message-markdown h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 12px 0 8px 0;
    word-break: break-word;
}

.nama-chatbot-message-markdown h2:first-child {
    margin-top: 0;
}

.nama-chatbot-message-markdown h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 8px 0 4px 0;
    word-break: break-word;
}

.nama-chatbot-message-markdown h3:first-child {
    margin-top: 0;
}

.nama-chatbot-message-markdown ul,
.nama-chatbot-message-markdown ol {
    margin: 8px 0;
    padding-left: 20px;
}

.nama-chatbot-message-markdown li {
    margin: 4px 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Loading */
.nama-chatbot-loading {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nama-chatbot-loading span:not(.nama-chatbot-loading-text) {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    animation: bounce 1.4s ease-in-out infinite;
}

.nama-chatbot-loading span:nth-child(1) {
    animation-delay: 0ms;
}

.nama-chatbot-loading span:nth-child(2) {
    animation-delay: 150ms;
}

.nama-chatbot-loading span:nth-child(3) {
    animation-delay: 300ms;
}

.nama-chatbot-loading-text {
    margin-left: 8px;
    font-size: 12px;
    color: #6b7280;
}

/* Quick Questions */
.nama-chatbot-quick-questions {
    padding: 0 16px 16px;
    background: #f9fafb;
}

.nama-chatbot-quick-questions-title {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    margin: 0 0 12px 4px;
}

.nama-chatbot-quick-questions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.nama-chatbot-quick-question {
    text-align: left;
    font-size: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #374151;
}

.nama-chatbot-quick-question:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
    transform: scale(1.02);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nama-chatbot-quick-question:active {
    transform: scale(0.98);
}

/* Input */
.nama-chatbot-input-container {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.nama-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.nama-chatbot-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.nama-chatbot-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nama-chatbot-send-button {
    padding: 12px 20px;
    background: linear-gradient(to right, #2563eb, #4f46e5);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nama-chatbot-send-button:hover:not(:disabled) {
    background: linear-gradient(to right, #1d4ed8, #4338ca);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.nama-chatbot-send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.nama-chatbot-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .nama-chatbot-window {
        background: #1f2937;
        border-color: #374151;
    }

    .nama-chatbot-messages {
        background: #111827;
    }

    .nama-chatbot-message-assistant .nama-chatbot-message-content {
        background: #1f2937;
        color: #f9fafb;
        border-color: #374151;
    }

    .nama-chatbot-message-markdown strong {
        color: #60a5fa;
    }

    .nama-chatbot-message-markdown a {
        color: #60a5fa;
    }

    .nama-chatbot-input-container {
        background: #1f2937;
        border-color: #374151;
    }

    .nama-chatbot-input {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }

    .nama-chatbot-quick-questions {
        background: #111827;
    }

    .nama-chatbot-quick-question {
        background: #1f2937;
        border-color: #374151;
        color: #d1d5db;
    }

    .nama-chatbot-quick-question:hover {
        background: #1e3a8a;
        border-color: #3b82f6;
        color: #60a5fa;
    }
}

/* Navigate Onay Kutusu */
.nama-chatbot-navigate-confirm {
    margin-top: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 12px;
    animation: fadeIn 0.3s ease-out;
}

.nama-chatbot-navigate-text {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #1e40af;
    font-weight: 500;
}

.nama-chatbot-navigate-buttons {
    display: flex;
    gap: 8px;
}

.nama-chatbot-navigate-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.nama-chatbot-navigate-yes {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.nama-chatbot-navigate-yes:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.nama-chatbot-navigate-yes:active {
    transform: translateY(0);
}

.nama-chatbot-navigate-no {
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.nama-chatbot-navigate-no:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #9ca3af;
}

/* Dark mode için navigate onay kutusu */
@media (prefers-color-scheme: dark) {
    .nama-chatbot-navigate-confirm {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
        border-color: #3b82f6;
    }

    .nama-chatbot-navigate-text {
        color: #93c5fd;
    }

    .nama-chatbot-navigate-no {
        background: #374151;
        color: #d1d5db;
        border-color: #4b5563;
    }

    .nama-chatbot-navigate-no:hover {
        background: #4b5563;
        color: #f3f4f6;
    }
}

