/**
 * ============================================
 * ÖBK CHATBOT
 * © 2026 Ömer Berat Keser
 * ============================================
 */

.chat-bot-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}


.chat-bot-trigger {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #7c3aed 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 8px 32px rgba(99, 102, 241, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}

.chat-bot-trigger::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg,
            transparent 0deg 60deg,
            rgba(255, 255, 255, 0.3) 60deg 120deg,
            transparent 120deg 360deg);
    animation: triggerRotate 3s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-bot-trigger:hover::before {
    opacity: 1;
}

@keyframes triggerRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.chat-bot-trigger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: triggerPulse 2s ease-in-out infinite;
}

@keyframes triggerPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.chat-bot-trigger i {
    font-size: 1.6rem;
    color: white;
    z-index: 2;
    animation: robotBounce 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes robotBounce {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-3px) rotate(-5deg);
    }

    75% {
        transform: translateY(-2px) rotate(5deg);
    }
}

.chat-bot-trigger:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow:
        0 12px 40px rgba(99, 102, 241, 0.5),
        0 6px 16px rgba(0, 0, 0, 0.15),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.chat-bot-trigger:hover i {
    animation: robotWave 0.5s ease-in-out;
}

@keyframes robotWave {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-15deg);
    }

    75% {
        transform: rotate(15deg);
    }
}

/* ============================================
   NOTIFICATION BADGE
   ============================================ */
.chat-bot-trigger .notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
    border-radius: 50%;
    border: 2px solid white;
    animation: notificationBlink 1.5s ease-in-out infinite;
}

@keyframes notificationBlink {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* ============================================
   CHAT WINDOW - DARK PREMIUM GLASSMORPHISM
   ============================================ */
.chat-bot-window {
    position: absolute;
    bottom: calc(100% + 15px);
    right: 0;
    width: 400px;
    max-height: 580px;
    background: linear-gradient(135deg,
            rgba(15, 15, 25, 0.98) 0%,
            rgba(20, 20, 35, 0.95) 50%,
            rgba(10, 10, 20, 0.98) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 24px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow:
        0 30px 100px rgba(0, 0, 0, 0.5),
        0 15px 50px rgba(99, 102, 241, 0.15),
        0 0 40px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.chat-bot-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ============================================
   CHAT HEADER - PREMIUM REDESIGN
   ============================================ */
.chat-header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 40%, #7c3aed 100%);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 90% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.6),
            transparent);
    animation: headerShine 3s linear infinite;
}

@keyframes headerShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(50%);
    }
}

/* Header Left Section */
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    animation: avatarFloat 4s ease-in-out infinite;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes avatarFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-3px) rotate(3deg);
    }
}

.chat-avatar i {
    font-size: 1.3rem;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: robotPulse 2s ease-in-out infinite;
}

@keyframes robotPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.avatar-status {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-radius: 50%;
    border: 2px solid #6366f1;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
    }
}

/* Header Info */
.chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.chat-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.chat-subtitle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.status-dot-live {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: liveDot 1.5s ease-in-out infinite;
}

@keyframes liveDot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* Header Right Section */
.chat-header-right {
    z-index: 1;
}

.chat-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.chat-close i {
    font-size: 0.85rem;
}

/* ============================================
   CHAT BODY - DARK THEME MESSAGES AREA
   ============================================ */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(180deg,
            rgba(15, 15, 25, 0.5) 0%,
            rgba(10, 10, 20, 0.3) 100%);
    min-height: 300px;
    max-height: 380px;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.4) 0%, rgba(124, 58, 237, 0.4) 100%);
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a5b4fc 0%, #818cf8 100%);
}

/* ============================================
   CHAT MESSAGES - BUBBLES
   ============================================ */
.chat-message {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 20px;
    position: relative;
    animation: messageSlide 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    line-height: 1.6;
    font-size: 0.95rem;
}

