:root {
    --velo-blue: #3aa8c9;
    --velo-light-blue: #79cbe6;
    --velo-orange: #f57f17;
    --velo-dark-slate: #1e293b;
    --velo-black: #090d16;
    --velo-card-bg: #0f172a;
    --velo-card-subtle: #1e293b;
    --velo-border: rgba(58, 168, 201, 0.22);
    --velo-border-hover: rgba(58, 168, 201, 0.5);
    --velo-green: #10b981;
    --velo-green-glow: rgba(16, 185, 129, 0.35);
    --velo-yellow: #f59e0b;
    --velo-red: #ef4444;
    --velo-text-main: #f8fafc;
    --velo-text-muted: #94a3b8;
    --velo-text-dim: #64748b;
}

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

body {
    background-color: var(--velo-black);
    color: var(--velo-text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Header */
header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--velo-border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--velo-text-main);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding-left: 14px;
}


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

.header-link {
    color: var(--velo-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.header-link:hover {
    color: var(--velo-light-blue);
}

/* Main Container */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 64px 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Hero Section */
.hero {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 12px auto;
}

.hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff, var(--velo-light-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.1rem;
    color: var(--velo-text-muted);
}

/* Grid Layout */
.portal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 860px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }
}

/* Glass Card */
.glass-card {
    background: var(--velo-card-bg);
    border: 1px solid var(--velo-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.glass-card:hover {
    border-color: var(--velo-border-hover);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Detection Card / Live Status */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    background: var(--velo-text-dim);
    transition: all 0.3s ease;
}

.status-indicator.searching {
    background: var(--velo-yellow);
    box-shadow: 0 0 12px var(--velo-yellow);
    animation: pulse 1.5s infinite;
}

.status-indicator.connected {
    background: var(--velo-green);
    box-shadow: 0 0 16px var(--velo-green-glow);
}

.status-indicator.disconnected {
    background: var(--velo-red);
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.connection-banner {
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--velo-card-subtle);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.connection-banner.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.banner-content {
    display: flex;
    flex-direction: column;
}

.banner-status-text {
    font-weight: 600;
    font-size: 1.05rem;
}

.banner-subtext {
    font-size: 0.85rem;
    color: var(--velo-text-muted);
}

/* Telemetry Pills */
.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.telemetry-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.pill-label {
    font-size: 0.75rem;
    color: var(--velo-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.pill-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--velo-text-main);
}

/* Actions */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--velo-blue), #0284c7);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--velo-light-blue), var(--velo-blue));
    box-shadow: 0 4px 16px rgba(58, 168, 201, 0.35);
}

.btn-secondary {
    background: var(--velo-card-subtle);
    border: 1px solid var(--velo-border);
    color: var(--velo-text-main);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(58, 168, 201, 0.15);
    border-color: var(--velo-light-blue);
}

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

/* Setup Steps */
.step-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(58, 168, 201, 0.15);
    border: 1px solid var(--velo-blue);
    color: var(--velo-light-blue);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--velo-text-main);
}

.step-content p {
    font-size: 0.88rem;
    color: var(--velo-text-muted);
}

/* Embedded Iframe Container */
.iframe-section {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.iframe-section.active {
    display: flex;
}

.iframe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.iframe-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.iframe-wrapper {
    position: relative;
    width: 100%;
    height: 720px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--velo-border);
    background: #000;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.device-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Troubleshooting accordion */
.help-box {
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.help-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--velo-text-muted);
    margin-bottom: 6px;
}

.help-box ul {
    padding-left: 20px;
    font-size: 0.82rem;
    color: var(--velo-text-dim);
}

.help-box li {
    margin-bottom: 4px;
}

code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--velo-light-blue);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
