:root {
    --chatbot-primary: #dc3545;
    --chatbot-primary-dark: #c82333;
    --chatbot-primary-soft: #ff6b6b;
    --chatbot-grey: #343a40;
    --chatbot-light-grey: #f8f9fa;
    --chatbot-border: #dee2e6;
}

.chatbot-container {
    position: fixed;
    width: 400px;
    max-width: 95vw;
    height: 700px;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    border: 1px solid var(--chatbot-border);
    transform: translateY(20px);
}

    .chatbot-container.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--chatbot-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-size: 24px;
}

    .chatbot-button:hover {
        transform: scale(1.1);
        background-color: var(--chatbot-primary-dark);
    }

.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: all 0.3s ease;
}

    .chatbot-window.active {
        display: flex !important;
    }

.chatbot-header {
    padding: 15px;
    background: var(--chatbot-primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .chatbot-header h3 {
        margin: 0;
        font-size: 16px;
    }

.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    padding: 5px;
}

.chatbot-messages {
    padding: 20px;
    overflow-y: auto;
    scroll-behavior: smooth;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

/* Scrollbar Styles */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #ffebeb;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--chatbot-primary);
    border-radius: 10px;
    border: 2px solid #ffebeb;
}

    .chat-messages::-webkit-scrollbar-thumb:hover {
        background: var(--chatbot-primary-dark);
    }

/* Message Styles */
.message {
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
    width: 100%;
    display: flex;
    flex-direction: column;
}

    .message.user {
        align-items: flex-end !important;
    }

    .message.bot {
        align-items: flex-start !important;
    }

.chatbot-message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

    .chatbot-message.user {
        background: #e9ecef;
        margin-left: auto;
    }

    .chatbot-message.bot {
        background: var(--chatbot-primary);
        color: white;
        margin-right: auto;
    }

.chatbot-input {
    padding: 15px;
    border-top: 1px solid var(--chatbot-border);
    display: flex;
    gap: 10px;
    background: white;
}

    .chatbot-input input {
        flex: 1;
        padding: 8px 12px;
        border: 1px solid var(--chatbot-border);
        border-radius: 20px;
        outline: none;
    }

    .chatbot-input button {
        background: var(--chatbot-primary);
        color: white;
        border: none;
        padding: 8px 15px;
        border-radius: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .chatbot-input button:hover {
            background: var(--chatbot-primary-dark);
        }

/* Loading animation */
.chatbot-loading {
    display: flex;
    gap: 5px;
    padding: 10px;
}

    .chatbot-loading span {
        width: 8px;
        height: 8px;
        background: var(--chatbot-primary);
        border-radius: 50%;
        animation: bounce 0.5s infinite alternate;
    }

        .chatbot-loading span:nth-child(2) {
            animation-delay: 0.1s;
        }

        .chatbot-loading span:nth-child(3) {
            animation-delay: 0.2s;
        }

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-5px);
    }
}

.chatbot-header {
    background: var(--chatbot-primary);
    color: white;
    padding: 20px;
    border-bottom: 1px solid var(--chatbot-primary-dark);
    display: flex;
    align-items: center;
    gap: 15px;
}

.chatbot-body {
    flex: 1;
    overflow-y: auto;
    background-color: #fff;
    position: relative;
    scroll-behavior: smooth;
    height: calc(100% - 140px); /* Header ve footer yÃƒÂ¼ksekliÃ„Å¸ini ÃƒÂ§Ã„Â±karÃ„Â±yoruz */
    display: flex;
    flex-direction: column;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 90px;
    height: 90px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--chatbot-primary);
    color: white;
    transition: all 0.3s ease;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    animation: float 3s ease-in-out infinite;
}

    .chatbot-toggle svg {
        /* width: 45px; */
        /* height: 45px; */
        stroke-width: 1.75;
        filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
        animation: wink 5s infinite;
    }

    .chatbot-toggle:hover {
        transform: scale(1.08);
        background: var(--chatbot-primary-dark);
        animation: pulse 1.5s infinite;
    }

    .chatbot-toggle:focus {
        outline: none;
        box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.3);
    }

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: white;
    color: var(--chatbot-primary);
    border-radius: 50%;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid var(--chatbot-primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    animation: bounce 1s ease infinite;
}

.chatbaslik {
    width: 100%;
}

