/* Lab Builder Control Plane - Consolidated Styles */

/* ============================================
   1. CSS Variables / Theme
   ============================================ */
:root {
    /* Clean, professional dark palette */
    --color-bg: #0d1117;
    --color-bg-secondary: #161b22;
    --color-bg-tertiary: #21262d;
    --color-border: #30363d;
    --color-text: #e6edf3;
    --color-text-muted: #8b949e;
    
    /* Single accent color - NVIDIA Green (used sparingly) */
    --color-accent: #76B900;
    
    /* Action button colors - professional and distinct */
    --color-primary: #238636;        /* Green - Deploy/positive actions */
    --color-primary-hover: #2ea043;
    --color-secondary: #6e7681;      /* Grey - neutral actions like Install */
    --color-secondary-hover: #848d97;
    --color-warning: #9e6a03;        /* Amber - destructive but recoverable (Destroy) */
    --color-warning-hover: #bb8009;
    --color-danger: #da3633;         /* Red - permanent actions (Remove) */
    --color-danger-hover: #f85149;
    
    /* Status colors - consistent across UI */
    --color-success: #238636;        /* Same as primary green */
    --color-status-warning: #9e6a03; /* Amber for in-progress states */
    --color-status-danger: #da3633;  /* Red for failed states */
    
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 6px;
    --shadow: 0 3px 6px rgba(0,0,0,0.3);
}

/* ============================================
   2. Base / Reset
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   3. Layout
   ============================================ */

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

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-text .brand {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-muted);
}

.logo-text .product {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e6edf3;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    color: var(--color-text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Footer */
.footer {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    padding: 1rem 2rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.section.collapsed .section-content { display: none; }

/* ============================================
   4. Components - Tables
   ============================================ */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: rgba(88, 166, 255, 0.05);
}

.table code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.table .actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.table-sm td, .table-sm th { 
    padding: 0.4rem 0.75rem; 
    font-size: 0.875rem; 
}

/* Student header with filter */
.student-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.student-header .sortable {
    cursor: pointer;
}

.student-header .sortable:hover {
    color: var(--color-accent);
}

/* Filter input */
.filter-input {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 6px !important;
    color: var(--color-text) !important;
    padding: 0.4rem 0.6rem !important;
    font-size: 0.75rem !important;
    width: 100% !important;
    max-width: 110px !important;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.filter-input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

.filter-input:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

.filter-input:focus {
    outline: none !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: var(--color-accent) !important;
    box-shadow: 0 0 0 2px rgba(118, 185, 0, 0.2) !important;
}

/* Custom checkboxes - match filter input aesthetic */
.student-checkbox,
#select-all {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.student-checkbox:hover,
#select-all:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.student-checkbox:checked,
#select-all:checked {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.student-checkbox:checked::after,
#select-all:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid rgba(255, 255, 255, 0.7);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Indeterminate state for select-all */
#select-all:indeterminate {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

#select-all:indeterminate::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 6px;
    width: 8px;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
}

.student-checkbox:focus,
#select-all:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* ============================================
   4. Components - Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Primary button - Green for positive/deploy actions */
.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

/* Secondary button - Grey for neutral actions like Install */
.btn-secondary {
    background: var(--color-secondary);
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-secondary-hover);
}

/* Muted button - for less prominent actions like Clear */
.btn-muted {
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.btn-muted:hover:not(:disabled) {
    background: var(--color-border);
    color: var(--color-text);
}

/* Warning button - Amber for destructive but recoverable (Destroy) */
.btn-warning {
    background: var(--color-warning);
    color: #fff;
}

.btn-warning:hover:not(:disabled) {
    background: var(--color-warning-hover);
}

/* Danger button - Red for permanent actions (Remove) */
.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: var(--color-danger-hover);
}

/* All buttons when disabled - consistent muted appearance */
.btn:disabled,
.btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Success button (same as primary for consistency) */
.btn-success {
    background: var(--color-success);
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

.btn-with-icon { 
    display: inline-flex; 
    align-items: center; 
    gap: 0.4rem; 
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    min-width: auto;
    border-radius: 4px;
    vertical-align: middle;
}

.btn-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}

.btn-outline-danger:hover:not(:disabled) {
    background: var(--color-danger);
    color: white;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.btn-close:hover {
    color: var(--text-color);
}

/* Refresh button - square icon */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: var(--color-border);
    color: var(--color-text);
}

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

/* Refresh button spin animation */
.refresh-icon.spinning {
    animation: spin 0.8s linear infinite;
}

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

/* Copy button */
.btn-copy {
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.25rem 0.4rem;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.btn-copy:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.btn-copy.copied {
    border-color: var(--color-success);
    color: var(--color-success);
}

/* Tooltip wrapper for disabled buttons */
.btn-tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.btn-tooltip-wrapper::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--color-bg-tertiary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 1000;
    pointer-events: none;
    margin-bottom: 6px;
    width: max-content;
    max-width: 350px;
    text-align: center;
    line-height: 1.4;
}

.btn-tooltip-wrapper:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Arrow for tooltip */
.btn-tooltip-wrapper::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--color-border);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 1001;
    margin-bottom: 0;
}

