:root {
    --color-bg-overlay: rgba(5, 10, 25, 0.7);
    --color-primary: #00c6ff;
    --color-secondary: #ff9800;
    --color-text: #f5f5f5;
    --color-card-bg: rgba(10, 14, 30, 0.9);
    --color-border: rgba(255, 255, 255, 0.12);
    --transition-fast: 0.2s ease-out;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* BODY: global background + global overlay + flex layout for footer */
body {
    font-family: var(--font-main, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    color: var(--color-text, #f5f5f5);

    /* Global background image */
    background-color: #050711;
    background-image: url("/assets/img/background.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;

    /* Layout for footer sticking to bottom */
    display: flex;
    flex-direction: column;
    min-height: 100vh;

    position: relative; /* for overlay */
}

/* Global blue/indigo overlay over the whole page (like hero top) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(3, 12, 30, 0.85),
        rgba(3, 21, 50, 0.85)
    );
    z-index: -1;          /* behind all content */
    pointer-events: none; /* no interaction */
}

/* Main content wrapper */
.page-content {
    position: relative;
    z-index: 0;
    flex: 1 0 auto; /* stretch between header and footer */
}

/* ---------------------- HERO (HOME) ---------------------- */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Hero overlay no longer needs its own tint; global overlay handles it */
.hero-overlay {
    display: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: clamp(2.4rem, 3.2vw, 3.4rem);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.05rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------------------- HEADER & NAV ---------------------- */

.site-header {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(3, 9, 27, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}

.logo {
    font-weight: 600;
    letter-spacing: 0.05em;
}

.logo a {
    color: inherit;
    text-decoration: none;
}

.main-nav a {
    color: var(--color-text);
    text-decoration: none;
    margin-left: 1rem;
    font-size: 0.95rem;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.main-nav a:hover {
    opacity: 1;
}

/* ---------------------- BUTTONS ---------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition:
        background-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    color: #050711;
    box-shadow: 0 10px 25px rgba(0, 198, 255, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0, 198, 255, 0.45);
}

.btn-secondary {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ---------------------- HOME FEATURES SECTION ---------------------- */

.features {
    max-width: 1200px;
    margin: 0 auto 3rem;
    padding: 2.5rem 1.5rem 3rem 1.5rem;

    /* No extra background box here; we rely on body overlay */
    position: relative;
    z-index: 2;
}

/* Remove the old big overlay box behind features */
.features::before {
    content: none;
}

/* Grid of feature cards */
.features,
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    position: relative;
    z-index: 1;
    background: var(--color-card-bg);
    border-radius: 14px;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.feature-card h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.feature-card p {
    margin: 0;
    opacity: 0.95;
}

/* ---------------------- AUTH PAGES (LOGIN / SIGNUP) ---------------------- */

.auth-page {
    min-height: calc(100vh - 70px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    background: transparent;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-card-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.auth-card h1 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.form-group input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(5, 10, 25, 0.9);
    color: var(--color-text);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(0, 198, 255, 0.5);
}

.auth-switch {
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

.auth-switch a {
    color: var(--color-primary);
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ---------------------- ALERTS ---------------------- */

.alert {
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.alert ul {
    margin: 0;
    padding-left: 1.2rem;
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.6);
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.6);
}

.alert-success a {
    color: var(--color-primary);
}

/* ---------------------- FOOTER ---------------------- */

.site-footer {
    flex: 0 0 auto;
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
    text-align: center;
    background: #030816;
    border-top: 1px solid var(--color-border);
    color: rgba(255, 255, 255, 0.65);
}

/* ---------------------- LABS GALLERY ---------------------- */

.labs-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

.labs-page .page-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #f7f8ff;
}

.labs-page .page-subtitle {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 2rem;
    font-size: 0.95rem;
    color: #c4c9e8;
}

.labs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* Make the whole card clickable without underline */
.lab-card-link {
    text-decoration: none;
    color: inherit;
}

/* Glass-style card for readability on bright backgrounds */
.lab-card.glass-panel {
    background: rgba(5, 7, 17, 0.86); /* dark translucent overlay */
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
    backdrop-filter: blur(10px);
}

.lab-card.glass-panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.18);
}

/* Thumbnail wrapper + image */
.lab-thumb-wrapper {
    position: relative;
    overflow: hidden;
}

.lab-thumb {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

/* Status pill over the thumbnail */
.lab-status-pill {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
}

/* Status colours */

.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
    backdrop-filter: blur(6px);
}

/* Running */
.badge-success {
    color: #e3ffe9;
    background: rgba(46, 204, 113, 0.18);
    border-color: rgba(46, 204, 113, 0.7);
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.45);
}

/* Stopped / neutral */
.badge-muted {
    color: #e0e4ff;
    background: rgba(155, 155, 190, 0.18);
    border-color: rgba(200, 205, 235, 0.6);
    box-shadow: 0 0 10px rgba(120, 125, 170, 0.3);
}

/* Error / failed */
.badge-error {
    color: #ffe0e5;
    background: rgba(235, 87, 87, 0.18);
    border-color: rgba(235, 87, 87, 0.8);
    box-shadow: 0 0 12px rgba(235, 87, 87, 0.45);
}


/* Card body text */
.lab-card-body {
    padding: 1rem 1.1rem 1.15rem;
}

.lab-card-title {
    font-size: 1.1rem;
    margin: 0 0 0.35rem;
    color: #f7f8ff;
}

.lab-card-os {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: #aab1d4;
}

.lab-card-desc {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #d5d9f0;
}