@keyframes messageSlide {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Bot Message - Dark Theme */
.bot-message {
    align-self: flex-start;
    background: linear-gradient(135deg,
            rgba(30, 30, 50, 0.9) 0%,
            rgba(40, 40, 60, 0.85) 100%);
    color: #e2e8f0;
    border-bottom-left-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.bot-message::before {
    content: '';
    position: absolute;
    left: -8px;
    bottom: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, transparent 50%, rgba(35, 35, 55, 0.9) 50%);
    border-radius: 0 0 0 10px;
}

/* User Message - Gradient Purple */
.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #7c3aed 100%);
    color: white;
    border-bottom-right-radius: 8px;
    box-shadow:
        0 6px 20px rgba(99, 102, 241, 0.35),
        0 0 30px rgba(99, 102, 241, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.user-message::before {
    content: '';
    position: absolute;
    right: -8px;
    bottom: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #4f46e5 50%, transparent 50%);
    border-radius: 0 0 10px 0;
}

/* Message Content Styling */
.chat-message strong {
    font-weight: 700;
    color: inherit;
}

.chat-message .emoji {
    font-size: 1.1em;
}

.bot-message strong {
    color: #a5b4fc;
}

/* ============================================
   TIMESTAMP
   ============================================ */
.chat-timestamp {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 0.5rem;
    text-align: right;
    font-weight: 500;
}

.bot-message .chat-timestamp {
    color: #64748b;
}

.user-message .chat-timestamp {
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   TYPING INDICATOR
   ============================================ */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 20px;
    border-bottom-left-radius: 8px;
    align-self: flex-start;
    animation: messageSlide 0.3s ease;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.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 typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ============================================
   CHAT FOOTER - DARK THEME REDESIGN
   ============================================ */
.chat-footer {
    padding: 1.25rem;
    background: linear-gradient(180deg,
            rgba(15, 15, 25, 0.95) 0%,
            rgba(10, 10, 20, 0.98) 100%);
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.chat-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            rgba(99, 102, 241, 0.5),
            rgba(124, 58, 237, 0.5),
            transparent);
    animation: footerGlow 3s ease-in-out infinite;
}

@keyframes footerGlow {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.chat-form {
    display: flex;
    gap: 0.75rem;
    background: linear-gradient(135deg,
            rgba(30, 30, 50, 0.9) 0%,
            rgba(20, 20, 35, 0.95) 100%);
    padding: 0.6rem 0.6rem 0.6rem 1.25rem;
    border-radius: 50px;
    border: 2px solid rgba(99, 102, 241, 0.25);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.chat-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(99, 102, 241, 0.15),
            transparent);
    transition: left 0.6s ease;
}

.chat-form:focus-within::before {
    left: 100%;
}

.chat-form:focus-within {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 6px 20px rgba(99, 102, 241, 0.2),
        0 0 30px rgba(99, 102, 241, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 0.85rem 0.5rem;
    font-size: 0.95rem;
    color: #e2e8f0;
    font-family: inherit;
    font-weight: 500;
}

.chat-input::placeholder {
    color: rgba(148, 163, 184, 0.7);
    font-weight: 400;
    transition: all 0.3s ease;
}

.chat-input:focus::placeholder {
    color: rgba(165, 180, 252, 0.6);
    transform: translateX(5px);
}

.chat-submit {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #7c3aed 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow:
        0 6px 20px rgba(99, 102, 241, 0.35),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.chat-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.chat-submit:hover::before {
    width: 100%;
    height: 100%;
}

.chat-submit:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow:
        0 10px 30px rgba(99, 102, 241, 0.45),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.chat-submit:active {
    transform: scale(0.95);
}

.chat-submit i {
    font-size: 1.15rem;
    transition: all 0.3s ease;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.chat-submit:hover i {
    transform: translateX(3px) rotate(-10deg);
    animation: sendPulse 0.6s ease;
}

@keyframes sendPulse {

    0%,
    100% {
        transform: translateX(3px) rotate(-10deg) scale(1);
    }

    50% {
        transform: translateX(3px) rotate(-10deg) scale(1.2);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 480px) {
    .chat-bot-container {
        bottom: 1rem;
        right: 1rem;
    }

    .chat-bot-trigger {
        width: 58px;
        height: 58px;
    }

    .chat-bot-window {
        width: calc(100vw - 2rem);
        max-height: 70vh;
        right: -0.5rem;
    }

    .chat-header {
        padding: 1rem 1.25rem;
    }

    .chat-avatar {
        width: 42px;
        height: 42px;
    }

    .chat-body {
        min-height: 250px;
        max-height: 300px;
        padding: 1rem;
    }

    .chat-message {
        max-width: 90%;
        font-size: 0.9rem;
    }
}

/* Dark mode devre dışı - light theme kullanılıyor */

/* ============================================
   SPECIAL EFFECTS
   ============================================ */

/* Gradient Border Animation for Window */
.chat-bot-window::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
            #6366f1,
            #4f46e5,
            #7c3aed,
            #a855f7,
            #6366f1);
    background-size: 400% 400%;
    border-radius: 26px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: gradientBorder 4s ease infinite;
}

.chat-bot-window.open::before {
    opacity: 0.3;
}

@keyframes gradientBorder {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Sparkle Effect on Message Send */
@keyframes sparkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0;
    }
}

/* Hover Glow Effect */
.chat-bot-trigger:hover {
    animation: triggerGlow 1s ease-in-out infinite alternate;
}

@keyframes triggerGlow {
    0% {
        box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
    }

    100% {
        box-shadow: 0 8px 45px rgba(99, 102, 241, 0.6);
    }
}
