/* Admin Console Styles */
/* Extends the main styles.css from /web */

/* Reset and base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--sidebar-bg, #f8f9fa);
    color: var(--text-primary, #333);
}

/* Admin Container */
.admin-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--card-bg, #ffffff);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.admin-header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #333);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-header h1 i {
    color: var(--accent-blue, #1976d2);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.vm-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--toolbar-bg, #fafafa);
    border-radius: 20px;
    font-size: 13px;
}

.vm-status i {
    font-size: 10px;
}

.vm-status.running i {
    color: #4caf50;
}

.vm-status.stopped i {
    color: #f44336;
}

.vm-status.unknown i {
    color: #ff9800;
}

/* Admin Content Layout */
.admin-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Navigation */
.admin-sidebar {
    width: 240px;
    background: var(--card-bg, #ffffff);
    border-right: 1px solid var(--border-color, #e0e0e0);
    padding: 16px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #999);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary, #666);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: var(--accent-blue-light, #e3f2fd);
    color: var(--accent-blue, #1976d2);
}

.nav-item.active {
    background: var(--accent-blue-light, #e3f2fd);
    color: var(--accent-blue, #1976d2);
    font-weight: 500;
    border-right: 3px solid var(--accent-blue, #1976d2);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* Main Content Area */
.admin-main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--sidebar-bg, #f8f9fa);
}

/* Section Styles */
.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary, #333);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2 i {
    color: var(--accent-blue, #1976d2);
}

.section-header p {
    margin: 0;
    color: var(--text-secondary, #666);
    font-size: 14px;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Action Cards */
.action-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.action-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.card-icon i {
    font-size: 20px;
    color: white;
}

.card-content {
    flex: 1;
}

.card-content h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #333);
}

.card-content p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary, #666);
    line-height: 1.5;
}

.card-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

/* Config Card */
.config-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    margin-bottom: 24px;
}

.config-card .card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.config-card .card-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-card .card-header h3 i {
    color: var(--text-muted, #999);
}

.config-card .card-body {
    padding: 20px;
}

/* Form Rows */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary, #666);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    font-size: 13px;
    background: var(--input-bg, #ffffff);
    color: var(--text-primary, #333);
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-blue, #1976d2);
    box-shadow: 0 0 0 2px var(--accent-blue-light, #e3f2fd);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn i {
    font-size: 12px;
}

.btn-primary {
    background: var(--accent-blue, #1976d2);
    color: white;
}

.btn-primary:hover {
    background: #1565c0;
}

.btn-secondary {
    background: var(--toolbar-bg, #fafafa);
    color: var(--text-primary, #333);
    border: 1px solid var(--border-color, #e0e0e0);
}

.btn-secondary:hover {
    background: var(--accent-blue-light, #e3f2fd);
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    padding: 8px;
    background: transparent;
    border: none;
}

.btn-icon:hover {
    background: var(--accent-blue-light, #e3f2fd);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Card with header and body */
.card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.card-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--text-muted, #999);
}

.card-header-actions {
    display: flex;
    gap: 8px;
}

.card-body {
    padding: 20px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--text-muted, #999);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 13px;
}

/* Log Container */
.log-container {
    background: var(--code-bg, #f5f5f5);
    border-radius: 8px;
    padding: 16px;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Output Panel */
.output-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    height: 100vh;
    background: var(--card-bg, #ffffff);
    border-left: 1px solid var(--border-color, #e0e0e0);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: right 0.3s ease;
}

.output-panel.open {
    right: 0;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.output-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.output-actions {
    display: flex;
    gap: 8px;
}

.output-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--toolbar-bg, #fafafa);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    font-size: 13px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted, #999);
}

.output-status.running .status-indicator {
    background: #ff9800;
    animation: pulse 1s infinite;
}

.output-status.success .status-indicator {
    background: #4caf50;
}

.output-status.error .status-indicator {
    background: #f44336;
}

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

.output-content {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    background: var(--code-bg, #f5f5f5);
}

.output-content pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-primary, #333);
}

/* Backup List */
.backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.backup-item:last-child {
    border-bottom: none;
}

.backup-item-info {
    display: flex;
    flex-direction: column;
}

.backup-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #333);
}

.backup-item-size {
    font-size: 12px;
    color: var(--text-muted, #999);
}

.backup-item-actions {
    display: flex;
    gap: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 200px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

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

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color, #e0e0e0);
        display: flex;
        flex-wrap: wrap;
        padding: 8px;
    }

    .nav-section {
        margin-bottom: 0;
    }

    .nav-section-title {
        display: none;
    }

    .nav-item {
        padding: 8px 12px;
        border-radius: 6px;
    }

    .nav-item.active {
        border-right: none;
    }

    .output-panel {
        width: 100%;
        right: -100%;
    }
}

/* Dark theme support */
html.dark-theme .admin-header,
html.dark-theme .admin-sidebar,
html.dark-theme .card,
html.dark-theme .action-card,
html.dark-theme .config-card,
html.dark-theme .output-panel {
    background: var(--card-bg);
}

html.dark-theme .log-container,
html.dark-theme .output-content {
    background: var(--code-bg);
}

/* Operations Dashboard Styles */

/* System Resources */
.system-resources {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .system-resources {
        grid-template-columns: 1fr;
    }
}

.resource-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    background: var(--toolbar-bg, #fafafa);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e0e0e0);
}

.resource-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #333);
    display: flex;
    align-items: center;
    gap: 8px;
}

.resource-label i {
    font-size: 14px;
    color: var(--accent-blue, #1976d2);
}

.resource-detail {
    font-size: 12px;
    color: var(--text-muted, #999);
    text-align: center;
}

/* Circular Progress */
.circular-progress {
    position: relative;
    width: 120px;
    height: 120px;
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--border-color, #e0e0e0);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: url(#progressGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

.progress-ring-fill.warning {
    stroke: #ff9800;
}

.progress-ring-fill.danger {
    stroke: #f44336;
}

.progress-ring-fill.normal {
    stroke: #1976d2;
}

.progress-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-percent {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #333);
}

/* Components Grid */
.components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.component-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--toolbar-bg, #fafafa);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e0e0e0);
    transition: all 0.2s ease;
}

.component-item:hover {
    background: var(--card-bg, #ffffff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.component-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-muted, #999);
}

.component-status-indicator.running {
    background: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

.component-status-indicator.starting {
    background: #ff9800;
    animation: pulse 1s infinite;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.4);
}

.component-status-indicator.stopped {
    background: #f44336;
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.4);
}

.component-status-indicator.loading {
    background: var(--text-muted, #999);
    animation: pulse 1s infinite;
}

.component-status-indicator.unknown {
    background: #9e9e9e;
}

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

.component-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.component-port {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent-blue, #1976d2);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.component-status-text {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.component-item[data-status="running"] .component-status-text {
    background: #e8f5e9;
    color: #2e7d32;
}

.component-item[data-status="starting"] .component-status-text {
    background: #fff3e0;
    color: #ef6c00;
}

.component-item[data-status="stopped"] .component-status-text {
    background: #ffebee;
    color: #c62828;
}

.component-item[data-status="unknown"] .component-status-text {
    background: var(--toolbar-bg, #fafafa);
    color: var(--text-muted, #999);
}

/* Dark theme adjustments for operations dashboard */
html.dark-theme .component-item {
    background: var(--code-bg);
}

html.dark-theme .component-item:hover {
    background: var(--card-bg);
}

html.dark-theme .component-item[data-status="running"] .component-status-text {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

html.dark-theme .component-item[data-status="starting"] .component-status-text {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
}

html.dark-theme .component-item[data-status="stopped"] .component-status-text {
    background: rgba(244, 67, 54, 0.2);
    color: #ef5350;
}

html.dark-theme .resource-item {
    background: var(--code-bg);
}

html.dark-theme .progress-ring-bg {
    stroke: var(--code-bg);
}

html.dark-theme .progress-percent {
    color: var(--text-primary);
}

/* Auto-refresh button */
#autoRefreshBtn.active {
    background: var(--accent-blue, #1976d2);
    color: white;
    border-color: var(--accent-blue, #1976d2);
}

#autoRefreshBtn.active:hover {
    background: #1565c0;
}

#autoRefreshBtn.active i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Component Action Buttons (Start/Stop) */
.component-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #e0e0e0);
    background: var(--card-bg, #ffffff);
    color: var(--text-muted, #999);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.component-action-btn:hover {
    background: var(--toolbar-bg, #fafafa);
    border-color: var(--accent-blue, #1976d2);
    color: var(--accent-blue, #1976d2);
}

.component-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.component-action-btn.loading i {
    animation: spin 1s linear infinite;
}

/* Start button (green) when component is stopped */
.component-item[data-status="stopped"] .component-action-btn {
    border-color: #4caf50;
    color: #4caf50;
}

.component-item[data-status="stopped"] .component-action-btn:hover {
    background: #4caf50;
    color: white;
}

/* Stop button (red) when component is running */
.component-item[data-status="running"] .component-action-btn {
    border-color: #f44336;
    color: #f44336;
}

.component-item[data-status="running"] .component-action-btn:hover {
    background: #f44336;
    color: white;
}

/* Orange when starting */
.component-item[data-status="starting"] .component-action-btn {
    border-color: #ff9800;
    color: #ff9800;
    cursor: wait;
}

/* Dark theme adjustments */
html.dark-theme .component-action-btn {
    background: var(--code-bg);
    border-color: var(--border-color);
}

html.dark-theme .component-action-btn:hover {
    background: var(--card-bg);
}

html.dark-theme .component-item[data-status="stopped"] .component-action-btn:hover {
    background: #4caf50;
    color: white;
}

html.dark-theme .component-item[data-status="running"] .component-action-btn:hover {
    background: #f44336;
    color: white;
}

/* ========================================
   Queue Management Styles
   ======================================== */

/* Queue Selector */
.queue-selector-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.queue-select {
    flex: 1;
    max-width: 400px;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    background: var(--card-bg, #ffffff);
    color: var(--text-color, #333);
    cursor: pointer;
}

.queue-select:focus {
    outline: none;
    border-color: var(--accent-blue, #1976d2);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.queue-message-count {
    font-size: 14px;
    color: var(--text-muted, #666);
    font-weight: 500;
}

.queue-message-count .count {
    color: var(--accent-blue, #1976d2);
    font-weight: 600;
}

/* Queue Messages Container */
.queue-messages-container {
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

/* Custom scrollbar for queue messages */
.queue-messages-container::-webkit-scrollbar {
    width: 8px;
}

.queue-messages-container::-webkit-scrollbar-track {
    background: var(--toolbar-bg, #fafafa);
    border-radius: 4px;
}

.queue-messages-container::-webkit-scrollbar-thumb {
    background: var(--border-color, #e0e0e0);
    border-radius: 4px;
}

.queue-messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted, #999);
}

.queue-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted, #999);
}

.queue-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.queue-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* Message List */
.queue-message-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.queue-message-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--toolbar-bg, #fafafa);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.queue-message-item:hover {
    border-color: var(--accent-blue, #1976d2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message-index {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-blue, #1976d2);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-preview {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    color: var(--text-color, #333);
    background: var(--code-bg, #f5f5f5);
    padding: 8px 12px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.message-meta {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted, #999);
}

.message-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.message-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-content.modal-large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted, #999);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-color, #333);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

/* Code Textarea */
.code-textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    min-height: 200px;
}

/* Message Details */
.message-details {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.message-details-section {
    margin-bottom: 20px;
}

.message-details-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.message-details-section pre {
    background: var(--code-bg, #f5f5f5);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Button variants */
.btn-danger {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.btn-danger:hover {
    background: #d32f2f;
    border-color: #d32f2f;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Card header actions */
.card-header-actions {
    display: flex;
    gap: 8px;
}

/* Loading state for messages */
.queue-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted, #999);
}

.queue-loading i {
    font-size: 24px;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

/* Dark theme adjustments for Queue Management */
html.dark-theme .queue-select {
    background: var(--code-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

html.dark-theme .queue-message-item {
    background: var(--code-bg);
    border-color: var(--border-color);
}

html.dark-theme .message-preview {
    background: var(--card-bg);
}

html.dark-theme .modal-content {
    background: var(--card-bg);
}

html.dark-theme .message-details-section pre {
    background: var(--code-bg);
}
