:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
}

.container {
    display: flex;
    min-height: 100vh;
}

.admin-panel {
    flex: 1;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.admin-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.5rem;
}

.admin-header button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.admin-header button:hover {
    opacity: 0.8;
}

.admin-filters {
    padding: 15px 20px;
    background-color: var(--light-color);
    border-bottom: 1px solid #ddd;
}

.filter-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.requests-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.request-item {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid var(--primary-color);
}

.request-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.request-item.active {
    border-left-color: var(--success-color);
    background-color: #f8f9fa;
}

.request-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.request-project {
    background-color: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.request-status {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 12px;
}

.status-open {
    background-color: var(--danger-color);
    color: white;
}

.status-in_progress {
    background-color: var(--warning-color);
    color: white;
}

.status-resolved {
    background-color: var(--success-color);
    color: white;
}

.request-user {
    font-weight: bold;
    margin-bottom: 5px;
}

.request-preview {
    color: #666;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.request-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 11px;
    color: #7f8c8d;
}

.has-attachments {
    color: #3498db;
    font-size: 12px;
}

.request-time {
    font-size: 0.8rem;
    color: #999;
}

.chat-container {
    flex: 2;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #ddd;
}

.chat-header {
    padding: 15px 20px;
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-size: 1.2rem;
}

.chat-actions {
    display: flex;
    gap: 5px;
}

.chat-actions button {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.chat-actions button:hover {
    opacity: 0.8;
}

.chat-actions button.warning {
    background-color: var(--warning-color);
}

.chat-actions button.danger {
    background-color: var(--danger-color);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.message {
    margin-bottom: 15px;
    display: flex;
}

.message.user {
    justify-content: flex-start;
}

.message.support {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
}

.message.user .message-bubble {
    background: white;
    color: #2c3e50;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message.support .message-bubble {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    margin-top: 5px;
    display: block;
}

.message.user .message-time {
    text-align: left;
    color: #7f8c8d;
}

.message.support .message-time {
    text-align: right;
    color: rgba(255, 255, 255, 0.8);
}

.message-text {
    margin-bottom: 0;
}

.message-text:has(+ .message-attachments) {
    margin-bottom: 8px;
}

.message-attachments {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attachment-item {
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.message.user .attachment-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.message.support .attachment-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
}

.attachment-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.attachment-link {
    display: flex;
    align-items: center;
    padding: 8px;
    text-decoration: none;
    color: inherit;
}

.image-attachment .attachment-link {
    flex-direction: column;
    align-items: flex-start;
}

.file-attachment .attachment-link {
    flex-direction: row;
}

.attachment-image {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    object-fit: cover;
}

.file-icon {
    font-size: 20px;
    margin-right: 10px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.attachment-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-size: 12px;
    font-weight: 500;
    word-break: break-word;
}

.message.user .attachment-name {
    color: white;
}

.message.support .attachment-name {
    color: #2c3e50;
}

.attachment-size {
    font-size: 10px;
    margin-top: 2px;
}

.message.user .attachment-size {
    color: rgba(255, 255, 255, 0.7);
}

.message.support .attachment-size {
    color: #7f8c8d;
}

.chat-input {
    padding: 15px;
    background-color: white;
    border-top: 1px solid #ddd;
    display: none;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

#admin-message-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 24px;
    outline: none;
}

.attach-btn {
    background: #95a5a6;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 12px;
}

.attach-btn:hover {
    background: #7f8c8d;
}

.chat-input button {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.chat-input button:hover {
    background-color: #2980b9;
}

.admin-attachments {
    padding: 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: none;
}

.admin-file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 5px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-file-preview .file-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.admin-file-preview .file-name {
    font-size: 12px;
    font-weight: 500;
    color: #2c3e50;
}

.admin-file-preview .file-size {
    font-size: 10px;
    color: #7f8c8d;
}

.admin-file-preview .file-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.2s;
}

.admin-file-preview .file-remove:hover {
    background: #e74c3c;
    color: white;
}


.no-chat-selected {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #999;
    font-style: italic;
    flex-direction: column;
}

.no-chat-selected svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-requests {
    text-align: center;
    padding: 40px;
    color: #999;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}


.project-expediente {
    background-color: #9b59b6;
}

.project-videollamada {
    background-color: #e74c3c;
}

.project-farmacia {
    background-color: #f39c12;
}

.project-citas {
    background-color: #1abc9c;
}

.project-general {
    background-color: #95a5a6;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .chat-container {
        border-left: none;
        border-top: 1px solid #ddd;
    }

    .message-bubble {
        max-width: 90%;
    }

    .attachment-image {
        max-width: 150px;
        max-height: 120px;
    }

    .chat-input-wrapper {
        gap: 5px;
    }
}