/* 🎨 AI Canlı Destek - Intercom Style Minimal Design */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

/* === GENEL AYARLAR === */
.aicd-chat-widget {
    position: fixed;
    bottom: 20px;
    z-index: 99999;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.aicd-chat-widget * {
    box-sizing: border-box;
}

.aicd-chat-widget.aicd-position-right {
    right: 20px;
}

.aicd-chat-widget.aicd-position-left {
    left: 20px;
}

/* === CHAT BUTTON - Minimal === */
.aicd-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.aicd-chat-button::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
    z-index: -1;
}

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

.aicd-chat-button:hover {
    transform: scale(1.08);
}

.aicd-chat-button:active {
    transform: scale(0.95);
}

.aicd-chat-button .dashicons {
    font-size: 28px;
    color: white;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.aicd-chat-button .dashicons::before {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === TOOLTIP === */
.aicd-tooltip {
    position: absolute;
    right: 75px;
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1;
}

.aicd-position-left .aicd-tooltip {
    right: auto;
    left: 75px;
}

.aicd-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #1f2937;
}

.aicd-position-left .aicd-tooltip::after {
    right: auto;
    left: -6px;
    border-left: none;
    border-right: 6px solid #1f2937;
}

.aicd-chat-button:hover .aicd-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(-5px);
}

.aicd-position-left .aicd-chat-button:hover .aicd-tooltip {
    transform: translateY(-50%) translateX(5px);
}

/* Chat açıkken tooltip gizle */
.aicd-chat-widget.aicd-chat-open .aicd-tooltip {
    display: none;
}

/* === END SESSION FOOTER === */
.aicd-end-session-footer {
    padding: 12px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.aicd-end-session-btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.aicd-end-session-btn:active {
    transform: scale(0.98);
}

.aicd-end-session-btn svg {
    width: 16px;
    height: 16px;
}

/* === CHAT WINDOW - Clean & Minimal === */
.aicd-chat-window {
    position: absolute;
    bottom: 75px;
    width: 380px;
    max-height: 600px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.aicd-chat-window.aicd-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.aicd-position-right .aicd-chat-window {
    right: 0;
}

.aicd-position-left .aicd-chat-window {
    left: 0;
}

/* === HEADER - Simple === */
.aicd-chat-header {
    padding: 20px 24px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.aicd-chat-header h3 {
    color: #ffffff !important;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
}


.aicd-close {
    border: none;
    font-size: 32px;
    cursor: pointer;
    padding: 4px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-weight: 300;
    line-height: 1;
}

/* === MESSAGES AREA - Clean === */
.aicd-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #ffffff;
    min-height: 320px;
    max-height: 420px;
}

.aicd-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.aicd-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.aicd-chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.aicd-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* === MESSAGE BUBBLES - Intercom Style === */
.aicd-message {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.01em;
    word-wrap: break-word;
}

.aicd-user-message {
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.aicd-bot-message {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    margin-right: auto;
}

/* === INPUT AREA - Clean === */
.aicd-chat-input {
    display: flex;
    padding: 16px 20px;
    gap: 8px;
    background: #ffffff;
    border-top: 1px solid #f3f4f6;
}

.aicd-chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    letter-spacing: -0.01em;
    transition: all 0.15s ease;
    background: #ffffff;
    color: #1f2937;
}

.aicd-chat-input input:focus {
    outline: none;
}

.aicd-chat-input input::placeholder {
    color: #9ca3af;
}

.aicd-chat-input button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.aicd-chat-input button:active {
    transform: scale(0.98);
}

/* === TYPING INDICATOR === */
.typing {
    opacity: 0.6;
    font-style: italic;
}

.typing::after {
    content: '...';
    animation: typing 1.2s infinite;
}

@keyframes typing {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 480px) {
    .aicd-chat-window {
        width: calc(100vw - 40px);
        max-height: calc(100vh - 120px);
        bottom: 75px;
    }
    
    .aicd-chat-widget.aicd-position-right,
    .aicd-chat-widget.aicd-position-left {
        right: 20px;
        left: 20px;
    }
    
    .aicd-position-right .aicd-chat-window,
    .aicd-position-left .aicd-chat-window {
        right: 0;
        left: 0;
    }
    
    .aicd-chat-messages {
        min-height: 280px;
        max-height: calc(100vh - 300px);
        padding: 16px;
    }
    
    .aicd-chat-header {
        padding: 16px 20px;
    }
}

/* === TABLET & SMALLER DESKTOP === */
@media (max-width: 768px) and (min-width: 481px) {
    .aicd-chat-window {
        max-height: 550px;
    }
    
    .aicd-chat-messages {
        max-height: 380px;
    }
}

/* === SMOOTH ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.2s ease;
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
    .aicd-chat-window {
        background: #1f2937;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
    
    .aicd-chat-header {
        background: #1f2937;
        border-bottom-color: #374151;
    }
    
    .aicd-chat-header h3 {
        color: #f9fafb;
    }
    
    .aicd-close {
        color: #9ca3af;
    }
    
    .aicd-close:hover {
        background: #374151;
        color: #f9fafb;
    }
    
    .aicd-chat-messages {
        background: #1f2937;
    }
    
    .aicd-bot-message {
        background: #374151;
        color: #f9fafb;
    }
    
    .aicd-chat-input {
        background: #1f2937;
        border-top-color: #374151;
    }
    
    .aicd-chat-input input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .aicd-chat-input input::placeholder {
        color: #6b7280;
    }
    
    .aicd-chat-messages::-webkit-scrollbar-thumb {
        background: #4b5563;
    }
}
