
/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 0;
    right: 30px;
    z-index: 1000;
    width: 360px;
    background: #000;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.chat-toggle-btn {
    width: 100%;
    height: auto;
    padding: 18px 24px;
    border-radius: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), padding-bottom 0.2s;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    pointer-events: auto; /* Tıklamayı garanti et */
}

.chat-toggle-btn:hover {
    padding-bottom: 16px; /* Hafif yukarı kalkma efekti */
}

.chat-btn-text {
    font-size: 17px;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.chat-toggle-btn i {
    font-size: 20px;
}

.chat-btn-text::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 2px;
    width: calc(100% - 4px);
    height: 6px;
    background: var(--accent-color); /* #ccff00 */
    z-index: -1;
    opacity: 0.6;
    transform: rotate(-2deg);
    border-radius: 2px;
}

.chat-widget.expanded .chat-btn-text::after {
    height: 0;
    opacity: 0;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff3b30;
    color: white;
    font-size: 11px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.chat-window {
    position: relative;
    width: 100%;
    height: 0;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 16px 16px 0 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: height 0.35s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.08);
    pointer-events: none;
    backdrop-filter: blur(12px);
}

.chat-widget.expanded .chat-window {
    height: 50vh;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    pointer-events: auto;
}

.chat-widget.expanded .chat-header {
    display: none;
}

.chat-header {
    background: #000;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.chat-agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-avatar {
    position: relative;
    width: 40px;
    height: 40px;
}

.agent-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
}

.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #4cd964;
    border-radius: 50%;
    border: 2px solid white;
}

.agent-details h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.status-text {
    font-size: 0.8rem;
    opacity: 0.9;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.close-chat:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    padding: 22px 20px 18px;
    overflow-y: auto;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.22);
    border-radius: 8px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.3);
}

.message-date {
    text-align: center;
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 10px;
}

.message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: chatPop 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
}

.msg-content {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.98rem;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
}

.message.bot .msg-content {
    background: #ffffff;
    color: #333;
    border-top-left-radius: 2px;
    border: 1px solid rgba(0,0,0,0.06);
}

.message.user .msg-content {
    background: linear-gradient(180deg, #000 0%, #111 100%);
    color: white;
    border-bottom-right-radius: 2px;
    border: 1px solid rgba(255,255,255,0.06);
}

.msg-time {
    font-size: 0.72rem;
    color: #999;
    margin-left: 5px;
}

.message.user .msg-time {
    text-align: right;
    margin-right: 5px;
}

.chat-input-area {
    padding: 14px 14px;
    background: rgba(255,255,255,0.9);
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 22px;
    padding: 12px 16px;
    font-size: 0.98rem;
    outline: none;
    transition: border-color 0.2s;
    background: #f7f7f7;
}

.chat-input-area input:focus {
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(204,255,0,0.18);
}

.chat-input-area button {
    background: none;
    border: none;
    color: #000;
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 5px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.chat-input-area button:hover {
    transform: translateY(-1px) scale(1.05);
}

@keyframes chatPop {
    0% { transform: translateY(8px) scale(0.98); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.typing .msg-content {
    position: relative;
    width: 30px;
    height: 16px;
    background: transparent;
    box-shadow: none;
    border: none;
}
.typing .msg-content::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ccc;
    box-shadow: 10px 0 0 #ccc, 20px 0 0 #ccc;
    animation: typingDots 1s infinite ease-in-out;
}
@keyframes typingDots {
    0% { opacity: 0.3; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(4px); }
    100% { opacity: 0.3; transform: translateX(0); }
}

@media (max-width: 480px) {
    .chat-widget {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
    }
    .chat-window {
        width: 100%;
        height: 0;
    }
    .chat-widget.expanded .chat-window {
        height: 60vh;
    }
}
