/**
 * NextStore - Modern Canlı Destek Widget CSS
 * Fotoğraftaki tasarıma uygun modern stil
 */

/* Floating Button */
.chat-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
    color: white;
}

.chat-floating-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

.chat-floating-btn:active {
    transform: scale(0.95);
}

.chat-tooltip {
    position: absolute;
    right: 70px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.chat-floating-btn:hover .chat-tooltip {
    opacity: 1;
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.chat-window-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.chat-window-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-status {
    margin: 4px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.chat-close-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Welcome Message */
.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.chat-welcome h4 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #1f2937;
}

.chat-welcome p {
    margin: 0;
    font-size: 14px;
}

/* Chat Message */
.chat-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: fadeInUp 0.3s ease-out;
}

.chat-message.fade-in {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-message.customer .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    order: 2;
}

.chat-message.admin .message-avatar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.chat-message.customer .message-content {
    order: 1;
    text-align: right;
}

.message-content p {
    margin: 0;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.customer .message-content p {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.admin .message-content p {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message-time {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Input Container */
.chat-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 20px 20px;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Error Message */
.chat-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    text-align: center;
    animation: fadeInUp 0.3s ease-out;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-window {
        width: calc(100% - 20px);
        height: calc(100% - 20px);
        bottom: 10px;
        right: 10px;
        border-radius: 16px;
    }
    
    .chat-floating-btn {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    
    .chat-tooltip {
        display: none;
    }
    
    .message-content {
        max-width: 80%;
    }
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}
