/* RackSpace — dark theme overrides on top of Bootswatch Darkly */

/* ── Utilities ── */
.ls-wide { letter-spacing: .6px; }

/* ── Top bar stat chips ── */
.topbar-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}
.topbar-stat i { font-size: .8rem; }

/* ── Panel section headers ── */
.panel-hdr {
    padding: 6px 12px;
    background: rgba(255,255,255,.04);
    border-bottom: 1px solid rgba(255,255,255,.08);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: #6c757d;
    flex-shrink: 0;
}

/* ── Sticky thead background fix for dark theme ── */
thead.sticky-top th {
    background: var(--bs-body-bg);
    border-bottom: 1px solid rgba(255,255,255,.1);
}

/* ── Rack grid — dark industrial ── */
.rack-grid {
    display: inline-block;
    border: 2px solid #2d3a50;
    border-radius: 8px;
    overflow: hidden;
    background: #0e1520;
    font-size: 11px;
    min-width: 200px;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.rack-top-bar {
    background: #080f1a;
    border-bottom: 1px solid #1a2535;
    padding: 3px 8px;
    font-size: 9px;
    color: #3a5070;
    display: flex;
    align-items: center;
    gap: 6px;
}
.rack-top-bar .rack-led-strip { display: flex; gap: 3px; margin-left: auto; }
.rack-top-bar .rack-led-strip span {
    width: 5px; height: 5px; border-radius: 50%;
    background: #00bc8c; box-shadow: 0 0 4px #00bc8c;
    animation: led-pulse 3s infinite;
}
.rack-top-bar .rack-led-strip span:nth-child(2) { animation-delay: .4s; }
.rack-top-bar .rack-led-strip span:nth-child(3) { animation-delay: .8s; background: #3498db; box-shadow: 0 0 4px #3498db; }
@keyframes led-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.rack-row {
    display: flex; align-items: stretch;
    border-bottom: 1px solid #131d2b; height: 18px;
}
.rack-row:last-child { border-bottom: none; }
.rack-unit-num {
    width: 24px; font-size: 8px; color: #243040;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; border-right: 1px solid #131d2b;
    background: #080f1a; font-family: 'Courier New', monospace;
}
.rack-unit-cell {
    flex: 1; min-width: 130px; cursor: pointer;
    display: flex; align-items: center; padding: 0 5px; gap: 5px;
    font-family: 'Courier New', monospace; transition: background .1s;
}
.rack-unit-cell.empty { color: #1e2d40; }
.rack-unit-cell.empty:hover { background: #141e2e; color: #3a5070; }
.rack-unit-cell.empty::after { content: '· · · · · · · · · ·'; font-size: 8px; color: #151f2e; letter-spacing: 2px; }

.rack-unit-cell.server-budget    { background: #161d2b; border-left: 3px solid #6c757d; }
.rack-unit-cell.server-mid       { background: #0c192e; border-left: 3px solid #3498db; }
.rack-unit-cell.server-premium   { background: #1a1500; border-left: 3px solid #f39c12; }
.rack-unit-cell.server-failed    { background: #200c0c; border-left: 3px solid #e74c3c; cursor: pointer; }
.rack-unit-cell.server-offline   { background: #10161f; border-left: 3px solid #2d3a50; opacity: .65; }
.rack-unit-cell.server-repairing { border-left-color: #17a2b8 !important; animation: repair-pulse 1.4s ease-in-out infinite; }
.rack-unit-cell.server-cont      { opacity: .5; cursor: default; }
.rack-unit-cell.server-cont::before { content: '└'; color: #2d4060; margin-right: 2px; font-size: 9px; }

@keyframes repair-pulse { 0%,100% { opacity:.65; } 50% { opacity:1; } }

.srv-led { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.led-online    { background: #00bc8c; box-shadow: 0 0 5px #00bc8c; }
.led-offline   { background: #2d3a50; }
.led-repairing { background: #17a2b8; box-shadow: 0 0 5px #17a2b8; animation: repair-pulse 1.4s ease-in-out infinite; }
.led-failed  { background: #e74c3c; box-shadow: 0 0 5px #e74c3c; animation: blink-led .9s infinite; }
@keyframes blink-led { 0%,100%{opacity:1} 50%{opacity:.2} }

.server-name-label {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
    font-weight: 600; font-size: 10px;
}
.server-name-label.budget  { color: #7a8fa8; }
.server-name-label.mid     { color: #5aa0d0; }
.server-name-label.premium { color: #c8a030; }
.server-name-label.failed  { color: #e74c3c; }
.server-name-label.offline { color: #3a5070; }

.failed-badge    { font-size: 8px; background: #e74c3c; color: #fff; border-radius: 3px; padding: 0 3px; font-family: sans-serif; }
.offline-badge   { font-size: 8px; background: #2d3a50; color: #6c757d; border-radius: 3px; padding: 0 3px; font-family: sans-serif; }
.repairing-badge { font-size: 8px; background: #17a2b8; color: #fff; border-radius: 3px; padding: 0 3px; font-family: sans-serif; }

.wear-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.wear-ok     { background: #00bc8c; }
.wear-warn   { background: #f39c12; }
.wear-danger { background: #e74c3c; animation: blink-led 1.5s infinite; }

/* ── Power meter ── */
.power-bar-wrap { margin-bottom: 14px; }
.power-bar-label { font-size: 11px; color: #6c757d; margin-bottom: 3px; display: flex; justify-content: space-between; }

/* ── Rack section ── */
.racks-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.rack-section { margin-bottom: 0; }
.rack-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rack-title { font-size: 11px; font-weight: 700; color: #6c757d; text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 5px; }

/* ── Property info bar ── */
.prop-info-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 8px 0 12px; margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,.08); font-size: 12px;
}
.prop-stat { display: flex; align-items: center; gap: 4px; color: #6c757d; }
.prop-stat strong { color: var(--bs-body-color); }

/* ── Events feed ── */
.event-item {
    font-size: 11px; padding: 6px 10px; border-radius: 6px;
    background: rgba(255,255,255,.04); border-left: 3px solid rgba(255,255,255,.1);
    line-height: 1.4;
}
.event-item.power_spike      { border-color: #f39c12; background: rgba(243,156,18,.1); }
.event-item.component_sale   { border-color: #00bc8c; background: rgba(0,188,140,.1); }
.event-item.gpu_demand       { border-color: #3498db; background: rgba(52,152,219,.1); }
.event-item.hardware_failure { border-color: #e74c3c; background: rgba(231,76,60,.1); }
.event-item.bonus            { border-color: #00bc8c; background: rgba(0,188,140,.1); }
.event-item.server_offline   { border-color: #e74c3c; background: rgba(231,76,60,.1); }
.event-item.contract_complete{ border-color: #00bc8c; background: rgba(0,188,140,.1); }
.event-item.contract_failed  { border-color: #e74c3c; background: rgba(231,76,60,.1); }
.event-time { color: #4a5568; font-size: 10px; }

/* ── Leaderboard me highlight ── */
#leaderboard-table tbody tr.me td { background: rgba(55,90,127,.25); font-weight: 700; }

/* ── Server inventory cards ── */
.unracked-server {
    display: flex; align-items: center; gap: 8px; padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.1); border-radius: 8px;
    margin-bottom: 6px; font-size: 12px; cursor: pointer;
    background: var(--bs-body-bg);
    transition: border-color .15s, box-shadow .15s;
}
.unracked-server:hover { border-color: #3498db; box-shadow: 0 2px 8px rgba(52,152,219,.15); }
.unracked-server.failed { border-color: #e74c3c; background: rgba(231,76,60,.07); }
.srv-stats { color: #6c757d; font-size: 10px; margin-top: 1px; }

/* ── Component inventory items ── */
.inv-item {
    display: flex; align-items: center; gap: 6px; padding: 5px 8px;
    font-size: 12px; border-bottom: 1px solid rgba(255,255,255,.06);
    transition: background .1s;
}
.inv-item:hover { background: rgba(255,255,255,.04); }
.inv-type { font-weight: 500; flex: 1; text-transform: capitalize; }

/* ── Modal overlay ── */
.game-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1050; padding: 16px; backdrop-filter: blur(3px);
}

/* ── Assembly minigame ── */
.slot-drop {
    border: 2px dashed rgba(255,255,255,.15); border-radius: 8px;
    padding: 6px 10px; min-height: 38px;
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; transition: border-color .15s, background .15s; margin-bottom: 6px;
}
.slot-drop.drag-over  { border-color: #3498db; background: rgba(52,152,219,.12); }
.slot-drop.drag-reject { border-color: #e74c3c; background: rgba(231,76,60,.1); }
.slot-drop.filled     { border-style: solid; border-color: #00bc8c; background: rgba(0,188,140,.1); }
.slot-label { color: #6c757d; min-width: 120px; flex-shrink: 0; font-size: 11px; font-weight: 600; }
.slot-content { flex: 1; color: #4a5568; font-style: italic; font-size: 11px; }
.slot-content.filled { font-style: normal; }

#boot-seq {
    background: #070e1a; color: #00bc8c; border-radius: 8px;
    padding: 10px 14px; font-size: 11px; font-family: 'Courier New', monospace;
    max-height: 140px; overflow-y: auto; margin-top: 10px;
    border: 1px solid #1a2535;
}

.comp-drag-card {
    display: flex; align-items: center; gap: 6px; padding: 6px 8px;
    border: 1px solid rgba(255,255,255,.1); border-radius: 6px;
    margin-bottom: 4px; font-size: 11px; cursor: grab;
    background: var(--bs-body-bg); user-select: none; transition: border-color .1s, background .1s;
}
.comp-drag-card:hover    { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.2); }
.comp-drag-card.dragging { opacity: .4; }

/* ── Notifications ── */
.rs-toast { min-width: 240px; max-width: 320px; opacity: 1; transition: opacity .4s; }
.rs-toast.fade-out { opacity: 0; }

/* ── Hover effects ── */
.prop-option { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.prop-option:hover { border-color: #3498db !important; box-shadow: 0 0 0 3px rgba(52,152,219,.15); }
.rack-select-item { cursor: pointer; transition: border-color .15s; }
.rack-select-item:hover { border-color: #3498db !important; }

/* ── Help modal ── */
.help-tab-content { font-size: 13px; line-height: 1.6; }
.help-tab-content h6 { font-weight: 700; margin-top: 14px; margin-bottom: 5px; }
.help-tab-content h6:first-child { margin-top: 0; }
.help-step { display: flex; gap: 10px; margin-bottom: 8px; align-items: flex-start; }
.help-step-num {
    width: 22px; height: 22px; border-radius: 50%; background: #375a7f;
    color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.help-tip {
    background: rgba(52,152,219,.12); border-left: 3px solid #3498db;
    padding: 6px 10px; border-radius: 0 6px 6px 0; margin-bottom: 6px; font-size: 12px;
}
.help-warn {
    background: rgba(243,156,18,.12); border-left: 3px solid #f39c12;
    padding: 6px 10px; border-radius: 0 6px 6px 0; margin-bottom: 6px; font-size: 12px;
}

/* ── Contract cards ── */
.contract-progress { height: 4px; border-radius: 2px; background: rgba(255,255,255,.1); margin-top: 4px; overflow: hidden; }
.contract-progress-fill { height: 100%; background: #00bc8c; border-radius: 2px; transition: width .5s; }

/* ── Wear bar ── */
.wear-bar-track { background: rgba(255,255,255,.1); border-radius: 4px; height: 8px; overflow: hidden; }
.wear-bar-fill { height: 100%; border-radius: 4px; transition: width .4s; }

/* ── Workers ── */
.worker-card {
    border: 1px solid #2d3a50; border-radius: 6px; padding: 8px 10px;
    margin-bottom: 8px; background: #0e1520;
}
.worker-card:last-child { margin-bottom: 0; }

/* ── Spin animation for repair icon ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 1.2s linear infinite; }

/* ── Broken component row ── */
.broken-component-row {
    border: 1px solid rgba(231,76,60,.4); border-radius: 5px;
    padding: 5px 8px; margin-bottom: 6px; background: rgba(231,76,60,.07);
    font-size: 12px;
}
