/* ========================================
   CONVERSATION & NOTIFICATION STYLES
   Chat, messages, notifications, adoption
   ======================================== */

.chat-container {
    display: flex;
    height: 100%;
    overflow: hidden;
    background: #fff;
    border-radius: 20px;
}

.chat-sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.chat-sidebar-header {
    padding: 24px 20px;
    background: var(--gradient-bg);
    color: white;
}

.chat-sidebar-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
    background: #fafafa;
}

.conversation-item {
    background: transparent;
    padding: 16px 20px;
    margin: 4px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    gap: 15px;
    align-items: center;
    border: 1px solid transparent;
}

.conversation-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.conversation-item.active {
    background: rgba(254, 60, 114, 0.05);
    border-color: rgba(254, 60, 114, 0.1);
}

.conversation-pet-photo {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
}

.conversation-avatar-stack {
    position: relative;
}

.conversation-user-avatar-mini {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    object-fit: cover;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.conversation-header h4 {
    margin: 0;
    font-weight: 800;
    color: #222;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(254, 60, 114, 0.3);
}

.conversation-preview {
    margin: 0;
    color: #777;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chat Main Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    min-width: 0;
}

.chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px;
}

.chat-welcome i {
    font-size: 5rem;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #eee, #ddd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.chat-welcome p {
    font-size: 1.3rem;
    font-weight: 700;
    color: #aaa;
    max-width: 280px;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.chat-back-btn {
    background: #f0f2f5;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.chat-back-btn:hover {
    background: #e4e6eb;
    color: var(--primary-color);
    transform: translateX(-3px);
}

.chat-header-photo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
}

.chat-header-info {
    flex: 1;
    min-width: 0;
}

.chat-header-info h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #222;
}

.chat-header-info small {
    color: #777;
    font-size: 0.9rem;
    display: block;
}

.chat-other-role {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 6px;
}

.chat-other-role.role-adopter {
    background: rgba(21, 101, 192, 0.08);
    color: #1565c0;
}

.chat-other-role.role-owner {
    background: rgba(46, 125, 50, 0.08);
    color: #2e7d32;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fafafa;
}

.message {
    display: flex;
    width: 100%;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.message.sent .message-content {
    background: var(--gradient-bg);
    color: white;
    border-bottom-right-radius: 6px;
}

.message.received .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.message-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.7rem;
}

.message.sent .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.message.received .message-time {
    color: #999;
}

/* Chat Input Area */
.chat-input-area {
    padding: 20px 24px;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 15px;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    padding: 14px 24px;
    background: #f0f2f5;
    border: 2px solid transparent;
    border-radius: 30px;
    outline: none;
    font-size: 1rem;
    transition: all 0.3s;
}

.chat-input-area input:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 5px rgba(254, 60, 114, 0.1);
}

.chat-input-area button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 15px rgba(254, 60, 114, 0.3);
}

.chat-input-area button:hover {
    transform: scale(1.15) rotate(-10deg);
}

/* Adoption Celebration Card */
.adoption-message-wrapper {
    padding: 20px 0;
}

.adoption-message {
    background: linear-gradient(135deg, #ffffff, #f0fdf4);
    border: 3px solid #4ade80;
    border-radius: 32px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(74, 222, 128, 0.15);
    max-width: 95%;
    margin: 0 auto;
}

.adoption-message-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.adoption-message p {
    font-size: 1.25rem;
    font-weight: 800;
    color: #166534;
    line-height: 1.4;
    margin-bottom: 24px;
}

.btn-adoption-terms {
    background: #166534;
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(22, 101, 52, 0.4);
}

.btn-adoption-terms:hover {
    background: #14532d;
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(22, 101, 52, 0.5);
}

/* Responsive */
@media (max-width: 500px) {
    .chat-sidebar {
        width: 100%;
        display: none;
    }

    .chat-sidebar.active {
        display: flex;
    }

    .chat-main {
        display: flex;
    }

    .chat-main.hidden {
        display: none;
    }

    .chat-sidebar-header {
        padding: 20px 16px;
    }

    .conversation-item {
        margin: 6px 10px;
        padding: 14px;
    }

    .chat-header {
        padding: 14px 16px;
    }

    .chat-messages {
        padding: 16px;
    }
}