/* AI Asistan baÃ…Å¸lÃ„Â±k animasyonu */
@keyframes titleFlash {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

.chatbot-header h5 {
    color: #fff;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    animation: titleFlash 2s infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

    .chatbot-header h5:hover {
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
        transform: scale(1.05);
    }

.bot-message {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.message.user.bot-message {
    align-items: flex-end !important;
}

.message.bot.bot-message {
    align-items: flex-start !important;
    width: 636px;
}

.message-content {
    padding: 15px 20px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.5;
    max-width: 80%;
    min-width: 200px;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.message.user .message-content {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8585 100%);
    color: white;
    border-radius: 15px 15px 0 15px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    margin-right: 10px;
}

.message.bot .message-content {
    background: #f0f2f5;
    color: #1e2329;
    border-radius: 15px 15px 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    /* margin-left: 10px; */
    /* width: 100%; */
    margin-left: 10px;
}

.message-content p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
}

.message-time {
    font-size: 12px;
    margin-top: 6px;
    opacity: 0.8;
    padding: 0 15px;
}

.message.user .message-time {
    color: #666;
    align-self: flex-end;
    margin-right: 15px;
}

.message.bot .message-time {
    color: #666;
    align-self: flex-start;
    margin-left: 15px;
}

/* Mesaj animasyonlar */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.new {
    animation: fadeIn 0.3s ease forwards;
}

/* Hover efektleri */
.message-content:hover {
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.message.user .message-content:hover {
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.message.bot .message-content:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.chatbot-footer {
    background: white;
    padding: 20px;
    border-top: 1px solid var(--chatbot-border);
}

    .chatbot-footer .input-group {
        background: var(--chatbot-light-grey);
        border-radius: 6px;
        padding: 5px;
    }

    .chatbot-footer .form-control {
        border: none;
        background: transparent;
        box-shadow: none;
        padding: 8px 12px;
        font-size: 14px;
    }

        .chatbot-footer .form-control:focus {
            outline: none;
        }

    .chatbot-footer .btn-primary {
        background: var(--chatbot-primary);
        border: none;
        width: 45px;
        height: 45px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

        .chatbot-footer .btn-primary:hover {
            background: var(--chatbot-primary-dark);
            transform: scale(1.05);
        }

        .chatbot-footer .btn-primary i {
            width: 20px;
            height: 20px;
            stroke-width: 2;
            color: white;
        }

.chatbot-avatar {
    position: relative;
    margin-right: 10px;
}

    .chatbot-avatar img.white-logo {
        width: 100px;
        height: 60px;
        object-fit: contain;
        filter: brightness(0) invert(1);
    }

    .chatbot-avatar svg {
        width: 40px;
        height: 40px;
        stroke-width: 1.75;
        color: white;
        filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
    }

.chatbot-info h5 {
    color: white;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chatbot-info small {
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chatbot-actions button {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 5px;
    margin-left: 5px;
    border-radius: 4px;
    transition: background 0.3s ease;
    position: absolute;
    right: 20px;
    top: 25px;
}

    .chatbot-actions button:hover {
        background: rgba(255,255,255,0.2);
    }

.feather-small {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

.chatbot-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    opacity: 0.02;
    pointer-events: none;
    overflow: hidden;
}

    .chatbot-background svg {
        width: 120px;
        height: 120px;
        stroke-width: 1;
        margin: 10px;
        transform: rotate(var(--rotation));
    }

        /* Her robot iÃƒÂ§in farklÃ„Â± rotasyon aÃƒÂ§Ã„Â±larÃ„Â± */
        .chatbot-background svg:nth-child(1) {
            --rotation: 0deg;
        }

        .chatbot-background svg:nth-child(2) {
            --rotation: 45deg;
        }

        .chatbot-background svg:nth-child(3) {
            --rotation: -45deg;
        }

        .chatbot-background svg:nth-child(4) {
            --rotation: 90deg;
        }

        .chatbot-background svg:nth-child(5) {
            --rotation: -90deg;
        }

        .chatbot-background svg:nth-child(6) {
            --rotation: 180deg;
        }

/* Chatbot Toggle Button Animations */
@keyframes wink {
    0%, 100% {
        transform: scaleY(1);
    }

    45% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(0.1);
    }

    55% {
        transform: scaleY(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(220, 53, 69, 0.6);
    }

    100% {
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    }
}

/* Speech Bubble Animation */
.chatbot-hint {
    position: absolute;
    top: -60px;
    right: 90px;
    background: white;
    padding: 10px 15px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 14px;
    color: var(--chatbot-grey);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    width: max-content;
    max-width: 250px;
    animation: fadeInOut 5s ease-in-out infinite;
}

    .chatbot-hint::after {
        content: '';
        position: absolute;
        right: -10px;
        top: 50%;
        transform: translateY(-50%);
        border-left: 10px solid white;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
    }

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    10% {
        opacity: 1;
        transform: translateY(0);
    }

    90% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Active Chat Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.9);
    border-radius: 15px;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .typing-indicator.active {
        opacity: 1;
    }

    .typing-indicator span {
        width: 6px;
        height: 6px;
        background: var(--chatbot-primary);
        border-radius: 50%;
        animation: typing 1s infinite;
    }

        .typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes typing {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.reconnecting-status {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    text-align: center;
    z-index: 1000;
    display: none;
}

.reconnecting-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
}

.refresh-button {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: none;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

    .refresh-button button {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 8px 16px;
        border: none;
        border-radius: 4px;
        background-color: #007bff;
        color: white;
        cursor: pointer;
        transition: background-color 0.2s;
    }

        .refresh-button button:hover {
            background-color: #0056b3;
        }

        .refresh-button button i {
            font-size: 14px;
        }

@media (max-width: 600px) {
    .chatbot-toggle {
        width: 70px !important;
        height: 70px !important;
        position: fixed !important;
        right: 20px !important;
        bottom: 20px !important;
        touch-action: none !important;
        -webkit-user-drag: none !important;
        user-select: none !important;
        pointer-events: auto !important;
    }
}
