/* Admin Concierge Management Styles */

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

.header {
    background-color: #343a40;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

.conversation-item {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.conversation-detail-card {
    display: none;
}

.conversation-detail-card.visible {
    display: block;
}

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

.conversation-item.selected {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

/* New message indicators */
.conversation-item.has-new-messages {
    background-color: #fff3cd;
    border-color: #ffc107;
    border-left: 4px solid #ffc107;
}

.new-message-indicator {
    color: #dc3545;
    font-size: 1.2rem;
    margin-left: 0.5rem;
    animation: pulse 2s infinite;
}

.new-message-badge {
    background-color: #dc3545;
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

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

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

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-in_progress {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-resolved {
    background-color: #d4edda;
    color: #155724;
}

.status-closed {
    background-color: #f8d7da;
    color: #721c24;
}

.priority-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.priority-low {
    background-color: #e9ecef;
    color: #495057;
}

.priority-medium {
    background-color: #fff3cd;
    color: #856404;
}

.priority-high {
    background-color: #f8d7da;
    color: #721c24;
}

.priority-urgent {
    background-color: #dc3545;
    color: white;
}

/* Message styles moved to messages section below */

.message-meta {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.error {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: bold;
}

.filter-group select {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.conversation-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-messages-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
}

.message-input-area {
    border-top: 1px solid #ddd;
    padding-top: 1rem;
}

.message-input-form {
    display: flex;
    gap: 0.5rem;
}

.message-textarea {
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    resize: vertical;
}

.conversation-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.conversation-item-title {
    margin: 0;
    font-size: 1.1rem;
}

.conversation-item-meta {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.conversation-item-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.conversation-item-assignment {
    font-size: 0.9rem;
    color: #495057;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.py-4 {
    padding: 1rem 0;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Conversation Info */
.conversation-info {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.info-row {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row strong {
    min-width: 120px;
    color: #495057;
}

/* Messages Section */
.messages-section {
    margin-bottom: 1.5rem;
}

.messages-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    background-color: #f8f9fa;
    min-height: 100px;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
}

/* Unread message indicators */
.message.unread-message {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.unread-indicator {
    color: #dc3545;
    font-size: 1.2rem;
    margin-left: 0.5rem;
    animation: pulse 2s infinite;
}

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

.admin-message {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    margin-left: 2rem;
}

.user-message {
    background-color: #f1f8e9;
    border-left: 4px solid #4caf50;
    margin-right: 2rem;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.message-time {
    color: #6c757d;
    font-size: 0.8rem;
}

.message-content {
    line-height: 1.4;
    white-space: pre-wrap;
}

.message-attachments {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.message-attachments ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.message-attachments li {
    margin-bottom: 0.25rem;
}

.message-attachments a {
    color: #007bff;
    text-decoration: none;
}

.message-attachments a:hover {
    text-decoration: underline;
}

.email-viewer-container {
    margin-top: 0.5rem;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.email-viewer-loading {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.email-content {
    padding: 1rem;
    background-color: white;
    border-radius: 4px;
    max-height: 500px;
    overflow-y: auto;
}

.email-attachments {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.email-attachments ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.email-attachments li {
    margin-bottom: 0.25rem;
}

.email-attachments a {
    color: #007bff;
    text-decoration: none;
}

.email-attachments a:hover {
    text-decoration: underline;
}

/* Message Input Section */
.message-input-section {
    border-top: 1px solid #dee2e6;
    padding-top: 1.5rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.input-group textarea {
    flex: 1;
    resize: vertical;
    min-height: 80px;
}

.input-group button {
    height: fit-content;
    padding: 0.5rem 1rem;
}

/* Conversation Item Actions */
.conversation-item-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.conversation-item-actions .btn {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .admin-message {
        margin-left: 0.5rem;
    }
    
    .user-message {
        margin-right: 0.5rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group button {
        width: 100%;
    }
}