.btn-tooltip-wrapper:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   4. Components - Badges
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(63, 185, 80, 0.2);
    color: var(--color-success);
}

.badge-warning {
    background: rgba(210, 153, 34, 0.2);
    color: var(--color-warning);
}

.badge-error {
    background: rgba(248, 81, 73, 0.2);
    color: var(--color-danger);
}

.badge-secondary {
    background: rgba(139, 148, 158, 0.2);
    color: var(--color-text-muted);
}

.badge-outline { 
    background: transparent; 
    border: 1px solid var(--color-border); 
    color: var(--color-text-muted); 
}

/* ============================================
   4. Components - Status Pills
   ============================================ */
.status-cell { 
    white-space: nowrap; 
    text-align: center; 
}

.status-pill {
    display: inline-block;
    position: relative;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    overflow: hidden;
    min-width: 90px;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
}

/* Ready - solid green */
.status-ready {
    background: #238636;
    color: #fff;
}

/* Not deployed - outline */
.status-none {
    background: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
}

/* Stopped */
.status-stopped {
    background: #30363d;
    color: #8b949e;
}

/* Building - blue with pulse */
.status-building {
    background: #1f6feb;
    color: #fff;
    animation: pulse-bg 1.5s ease-in-out infinite;
}

/* In-progress states - solid with pulse */
.status-deploying {
    background: #1f6feb;
    color: #fff;
    animation: pulse-bg 1.5s ease-in-out infinite;
    border: 1px solid #1f6feb;
}

.status-destroying {
    background: #f85149;
    color: #fff;
    animation: pulse-bg 1.5s ease-in-out infinite;
    border: 1px solid #f85149;
}

/* Failed - solid red */
.status-failed {
    background: #f85149;
    color: #fff;
}

/* Run:AI Install Status Pills */
.status-installed {
    background: #238636;
    color: #fff;
}

.status-not-installed {
    background: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
}

.status-installing {
    background: #d29922;
    color: #fff;
    animation: pulse-bg 1.5s ease-in-out infinite;
}

.status-install-failed {
    background: #f85149;
    color: #fff;
}

@keyframes pulse-bg {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
   4. Components - Forms
   ============================================ */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.form-group input,
.form-group select,
.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 0.875rem;
}

.form-group input:focus,
.form-group select:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* ============================================
   4. Components - Alerts
   ============================================ */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}

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

.modal-content {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    min-width: 400px;
    max-width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-size: 1.25rem;
}

/* Confirmation Modal */
.modal-confirm {
    max-width: 400px;
}

.modal-confirm .modal-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
}

