/**
 * Prism Console - Merge Dashboard Styles
 *
 * A modern, dark-themed dashboard for PR and merge queue management.
 */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --border-color: #30363d;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-yellow: #d29922;
    --accent-red: #f85149;
    --accent-purple: #bc8cff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

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

/* Buttons */
.btn-primary,
.btn-action {
    padding: 8px 16px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary:hover,
.btn-action:hover {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.btn-primary:active,
.btn-action:active {
    transform: scale(0.98);
}

/* Toggle */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    cursor: pointer;
}

/* Sections */
.dashboard-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.dashboard-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Queue Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    padding: 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-value-success {
    color: var(--accent-green);
}

.stat-value-processing {
    color: var(--accent-blue);
}

.stat-value-error {
    color: var(--accent-red);
}

/* PR Cards */
.pr-card {
    padding: 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.pr-card:hover {
    border-color: var(--accent-blue);
}

.pr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pr-title a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
}

.pr-title a:hover {
    text-decoration: underline;
}

.pr-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.pr-repo {
    color: var(--text-secondary);
    font-size: 13px;
}

.pr-label {
    display: inline-block;
    padding: 2px 8px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.pr-queue {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

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

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

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-success {
    background-color: rgba(63, 185, 80, 0.2);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.status-error {
    background-color: rgba(248, 81, 73, 0.2);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

.status-pending {
    background-color: rgba(210, 153, 34, 0.2);
    color: var(--accent-yellow);
    border: 1px solid var(--accent-yellow);
}

.status-processing {
    background-color: rgba(88, 166, 255, 0.2);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.status-queued {
    background-color: rgba(188, 140, 255, 0.2);
    color: var(--accent-purple);
    border: 1px solid var(--accent-purple);
}

/* Tables */
.action-table {
    width: 100%;
    border-collapse: collapse;
}

.action-table thead {
    background-color: var(--bg-tertiary);
}

.action-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.action-table td {
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.action-table code {
    padding: 2px 6px;
    background-color: var(--bg-primary);
    border-radius: 3px;
    font-size: 12px;
    font-family: monospace;
}

.table-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 24px !important;
}

/* Empty States */
.empty-state,
.queue-empty,
.stats-loading,
.pr-list-loading {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    font-size: 18px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.modal-close:hover {
    background-color: var(--bg-tertiary);
}

.modal-body {
    padding: 20px;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-success {
    border-left: 3px solid var(--accent-green);
}

.notification-error {
    border-left: 3px solid var(--accent-red);
}

.notification-info {
    border-left: 3px solid var(--accent-blue);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .pr-actions {
        flex-direction: column;
    }

    .pr-actions .btn-action {
        width: 100%;
    }
}
