/* Custom styles for Parent Messaging App */

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Messages Container */
.messages-container {
    height: 400px;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* Message Bubbles */
.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message.sent {
    align-items: flex-end;
}

.message.received {
    align-items: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

.message.sent .message-bubble {
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 5px;
}

.message.received .message-bubble {
    background-color: #e9ecef;
    color: #212529;
    border-bottom-left-radius: 5px;
}

.message-info {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 5px;
    text-align: center;
}

.message.sent .message-info {
    text-align: right;
}

.message.received .message-info {
    text-align: left;
}

/* Message Status Indicators */
.message-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.message-status i {
    font-size: 0.6rem;
}

.status-sent {
    color: #6c757d;
}

.status-delivered {
    color: #17a2b8;
    animation: deliveredPulse 0.6s ease-in-out;
}

.status-read {
    color: #28a745;
}

.status-failed {
    color: #dc3545;
}

.status-unread {
    color: #ffc107;
}

/* Status animations */
.message-status.status-read i {
    animation: statusRead 0.3s ease-in-out;
}

@keyframes statusRead {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes deliveredPulse {
    0% { opacity: 0.7; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

/* Unread badges */
.badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* Conversation preview styling */
.conversation-preview {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Message status container */
.message-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.message.sent .message-info {
    flex-direction: row-reverse;
}

/* Status indicator improvements */
.message-status {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.message-status:hover {
    opacity: 1;
}

/* Failed message styling */
.message.sent .message-bubble.status-failed {
    background-color: #dc3545;
    opacity: 0.8;
}

/* Conversations List */
.conversation-item {
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
}

.conversation-item:hover {
    background-color: #f8f9fa;
}

.conversation-item.active {
    background-color: #e3f2fd;
    border-left-color: #007bff;
}

.conversation-item .conversation-title {
    font-weight: 600;
    color: #212529;
}

.conversation-item .conversation-preview {
    font-size: 0.875rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-item .conversation-meta {
    font-size: 0.75rem;
    color: #adb5bd;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alert Animations */
.alert {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .messages-container {
        height: 300px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .conversation-item .conversation-preview {
        max-width: 150px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 10px;
    }
    
    .messages-container {
        height: 250px;
    }
    
    .message-bubble {
        max-width: 90%;
    }
}

/* Custom Scrollbar */
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Form Focus States */
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button Hover Effects */
.btn:hover {
    transform: translateY(-1px);
    transition: transform 0.2s;
}

/* Card Shadows */
.card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s;
}

/* Empty State Styling */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Multiple Select Dropdown */
.form-select[multiple] {
    min-height: 120px;
    max-height: 200px;
}

.form-select[multiple] option {
    padding: 8px 12px;
    border-bottom: 1px solid #f8f9fa;
}

.form-select[multiple] option:hover {
    background-color: #f8f9fa;
}

.form-select[multiple] option:checked {
    background-color: #007bff;
    color: white;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #6c757d;
    font-style: italic;
}

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

.typing-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #6c757d;
    margin: 0 2px;
    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.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
} 

/* WebSocket Connection Status */
.connection-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.connection-indicator.connected {
    color: #198754;
    background-color: rgba(25, 135, 84, 0.1);
}

.connection-indicator.disconnected {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.connection-indicator i {
    font-size: 0.75rem;
}

/* Typing Indicator */
.typing-indicator {
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    border-left: 3px solid #6c757d;
    animation: typing-pulse 1.5s infinite;
}

.typing-indicator i {
    animation: typing-dots 1.4s infinite;
}

@keyframes typing-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes typing-dots {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* User Status Messages */
.user-status-message {
    padding: 0.25rem 0.5rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
    font-style: italic;
    opacity: 0.8;
}

/* Message Read Status */
.message.read {
    opacity: 0.8;
}

.message.read::after {
    content: "✓✓";
    color: #198754;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Real-time Message Animation */
.message.new-message {
    animation: slideInMessage 0.3s ease-out;
}

@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* WebSocket Connection Status in Navbar */
.navbar-text .connection-indicator {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
}

/* Responsive adjustments for connection status */
@media (max-width: 768px) {
    .connection-indicator {
        font-size: 0.75rem;
        padding: 0.125rem 0.25rem;
    }
    
    .navbar-text .connection-indicator {
        font-size: 0.625rem;
        padding: 0.125rem 0.25rem;
    }
}

/* Enhanced Features Styles */

/* Message Actions */
.message-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.message:hover .message-actions {
    opacity: 1;
}

.action-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 0.875rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.action-btn:hover {
    background-color: #f8f9fa;
    color: #495057;
    transform: scale(1.1);
}

.action-btn:active {
    transform: scale(0.95);
}

/* Reply Reference */
.reply-reference {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-left: 3px solid #007bff;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.reply-to-content {
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Reply Mode Container */
.reply-container {
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.reply-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #1976d2;
}

.cancel-reply {
    background: none;
    border: none;
    color: #757575;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.cancel-reply:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Message Reactions */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.reaction-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.reaction-item:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: scale(1.05);
}

.reaction-item.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* Reaction Picker */
.reaction-picker {
    position: absolute;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    z-index: 1000;
    top: 100%;
    left: 0;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.25rem;
}

.emoji-grid button {
    background: none;
    border: none;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.emoji-grid button:hover {
    background-color: #f8f9fa;
}

/* Edit Mode */
.edit-mode {
    width: 100%;
}

.edit-input {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.5rem;
    font-family: inherit;
    font-size: inherit;
    resize: vertical;
    min-height: 60px;
}

.edit-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

/* Edited Indicator */
.edited-indicator {
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
    margin-left: 0.5rem;
}

/* Pinned Messages Section */
.pinned-messages {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.pinned-messages-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #856404;
}

.pinned-message-item {
    background-color: white;
    border: 1px solid #ffeaa7;
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.pinned-message-item:last-child {
    margin-bottom: 0;
}

.pinned-message-content {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.pinned-message-meta {
    font-size: 0.75rem;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.unpin-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.125rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.unpin-btn:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Bookmarks Section */
.bookmarks-section {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.bookmarks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.bookmarks-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.bookmark-item {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.bookmark-item:hover {
    border-color: #007bff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.bookmark-content {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.bookmark-meta {
    font-size: 0.75rem;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Bookmarked message indicator */
.message.bookmarked .action-btn[title="Bookmark"] {
    color: #ffc107;
}

.message.bookmarked .action-btn[title="Bookmark"]:hover {
    color: #e0a800;
}

/* Pinned message indicator */
.message.pinned {
    border-left: 3px solid #ffc107;
    background-color: #fffbf0;
}

.message.pinned .action-btn[title="Pin"] {
    color: #ffc107;
}

/* Responsive adjustments for enhanced features */
@media (max-width: 768px) {
    .message-actions {
        gap: 0.125rem;
    }
    
    .action-btn {
        font-size: 0.75rem;
        padding: 0.125rem;
    }
    
    .reaction-picker {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        top: auto;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(8, 1fr);
    }
    
    .edit-actions {
        flex-direction: column;
    }
    
    .reply-reference,
    .reply-container {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
}

/* Real-time update animations */
.deleting {
    opacity: 0;
    transform: translateX(-100%);
    transition: all 0.3s ease-out;
}

.edited-indicator {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

/* Reaction animation for new reactions */
.reaction-item {
    animation: reactionPulse 0.3s ease-out;
}

@keyframes reactionPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Message edit indicator */
.message-bubble:has(.edited-indicator) {
    border-left: 3px solid #ffc107;
}

/* New message animations */
.new-message {
    animation: slideInFromRight 0.3s ease-out;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
} 