/* =============================================
   NAIROBIRAA Dating - Chat Styles
   ============================================= */

/* Main Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 160px);
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
}

/* Match List */
.match-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.match-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 2px solid transparent;
    position: relative;
}

.match-item:hover {
    border-color: #FF4081;
    transform: translateX(5px);
}

.match-item .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    flex-shrink: 0;
}

.match-item .info {
    flex: 1;
    min-width: 0;
}

.match-item .info .name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.match-item .info .name .badge {
    background: #FFD700;
    color: #333;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
}

.match-item .info .last-message {
    font-size: 14px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-item .info .last-message .sender {
    color: #666;
    font-weight: 500;
}

.match-item .info .last-message .message-text {
    color: #999;
}

.match-item .unread-badge {
    background: #FF4081;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
    margin-left: 10px;
}

.match-item .time {
    font-size: 11px;
    color: #bbb;
    flex-shrink: 0;
    margin-left: 10px;
}

/* Empty State */
.no-matches {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-matches .icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.no-matches h3 {
    font-size: 22px;
    color: #333;
    margin-bottom: 10px;
}

.no-matches p {
    font-size: 16px;
    color: #999;
}

/* Chat View */
.chat-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.chat-header .back-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
    color: #666;
}

.chat-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.chat-header .info h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 2px;
}

.chat-header .info .status {
    font-size: 12px;
    color: #999;
}

/* Messages Area */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
}

/* Individual Message */
.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    margin-bottom: 8px;
    word-wrap: break-word;
    position: relative;
}

.message.mine {
    align-self: flex-end;
    background: #FF4081;
    color: white;
    border-bottom-right-radius: 5px;
}

.message.theirs {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.message .time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 3px;
    display: block;
}

.message.mine .time {
    text-align: right;
}

.message .read-receipt {
    font-size: 10px;
    margin-left: 5px;
}

/* Date Separator */
.date-separator {
    text-align: center;
    padding: 15px 0;
    color: #999;
    font-size: 12px;
    font-weight: 500;
}

/* Typing Indicator */
.typing-indicator {
    align-self: flex-start;
    padding: 10px 15px;
    background: white;
    border-radius: 15px;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: none;
    margin-bottom: 8px;
}

.typing-indicator.show {
    display: block;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    margin: 0 2px;
    animation: typing 1.4s infinite both;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Message Input */
.message-input {
    display: flex;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    gap: 10px;
}

.message-input input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.message-input input:focus {
    border-color: #FF4081;
}

.message-input .send-btn {
    background: #FF4081;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-input .send-btn:hover {
    background: #E91E63;
    transform: scale(1.05);
}

.message-input .send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 600px) {
    .chat-container {
        height: calc(100vh - 140px);
        padding: 5px;
    }
    
    .match-item {
        padding: 10px 12px;
    }
    
    .match-item .avatar {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }
    
    .message {
        max-width: 90%;
        font-size: 14px;
    }
    
    .chat-header {
        padding: 10px 15px;
    }
    
    .messages-area {
        padding: 15px;
    }
    
    .message-input {
        padding: 10px 15px;
    }
    
    .message-input input {
        font-size: 14px;
        padding: 8px 12px;
    }
}