/**
 * Kanun Botu Pro - Frontend Styles
 * Version: 2.0.0
 */

/* Variables */
:root {
    --kbp-primary: #1D4E89;       /* Ana Renk - Koyu Kurumsal Mavi */
    --kbp-primary-dark: #0D2A53;  /* Ana Rengin Koyu Tonu */
    --kbp-primary-light: #3172B7; /* Ana Rengin Açık Tonu */
    --kbp-secondary: #7DCFB6;    /* İkincil Renk - Yumuşak Nane Yeşili */
    --kbp-success: #10B981;
    --kbp-warning: #F59E0B;
    --kbp-danger: #EF4444;
    --kbp-gray-50: #F8F9FA;      /* En açık gri - Arka planlar */
    --kbp-gray-100: #F1F3F5;
    --kbp-gray-200: #E9ECEF;
    --kbp-gray-300: #DEE2E6;
    --kbp-gray-400: #CED4DA;
    --kbp-gray-500: #ADB5BD;
    --kbp-gray-600: #868E96;
    --kbp-gray-700: #495057;
    --kbp-gray-800: #343A40;
    --kbp-gray-900: #212529;      /* En koyu gri - Ana Metin Rengi */
    --kbp-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --kbp-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --kbp-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --kbp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --kbp-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Container */
.kbp-chatbot-wrapper {
    margin: 20px auto;
}

.kbp-chatbot-container {
    background: #ffffff;
    border: 1px solid var(--kbp-gray-200);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-shadow: var(--kbp-shadow-lg);
}

/* Header */
.kbp-chat-header {
    background: var(--kbp-primary);
    color: white;
    padding: 16px 20px;
}

.kbp-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kbp-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kbp-bot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.kbp-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.kbp-bot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

.kbp-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: kbp-pulse 2s infinite;
}

.kbp-header-actions {
    display: flex;
    gap: 8px;
}

.kbp-action-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.kbp-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Categories */
.kbp-categories {
    background: var(--kbp-gray-50);
    padding: 12px 20px;
    border-bottom: 1px solid var(--kbp-gray-200);
}

.kbp-categories-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--kbp-gray-300) transparent;
}

.kbp-categories-scroll::-webkit-scrollbar {
    height: 4px;
}

.kbp-categories-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.kbp-categories-scroll::-webkit-scrollbar-thumb {
    background: var(--kbp-gray-300);
    border-radius: 2px;
}

.kbp-category-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border: 1px solid currentColor;
    border-radius: 20px;
    background: transparent;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.kbp-category-chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--kbp-shadow);
}

.kbp-category-chip.active {
    background: currentColor !important;
    color: white !important;
}

.kbp-category-icon {
    font-size: 16px;
}

/* Messages Area */
.kbp-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--kbp-gray-50);
    scroll-behavior: smooth;
}

.kbp-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    animation: kbp-fadeIn 0.3s ease-out;
}

.kbp-user-message {
    flex-direction: row-reverse;
}

.kbp-message-avatar {
    flex-shrink: 0;
}

.kbp-avatar-icon {
    width: 32px;
    height: 32px;
    background: var(--kbp-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.kbp-user-message .kbp-avatar-icon {
    background: var(--kbp-gray-300);
}

.kbp-message-content {
    max-width: 70%;
}

.kbp-user-message .kbp-message-content {
    align-items: flex-end;
}

.kbp-message-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: var(--kbp-shadow-sm);
    position: relative;
}

.kbp-user-message .kbp-message-bubble {
    background: var(--kbp-primary);
    color: white;
}

.kbp-message-text {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.kbp-message-time {
    font-size: 11px;
    color: var(--kbp-gray-400);
    margin-top: 4px;
    padding: 0 8px;
}

.kbp-user-message .kbp-message-time {
    text-align: right;
}

/* Suggestions */
.kbp-suggestions {
    margin: 20px 0;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--kbp-shadow-sm);
}

.kbp-suggestions-title {
    font-size: 13px;
    color: var(--kbp-gray-600);
    margin: 0 0 10px 0;
    font-weight: 500;
}

.kbp-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kbp-suggestion-btn {
    text-align: left;
    padding: 10px 14px;
    background: var(--kbp-gray-50);
    border: 1px solid var(--kbp-gray-200);
    border-radius: 8px;
    font-size: 13px;
    color: var(--kbp-gray-700);
    cursor: pointer;
    transition: all 0.2s;
}

.kbp-suggestion-btn:hover {
    background: var(--kbp-primary);
    color: white;
    border-color: var(--kbp-primary);
    transform: translateX(4px);
}

/* Typing Indicator */
.kbp-typing-indicator {
    display: flex;
    gap: 10px;
    padding: 0 20px 10px;
    animation: kbp-fadeIn 0.3s ease-out;
}

.kbp-typing-avatar {
    width: 32px;
    height: 32px;
}

.kbp-typing-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: var(--kbp-shadow-sm);
    display: flex;
    align-items: center;
    gap: 4px;
}