.modal-confirm .modal-body {
    padding: 1.5rem 0;
}

.modal-confirm .modal-body p {
    margin: 0 0 0.5rem 0;
}

.modal-confirm .modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

/* Notification Modal */
.modal-notification {
    max-width: 500px;
}

.modal-notification .modal-body {
    padding: 1rem 0;
}

.modal-notification .table {
    margin: 0;
}

.modal-notification .table td,
.modal-notification .table th {
    padding: 0.5rem;
}

.notification-error {
    color: var(--color-danger);
}

/* ============================================
   5. Dashboard-Specific Styles
   ============================================ */

/* Environment Banner */
.env-banner {
    background: linear-gradient(135deg, rgba(118, 185, 0, 0.1) 0%, rgba(30, 35, 40, 0.8) 100%);
    border: 1px solid rgba(118, 185, 0, 0.3);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.env-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.env-primary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.env-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(118, 185, 0, 0.2);
    border-radius: 8px;
    color: #76B900;
}

.env-domain {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e6edf3;
}

.env-details {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.env-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #8b949e;
}

.env-badge.aws-badge {
    background: rgba(255, 153, 0, 0.1);
    border-color: rgba(255, 153, 0, 0.3);
    color: #ff9900;
}

.env-badge.region-badge {
    background: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.3);
    color: #58a6ff;
}

.env-badge.account-badge {
    background: rgba(163, 113, 247, 0.1);
    border-color: rgba(163, 113, 247, 0.3);
    color: #a371f7;
}

.env-badge.status-badge {
    background: rgba(118, 185, 0, 0.1);
    border-color: rgba(118, 185, 0, 0.3);
    color: #76B900;
}

.env-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #76B900;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Action Bar */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--color-bg-secondary);
    border-radius: 6px;
    margin-top: 1rem;
    border: 1px solid var(--color-border);
}

.selected-count {
    font-weight: 500;
    color: var(--color-text-muted);
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

.action-buttons .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Students Table Layout */
#students-table {
    table-layout: fixed;
    width: 100%;
}

/* Table column widths */
.checkbox-col { width: 40px; min-width: 40px; max-width: 40px; text-align: center !important; padding: 0.25rem !important; }
.student-col { text-align: left; width: 25%; }
.status-col { text-align: center !important; white-space: nowrap; width: 120px; min-width: 120px; }
.runai-col { text-align: center !important; white-space: nowrap; width: 130px; min-width: 130px; }
.created-col { text-align: center !important; white-space: nowrap; width: 140px; min-width: 140px; }
.age-col { text-align: center !important; white-space: nowrap; width: 80px; min-width: 80px; }
td.status-cell { text-align: center !important; vertical-align: middle; }
td.runai-status-cell { text-align: center !important; vertical-align: middle; }
td.age-cell { text-align: center !important; vertical-align: middle; }
.created-cell { text-align: center !important; vertical-align: middle; }
.created-display { font-size: 0.8rem; color: var(--color-text); }
.age-display { font-size: 0.8rem; color: var(--color-text-muted); }

.student-name-cell {
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sortable columns */
th.sortable {
    cursor: pointer;
    user-select: none;
}
th.sortable:hover {
    color: var(--color-primary);
}
.sort-icon {
    font-size: 0.9rem;
    margin-left: 0.4rem;
    opacity: 0.7;
    font-weight: 600;
}
th.sortable:hover .sort-icon {
    opacity: 1;
    color: var(--color-accent);
}

/* Traffic Light Indicators for Run:AI Status */
.runai-status-cell { text-align: center; vertical-align: middle; }
.remove-col { vertical-align: middle; }

.traffic-light {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
}

.traffic-light.green {
    background: #3fb950;
    box-shadow: 0 0 6px #3fb950;
}

.traffic-light.yellow {
    background: #d29922;
    box-shadow: 0 0 6px #d29922;
}

.traffic-light.red {
    background: #f85149;
    box-shadow: 0 0 6px #f85149;
}

.traffic-light.off {
    background: #21262d;
    border-color: #21262d;
    opacity: 0.5;
}

.traffic-light.grey {
    background: #6e7681;
    border-color: #6e7681;
}

.traffic-light.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Expand/Collapse for Student Details */
.expand-btn {
    background: none;
    border: none;
    padding: 0;
    margin-right: 0.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
    vertical-align: middle;
}

.expand-btn .expand-icon { transition: transform 0.2s; }
.expand-btn.expanded .expand-icon { transform: rotate(90deg); }

.student-details { background: var(--color-bg-secondary); }

.details-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.details-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    font-size: 0.875rem;
}

