/* Tarih Chatbot Stilleri */

/* Floating Widget Container */
.tarih-chatbot-floating-widget {
    position: fixed;
    z-index: 9999;
    bottom: 20px;
}

.tarih-chatbot-floating-widget[data-position="bottom-right"] {
    right: 20px;
}

.tarih-chatbot-floating-widget[data-position="bottom-left"] {
    left: 20px;
}

/* Welcome Bubble */
.tarih-chatbot-welcome-bubble {
    position: absolute;
    bottom: 75px;
    background: #fff;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    max-width: 280px;
    animation: bubbleSlideIn 0.5s ease-out 1s both;
    z-index: 9998;
}

.tarih-chatbot-floating-widget[data-position="bottom-right"] .tarih-chatbot-welcome-bubble {
    right: 0;
}

.tarih-chatbot-floating-widget[data-position="bottom-left"] .tarih-chatbot-welcome-bubble {
    left: 0;
}

.tarih-chatbot-welcome-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #fff;
}

.tarih-chatbot-floating-widget[data-position="bottom-right"] .tarih-chatbot-welcome-bubble::after {
    right: 20px;
}

.tarih-chatbot-floating-widget[data-position="bottom-left"] .tarih-chatbot-welcome-bubble::after {
    left: 20px;
}

.tarih-chatbot-welcome-bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    padding-right: 20px;
}

.welcome-bubble-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.welcome-bubble-close:hover {
    color: #374151;
}

.tarih-chatbot-welcome-bubble.hidden {
    display: none;
}

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

/* Toggle Button */
.tarih-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
    color: #fff;
    animation: floatButton 3s ease-in-out infinite;
}

.tarih-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
    animation: none;
}

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

.tarih-chatbot-toggle:active {
    transform: scale(0.95);
}

.tarih-chatbot-toggle .chat-icon {
    display: block;
}

.tarih-chatbot-toggle .close-icon {
    display: none;
}

.tarih-chatbot-toggle.active .chat-icon {
    display: none;
}

.tarih-chatbot-toggle.active .close-icon {
    display: block;
}

/* Widget Window */
.tarih-chatbot-widget-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    max-height: 600px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.tarih-chatbot-floating-widget[data-position="bottom-right"] .tarih-chatbot-widget-window {
    right: 0;
}

.tarih-chatbot-floating-widget[data-position="bottom-left"] .tarih-chatbot-widget-window {
    left: 0;
}

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

/* Chat Container */
.tarih-chatbot-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    max-height: 600px;
}

.tarih-chatbot-header {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

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

.tarih-chatbot-minimize {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.tarih-chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tarih-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
    scroll-behavior: smooth;
    max-height: 400px;
}

.chatbot-message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

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

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

.message-content strong {
    font-weight: 600;
    color: inherit;
}

.message-content em {
    font-style: italic;
}

.message-content a {
    color: #1f2937;
    text-decoration: underline;
    transition: color 0.2s;
}

.message-content a:hover {
    color: #111827;
}

/* Kaynak Butonları - Minimal */
.source-button {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 3px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none !important;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #fff !important;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    opacity: 0.95;
}

.source-button:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    color: #fff !important;
}

.source-buy {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.source-buy:hover {
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.source-magazine {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.source-magazine:hover {
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

/* Modern Typing Indicator - Beyaz balon, siyah noktalar */
.typing-indicator-modern {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 14px 18px !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    animation: typingPulse 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.typing-indicator-message {
    animation: fadeIn 0.3s ease-in;
}

.typing-indicator-message .message-content {
    border-radius: 18px !important;
}

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

.user-message .message-content {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bot-message {
    justify-content: flex-start;
}

.bot-message .message-content {
    background: #fff;
    color: #333;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.tarih-chatbot-input {
    display: flex;
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    gap: 8px;
    flex-shrink: 0;
}

.tarih-chatbot-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.tarih-chatbot-input input:focus {
    border-color: #1f2937;
    box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.1);
}

.tarih-chatbot-input button {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

.tarih-chatbot-input button:hover {
    transform: scale(1.05);
}

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

.tarih-chatbot-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.tarih-chatbot-loading {
    padding: 12px 20px;
    text-align: center;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.loading-message {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #1f2937;
    font-size: 14px;
    font-weight: 500;
}

.loading-text {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.loading-dots {
    display: inline-flex;
    gap: 2px;
}

.loading-dots span {
    font-size: 20px;
    line-height: 1;
    animation: blink 1.4s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 80%, 100% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
}

/* Scrollbar Stilleri */
.tarih-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.tarih-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.tarih-chatbot-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.tarih-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Error mesajı */
.error-message .message-content {
    background: #fee;
    border-color: #fcc;
    color: #c33;
}

/* Mobil Responsive */
@media (max-width: 768px) {
    .tarih-chatbot-widget-window {
        width: calc(100vw - 40px);
        max-width: 380px;
    }
    
    .tarih-chatbot-messages {
        max-height: 350px;
    }
    
    .message-content {
        max-width: 85%;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .tarih-chatbot-floating-widget {
        bottom: 10px;
    }
    
    .tarih-chatbot-floating-widget[data-position="bottom-right"] {
        right: 10px;
    }
    
    .tarih-chatbot-floating-widget[data-position="bottom-left"] {
        left: 10px;
    }
    
    .tarih-chatbot-widget-window {
        width: calc(100vw - 20px);
        bottom: 70px;
        max-height: 500px;
    }
    
    .tarih-chatbot-messages {
        max-height: 300px;
    }
    
    .tarih-chatbot-toggle {
        width: 50px;
        height: 50px;
    }
}

/* Shortcode inline container */
.tarih-chatbot-shortcode {
    max-width: 600px;
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.tarih-chatbot-shortcode .tarih-chatbot-header {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #fff;
    padding: 20px;
    text-align: center;
}

.tarih-chatbot-shortcode .tarih-chatbot-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.tarih-chatbot-shortcode .tarih-chatbot-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
}
