/* Chat Container - Sitenin temasına uygun */
.chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: hidden;
    user-select: none;
    cursor: default;
}

/* Draggable state */
.chat-container.dragging {
    cursor: grabbing;
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    transition: none;
}

.chat-container.draggable {
    cursor: grab;
}

.chat-container.dragging .chat-header {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chat-container.dragging .drag-handle {
    opacity: 1;
    background: rgba(52, 152, 219, 0.6);
}

.chat-container.dragging .drag-handle::before,
.chat-container.dragging .drag-handle::after {
    background: rgba(52, 152, 219, 0.6);
}

.chat-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
    cursor: grab;
    position: relative;
}

.chat-header:active {
    cursor: grabbing;
}

/* Drag handle */
.drag-handle {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drag-handle::before,
.drag-handle::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.drag-handle::before {
    top: -8px;
}

.drag-handle::after {
    top: 8px;
}

.chat-header:hover .drag-handle {
    opacity: 1;
    background: rgba(52, 152, 219, 0.4);
}

.chat-header:hover .drag-handle::before,
.chat-header:hover .drag-handle::after {
    background: rgba(52, 152, 219, 0.4);
}

.chat-title {
    color: #ecf0f1;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.chat-title svg {
    color: #3498db;
    margin-right: 8px;
}

.chat-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ecf0f1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    scrollbar-width: thin;
    scrollbar-color: #3498db #2c3e50;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #2c3e50;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Chat Message */
.chat-message {
    margin-bottom: 15px;
    animation: fadeInUp 0.3s ease;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.chat-username {
    color: #3498db;
    font-weight: 600;
    font-size: 13px;
    text-transform: capitalize;
}

.chat-time {
    color: #95a5a6;
    font-size: 11px;
    font-weight: 400;
}

.chat-content {
    background: rgba(255, 255, 255, 0.05);
    color: #ecf0f1;
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
    backdrop-filter: blur(10px);
}

.chat-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(174deg, #3d3d3d, #2a2a2a));
    border-radius: 12px;
    z-index: -1;
}

/* Chat Input */
.chat-input {
    padding: 15px 20px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 15px 15px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.chat-input .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ecf0f1;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.chat-input .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    color: #ecf0f1;
}

.chat-input .form-control::placeholder {
    color: #95a5a6;
}

.chat-input .btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.chat-input .btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.chat-input .btn:active {
    transform: translateY(0);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

/* Chat minimized state */
.chat-container.minimized {
    height: 60px;
    width: 200px;
}

.chat-container.minimized .chat-messages,
.chat-container.minimized .chat-input {
    display: none;
}

.chat-container.minimized .drag-handle {
    display: none;
}

/* Online indicator */
.chat-header::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 50px;
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        width: 300px;
        height: 400px;
        bottom: 10px;
        right: 10px;
    }
    
    .chat-header {
        padding: 12px 15px;
    }
    
    .chat-title {
        font-size: 14px;
    }
    
    .chat-messages {
        padding: 10px;
    }
    
    .chat-input {
        padding: 10px 15px;
    }
    
    .chat-input .form-control {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .chat-input .btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .chat-container {
        width: calc(100vw - 20px);
        height: 350px;
        right: 10px;
        left: 10px;
    }
}

/* Message status indicators */
.chat-message.sending .chat-content {
    opacity: 0.7;
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

.chat-message.error .chat-content {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.3);
}

.chat-message.sent .chat-content {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.3);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #95a5a6;
    font-size: 12px;
    font-style: italic;
}

.typing-dots {
    display: inline-flex;
    margin-left: 5px;
}

.typing-dots span {
    width: 4px;
    height: 4px;
    background: #3498db;
    border-radius: 50%;
    margin: 0 1px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Notification badge */
.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
    border: 2px solid #1a1a2e;
}