.vscode-password-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-display {
    background: #1a1a2e;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--color-accent);
    border: 1px solid var(--color-border);
}

.error-message { color: var(--color-danger); grid-column: 1 / -1; }

.quick-links { display: flex; gap: 0.5rem; }

/* Health Status Grid */
.health-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.health-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--color-bg-tertiary);
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: help;
}

.health-item[title] {
    position: relative;
}

.health-item:hover {
    background: var(--color-border);
}

.health-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.health-indicator.health-healthy {
    background: #3fb950;
    box-shadow: 0 0 4px #3fb950;
}

.health-indicator.health-unhealthy {
    background: #f85149;
    box-shadow: 0 0 4px #f85149;
}

.health-indicator.health-pending {
    background: #d29922;
}

.health-indicator.health-missing {
    background: #6e7681;
}

.health-indicator.health-not_installed {
    background: #6e7681;
}

.health-label {
    color: var(--color-text-muted);
}

.health-timestamp {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Logs Panel */
.logs-panel {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
    background: #0a0a0a;
}

.logs-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    padding: 0;
}

.log-tab {
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.log-tab:hover {
    color: var(--text-color);
    background: rgba(255,255,255,0.05);
}

.log-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: rgba(88, 166, 255, 0.1);
}

.log-follow-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s;
}

.log-follow-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.log-follow-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #000;
}

.log-follow-btn .follow-label {
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.log-refresh-btn {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.log-refresh-btn:hover {
    color: var(--color-primary);
}

.logs-viewer-container {
    height: 250px;
    overflow: auto;
    position: relative;
}

.logs-viewer-content {
    margin: 0;
    padding: 1rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    color: #b8c0cc;
    min-height: 100%;
}

.logs-viewer-content.loading {
    color: var(--color-text-muted);
    font-style: italic;
}

.actions { white-space: nowrap; }

/* Scrollable recent activity */
.activity-scroll {
    max-height: 250px;
    overflow-y: auto;
}
.activity-scroll::-webkit-scrollbar {
    width: 6px;
}
.activity-scroll::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}
.activity-scroll::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}
.activity-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ============================================
   6. Login Page
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-bg) 0%, #1a2332 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.75rem;
    color: #e6edf3;
    margin-bottom: 0.5rem;
}

/* ============================================
   7. Logs Page
   ============================================ */
.logs-page .page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.log-controls {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.log-container {
    background: #000;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.log-placeholder,
.log-loading,
.log-error {
    padding: 2rem;
    text-align: center;
    color: var(--color-text-muted);
}

.log-error {
    color: var(--color-danger);
}

.log-events {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
}

.log-event {
    padding: 0.25rem 1rem;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
}

.log-event:hover {
    background: rgba(88, 166, 255, 0.05);
}

.log-time {
    color: var(--color-text-muted);
    margin-right: 1rem;
}

.log-message {
    white-space: pre-wrap;
    word-break: break-all;
}

/* ============================================
   8. Utility Classes
   ============================================ */
.text-muted {
    color: var(--color-text-muted);
}

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

.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }

/* ============================================
   9. Responsive
   ============================================ */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        min-width: unset;
        margin: 1rem;
    }
}