.kbp-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--kbp-gray-400);
    border-radius: 50%;
    animation: kbp-typing 1.4s infinite;
}

.kbp-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.kbp-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Input Area */
.kbp-chat-input-container {
    background: white;
    border-top: 1px solid var(--kbp-gray-200);
    padding: 16px 20px;
}

.kbp-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.kbp-message-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--kbp-gray-200);
    border-radius: 24px;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    max-height: 120px;
}

.kbp-message-input:focus {
    border-color: var(--kbp-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.kbp-input-actions {
    display: flex;
    gap: 4px;
}

.kbp-attach-btn,
.kbp-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.kbp-attach-btn {
    background: var(--kbp-gray-100);
    color: var(--kbp-gray-600);
}

.kbp-attach-btn:hover {
    background: var(--kbp-gray-200);
}

.kbp-send-btn {
    background: var(--kbp-primary);
    color: white;
}

.kbp-send-btn:hover:not(:disabled) {
    background: var(--kbp-primary-dark);
    transform: scale(1.05);
}

.kbp-send-btn:disabled {
    background: var(--kbp-gray-300);
    cursor: not-allowed;
    opacity: 0.5;
}

.kbp-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding: 0 8px;
}

.kbp-char-counter {
    font-size: 11px;
    color: var(--kbp-gray-400);
}

.kbp-char-counter.warning {
    color: var(--kbp-warning);
}

.kbp-char-counter.danger {
    color: var(--kbp-danger);
}

.kbp-powered-by {
    font-size: 11px;
    color: var(--kbp-gray-400);
}

.kbp-powered-by strong {
    color: var(--kbp-gray-600);
}

/* Floating Widget */
.kbp-floating-widget {
    position: fixed;
    z-index: 9999;
}

.kbp-floating-widget.kbp-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.kbp-floating-widget.kbp-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.kbp-floating-button {
    background: var(--kbp-primary);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: var(--kbp-shadow-lg);
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.kbp-floating-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--kbp-shadow-xl);
}

.kbp-button-icon {
    font-size: 20px;
}

.kbp-notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--kbp-danger);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: var(--kbp-shadow);
}

.kbp-floating-chat {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 40px);
    animation: kbp-slideUp 0.3s ease-out;
}

.kbp-position-bottom-left .kbp-floating-chat {
    right: auto;
    left: 0;
}

.kbp-floating-chat .kbp-chatbot-container {
    height: 600px;
    max-height: calc(100vh - 120px);
}

/* Maintenance Message */
.kbp-maintenance-message {
    text-align: center;
    padding: 60px 20px;
    background: var(--kbp-gray-50);
    border-radius: 12px;
    border: 1px solid var(--kbp-gray-200);
}

.kbp-maintenance-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.kbp-maintenance-message h3 {
    margin: 0 0 8px 0;
    color: var(--kbp-gray-800);
}

.kbp-maintenance-message p {
    margin: 0;
    color: var(--kbp-gray-600);
}

/* Themes */
/* Dark Theme */
.kbp-theme-dark .kbp-chatbot-container {
    background: var(--kbp-gray-900);
    border-color: var(--kbp-gray-700);
}

.kbp-theme-dark .kbp-chat-header {
    background: var(--kbp-gray-800);
}

.kbp-theme-dark .kbp-categories {
    background: var(--kbp-gray-800);
    border-color: var(--kbp-gray-700);
}

.kbp-theme-dark .kbp-chat-messages {
    background: var(--kbp-gray-900);
}

.kbp-theme-dark .kbp-message-bubble {
    background: var(--kbp-gray-800);
    color: var(--kbp-gray-100);
}

