﻿/* Reset ve Temel Ayarlar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100vh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
}

/* Sidebar */
.chat-sidebar {
    width: 320px;
    background: #fff;
    border-right: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
}

.search-container {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    font-size: 14px;
    background: #f8f9fa;
    outline: none;
}

    .search-input:focus {
        border-color: #007bff;
        background: #fff;
    }

.chat-list {
    flex: 1;
    overflow-y: auto;
    background: #fff;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.15s;
}

    .chat-item:hover {
        background: #f8f9fa;
    }

    .chat-item.active {
        background: #ff6b6b;
    }

        .chat-item.active .chat-name,
        .chat-item.active .chat-last-message,
        .chat-item.active .chat-time {
            color: white !important;
        }

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 2px;
}

.chat-last-message {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.chat-time {
    font-size: 12px;
    color: #aaa;
}

.chat-badge {
    background: #ff4757;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100vh;
}

.chat-header {
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.chat-header-info {
    display: flex;
    align-items: center;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.chat-header-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.chat-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
}

.toggle-switch {
    width: 40px;
    height: 20px;
    background: #ccc;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

    .toggle-switch.active {
        background: #4caf50;
    }

    .toggle-switch::after {
        content: '';
        position: absolute;
        top: 2px;
        left: 2px;
        width: 16px;
        height: 16px;
        background: white;
        border-radius: 50%;
        transition: left 0.3s;
    }

    .toggle-switch.active::after {
        left: 22px;
    }

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    height: calc(100vh - 72px - 80px);
    position: relative;
}

.system-message {
    color: #666;
    font-size: 13px;
    text-align: center;
    margin: 20px auto;
    padding: 12px 20px;
    background: rgba(108, 117, 125, 0.1);
    border-radius: 20px;
    max-width: 400px;
}

.date-divider {
    text-align: center;
    margin: 20px 0;
}

.date-label {
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #667781;
    display: inline-block;
}

/* Message Bubbles */
.message {
    display: flex;
    margin-bottom: 12px;
    max-width: 70%;
}

    .message.sent {
        align-self: flex-end;
        flex-direction: row-reverse;
        margin-left: auto;
    }

    .message.received {
        align-self: flex-start;
    }

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.sent .message-bubble {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 6px;
}

.message.received .message-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #e5e5e5;
    border-bottom-left-radius: 6px;
}

.message-time {
    font-size: 11px;
    margin-top: 4px;
    text-align: right;
}

.message.sent .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.message.received .message-time {
    color: #aaa;
}

/* Input Area */
.chat-input-container {
    background: #fff;
    border-top: 1px solid #e5e5e5;
    padding: 16px 20px;
    height: 70px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid #e5e5e5;
    border-radius: 25px;
    background: #f8f9fa;
    outline: none;
    resize: none;
}

    .chat-input:focus {
        border-color: #007bff;
        background: #fff;
    }

    .chat-input:disabled {
        background: #f0f0f0;
        cursor: not-allowed;
    }

.send-button {
    background: #007bff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

    .send-button:hover:not(:disabled) {
        background: #0056b3;
    }

    .send-button:disabled {
        background: #bbb;
        cursor: not-allowed;
    }

    .send-button svg {
        width: 18px;
        height: 18px;
    }

/* Kullanıcı Baş Harfi */
.user-initial {
    background: #6c757d;
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
    align-self: flex-end;
    margin: 0 8px;
}

/* Scrollbar */
.chat-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

    .chat-list::-webkit-scrollbar-thumb:hover,
    .chat-messages::-webkit-scrollbar-thumb:hover {
        background: #bbb;
    }
