/* Pre-Hospital Chat System Styles */
#phcs-chat-container {
    display: flex;
    height: 80vh;
    max-width: 1200px;
    margin: 0 auto;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Sidebar Styles */
#phcs-sidebar {
    width: 250px;
    background: #f8f9fa;
    border-right: 1px solid #e1e5e9;
    display: flex;
    flex-direction: column;
}

#phcs-rooms-list h3 {
    margin: 0;
    padding: 20px;
    background: #005eb8;
    color: white;
    font-size: 16px;
    font-weight: 600;
}

#phcs-rooms-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.phcs-category {
    margin-bottom: 20px;
}

.phcs-category h4 {
    margin: 0 0 10px 20px;
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.phcs-room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
    margin: 2px 10px;
}

.phcs-room-item:hover {
    background: #e9ecef;
}

.phcs-room-item.active {
    background: #005eb8;
    color: white;
}

.phcs-room-name {
    font-weight: 500;
    font-size: 14px;
}

.phcs-room-count {
    background: #dee2e6;
    color: #6c757d;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.phcs-private-room .phcs-room-name::before {
    content: "🔒 ";
    font-size: 12px;
}

/* Main Chat Area */
#phcs-main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

#phcs-chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
}

#phcs-current-room {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

#phcs-room-info {
    font-size: 12px;
    color: #6c757d;
}

.phcs-room-stats span {
    margin-right: 15px;
}

.phcs-private-badge {
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

/* Messages Container */
#phcs-messages-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

#phcs-messages {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.phcs-message {
    margin-bottom: 15px;
    padding: 8px 0;
}

.phcs-message-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.phcs-username {
    font-weight: 600;
    font-size: 14px;
    color: #212529;
    margin-right: 8px;
}

.phcs-username.phcs-admin {
    color: #dc3545;
}

.phcs-username.phcs-moderator {
    color: #fd7e14;
}

.phcs-timestamp {
    font-size: 11px;
    color: #6c757d;
}

.phcs-message-content {
    font-size: 14px;
    line-height: 1.4;
    color: #212529;
    word-wrap: break-word;
}

.phcs-edited {
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
    margin-top: 2px;
}

/* Input Area */
#phcs-input-container {
    padding: 15px 20px;
    border-top: 1px solid #e1e5e9;
    background: #f8f9fa;
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

#phcs-message-input {
    flex: 1;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 14px;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    font-family: inherit;
}

#phcs-message-input:focus {
    outline: none;
    border-color: #005eb8;
    box-shadow: 0 0 0 2px rgba(0, 94, 184, 0.2);
}

#phcs-send-button {
    background: #005eb8;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 80px;
}

#phcs-send-button:hover {
    background: #004a94;
}

#phcs-send-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* User Panel */
#phcs-user-panel {
    width: 200px;
    background: #f8f9fa;
    border-left: 1px solid #e1e5e9;
    padding: 20px;
}

#phcs-user-info h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
}

#phcs-display-name-section {
    margin-bottom: 15px;
}

#phcs-display-name-section label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
}

#phcs-display-name-input {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 13px;
    margin-bottom: 8px;
}

#phcs-display-name-input:focus {
    outline: none;
    border-color: #005eb8;
    box-shadow: 0 0 0 2px rgba(0, 94, 184, 0.2);
}

#phcs-update-name {
    background: #007f3b;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

#phcs-update-name:hover {
    background: #006030;
}

/* Responsive Design */
@media (max-width: 768px) {
    #phcs-chat-container {
        flex-direction: column;
        height: 90vh;
    }
    
    #phcs-sidebar {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #e1e5e9;
    }
    
    #phcs-user-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e1e5e9;
        padding: 15px;
    }
    
    #phcs-rooms-container {
        height: 150px;
    }
    
    .phcs-room-item {
        padding: 6px 15px;
    }
    
    .phcs-room-name {
        font-size: 13px;
    }
    
    #phcs-messages {
        padding: 15px;
    }
    
    .phcs-message {
        margin-bottom: 10px;
    }
    
    .phcs-message-content {
        font-size: 13px;
    }
}

/* Scrollbar Styling */
#phcs-messages::-webkit-scrollbar,
#phcs-rooms-container::-webkit-scrollbar {
    width: 6px;
}

#phcs-messages::-webkit-scrollbar-track,
#phcs-rooms-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#phcs-messages::-webkit-scrollbar-thumb,
#phcs-rooms-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#phcs-messages::-webkit-scrollbar-thumb:hover,
#phcs-rooms-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading States */
.phcs-loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.phcs-loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #005eb8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.phcs-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
}

/* Success States */
.phcs-success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
}

/* Typing Indicator */
.phcs-typing {
    padding: 10px 20px;
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

/* Message Status */
.phcs-message-status {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

.phcs-message-status.sent {
    color: #28a745;
}

.phcs-message-status.error {
    color: #dc3545;
}

/* Room Status Indicators */
.phcs-room-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.phcs-room-status.online {
    background: #28a745;
}

.phcs-room-status.offline {
    background: #6c757d;
}

.phcs-room-status.busy {
    background: #ffc107;
}

/* Accessibility */
.phcs-room-item:focus,
#phcs-send-button:focus,
#phcs-update-name:focus {
    outline: 2px solid #005eb8;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    #phcs-chat-container {
        border: 2px solid #000000;
    }
    
    .phcs-room-item:hover {
        background: #000000;
        color: #ffffff;
    }
    
    #phcs-send-button {
        border: 2px solid #000000;
    }
} 