.kbp-theme-dark .kbp-user-message .kbp-message-bubble {
    background: var(--kbp-primary);
    color: white;
}

.kbp-theme-dark .kbp-suggestions {
    background: var(--kbp-gray-800);
}

.kbp-theme-dark .kbp-suggestion-btn {
    background: var(--kbp-gray-700);
    border-color: var(--kbp-gray-600);
    color: var(--kbp-gray-200);
}

.kbp-theme-dark .kbp-chat-input-container {
    background: var(--kbp-gray-800);
    border-color: var(--kbp-gray-700);
}

.kbp-theme-dark .kbp-message-input {
    background: var(--kbp-gray-700);
    border-color: var(--kbp-gray-600);
    color: var(--kbp-gray-100);
}

/* Animations */
@keyframes kbp-pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

@keyframes kbp-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes kbp-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes kbp-typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .kbp-chatbot-container {
        border-radius: 0;
        height: 100vh !important;
        max-height: 100vh !important;
        width: 100vw !important;
        max-width: 100vw !important;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 10000;
    }
    
    .kbp-message-content {
        max-width: 85%;
    }
    
    .kbp-floating-chat {
        width: 100vw;
        max-width: 100vw;
        bottom: 0;
        right: 0;
        left: 0;
    }
    
    .kbp-floating-chat .kbp-chatbot-container {
        height: 100vh;
        max-height: 100vh;
    }
    
    .kbp-categories-scroll {
        padding-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .kbp-chat-header {
        padding: 12px 16px;
    }
    
    .kbp-bot-avatar {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .kbp-header-info h3 {
        font-size: 14px;
    }
    
    .kbp-chat-messages {
        padding: 16px;
    }
    
    .kbp-message {
        margin-bottom: 12px;
    }
    
    .kbp-message-bubble {
        padding: 10px 14px;
    }
    
    .kbp-chat-input-container {
        padding: 12px 16px;
    }
}

/* RTL Support */
.rtl .kbp-header-left,
.rtl .kbp-header-actions,
.rtl .kbp-message,
.rtl .kbp-input-wrapper,
.rtl .kbp-input-actions {
    flex-direction: row-reverse;
}

.rtl .kbp-user-message {
    flex-direction: row;
}

.rtl .kbp-message-time {
    text-align: left;
}

.rtl .kbp-user-message .kbp-message-time {
    text-align: right;
}

.rtl .kbp-suggestion-btn:hover {
    transform: translateX(-4px);
}

/* Print Styles */
@media print {
    .kbp-chat-header,
    .kbp-categories,
    .kbp-chat-input-container,
    .kbp-suggestions,
    .kbp-typing-indicator {
        display: none !important;
    }
    
    .kbp-chatbot-container {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .kbp-chat-messages {
        background: white;
        padding: 20px;
    }
    
    .kbp-message-bubble {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .kbp-user-message .kbp-message-bubble {
        background: white;
        color: black;
    }
}

/* Accessibility */
.kbp-chatbot-container:focus-within {
    outline: 2px solid var(--kbp-primary);
    outline-offset: 2px;
}

.kbp-action-btn:focus,
.kbp-category-chip:focus,
.kbp-suggestion-btn:focus,
.kbp-attach-btn:focus,
.kbp-send-btn:focus {
    outline: 2px solid var(--kbp-primary);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .kbp-chatbot-container {
        border-width: 2px;
    }
    
    .kbp-message-bubble {
        border: 2px solid currentColor;
    }
    
    .kbp-message-input {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* Kategori alanını gizlemek için */
.kbp-categories {
    display: none !important;
}
/* Yazılı butonlar için stil güncellemesi */

/* Sağ Üst Butonlar (Küçült, Temizle) */
.kbp-action-btn {
    width: auto; /* Genişliği içeriğe göre ayarla */
    height: 32px;
    padding-left: 12px;
    padding-right: 12px;
    font-size: 13px;
    font-weight: 500;
}

/* Gönder Butonu */
.kbp-send-btn {
    width: auto; /* Genişliği içeriğe göre ayarla */
    height: 40px;
    border-radius: 8px; /* Yuvarlak yerine köşeli yap */
    padding-left: 16px;
    padding-right: 16px;
    font-weight: 500;
}