/* ==========================================================================
   Studentportal Enterprise Cyber Range Design System — KiNS Nordic Blue
   Clean, Technical, High-Density UI with Nordic Blue Hue & Coloured Controls
   ========================================================================== */

:root {
    --brand-primary: #0284c7;
    --brand-primary-hover: #0369a1;
    --brand-primary-light: #e0f2fe;
    --brand-accent: #0095da;
    --brand-accent-hover: #0284c7;
    --brand-navy: #0a294a;
    --brand-navy-deep: #071e36;
    --brand-surface: #ffffff;
    --brand-bg: #eef5fc;
    --brand-border: #d4e3f3;
    --brand-border-strong: #b8d0e8;
    --brand-text: #0f172a;
    --brand-muted: #475569;
    --brand-ring: rgba(2, 132, 199, 0.22);
}

body.theme-pbb {
    --brand-primary: #dc2626;
    --brand-primary-hover: #b91c1c;
    --brand-primary-light: #fef2f2;
    --brand-accent: #ef4444;
    --brand-accent-hover: #dc2626;
    --brand-navy: #18181b;
    --brand-navy-deep: #09090b;
    --brand-ring: rgba(220, 38, 38, 0.22);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(180deg, #e8f2fc 0%, #f1f7fd 45%, #f6fafe 100%);
    background-attachment: fixed;
    background-color: var(--brand-bg);
    color: var(--brand-text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    font-size: 0.875rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #e6f0fa;
}
::-webkit-scrollbar-thumb {
    background: #93b8dc;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6497c8;
}

/* Container & Layout */
.sp-container {
    width: 100%;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* KiNS Blue Hero / Header Banner */
.sp-hero-banner {
    background: linear-gradient(135deg, #072340 0%, #0c3966 55%, #0364a3 100%);
    border: 1px solid #16528c;
    box-shadow: 0 6px 20px -4px rgba(7, 35, 64, 0.16);
    color: #ffffff;
}

/* Cards & Surfaces — Crisp Architectural Geometry with Subtle Blue Sheen */
.sp-card, .card {
    background: #ffffff;
    border: 1px solid var(--brand-border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px 0 rgba(10, 41, 74, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    margin-bottom: 1rem;
}

.sp-card-hover:hover, .module-card:hover {
    box-shadow: 0 6px 16px -3px rgba(2, 132, 199, 0.11);
    border-color: #7dd3fc;
}

/* Override overly rounded utility classes for a sharper technical aesthetic */
.rounded-2xl {
    border-radius: 0.5rem !important;
}
.rounded-xl {
    border-radius: 0.375rem !important;
}

/* Typography & Section Headers */
h1, h2, h3, h4 {
    color: #0c2340;
    letter-spacing: -0.02em;
    margin-top: 0;
}

/* Enterprise Buttons — Tasteful, Distinct Colours */
.btn, button[type="submit"], input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    padding: 0.45rem 0.875rem;
    border-radius: 0.375rem;
    border: 1px solid #0369a1;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s ease;
    background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(2, 132, 199, 0.18);
    white-space: nowrap;
}

.btn:hover:not(:disabled), button[type="submit"]:hover:not(:disabled), input[type="submit"]:hover:not(:disabled) {
    background: linear-gradient(180deg, #0369a1 0%, #075985 100%);
    border-color: #075985;
    color: #ffffff;
}

.btn-primary {
    background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border: 1px solid #0369a1 !important;
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #0369a1 0%, #075985 100%) !important;
    border-color: #075985 !important;
}

.btn:disabled, button:disabled, .btn.disabled {
    opacity: 0.45;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.btn-secondary {
    background: #ffffff !important;
    color: #1e3a5f !important;
    border: 1px solid #bdd4eb !important;
    box-shadow: 0 1px 2px rgba(10, 41, 74, 0.04) !important;
}
.btn-secondary:hover:not(:disabled) {
    background: #f0f7ff !important;
    color: #0369a1 !important;
    border-color: #7dd3fc !important;
}

.btn-info {
    background: #e0f2fe !important;
    color: #0369a1 !important;
    border: 1px solid #7dd3fc !important;
    box-shadow: none !important;
}
.btn-info:hover:not(:disabled) {
    background: #bae6fd !important;
    color: #075985 !important;
    border-color: #38bdf8 !important;
}

.btn-success {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border: 1px solid #047857 !important;
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.18) !important;
}
.btn-success:hover:not(:disabled) {
    background: linear-gradient(180deg, #059669 0%, #047857 100%) !important;
    border-color: #065f46 !important;
}

.btn-warning {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    border: 1px solid #b45309 !important;
    box-shadow: 0 1px 2px rgba(217, 119, 6, 0.16) !important;
}
.btn-warning:hover:not(:disabled) {
    background: linear-gradient(180deg, #d97706 0%, #b45309 100%) !important;
    border-color: #92400e !important;
}

.btn-danger {
    background: #fff1f2 !important;
    color: #be123c !important;
    border: 1px solid #fda4af !important;
    box-shadow: none !important;
}
.btn-danger:hover:not(:disabled) {
    background: #e11d48 !important;
    color: #ffffff !important;
    border-color: #be123c !important;
}

.btn-danger-solid {
    background: linear-gradient(180deg, #f43f5e 0%, #e11d48 100%) !important;
    color: #ffffff !important;
    border: 1px solid #be123c !important;
}
.btn-danger-solid:hover:not(:disabled) {
    background: linear-gradient(180deg, #e11d48 0%, #be123c 100%) !important;
}

.btn-small {
    padding: 0.32rem 0.65rem !important;
    font-size: 0.75rem !important;
    border-radius: 0.3125rem !important;
    font-weight: 600 !important;
}

.btn-xs {
    padding: 0.22rem 0.5rem !important;
    font-size: 0.71rem !important;
    line-height: 1.1rem !important;
    border-radius: 0.28rem !important;
    font-weight: 600 !important;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 0.875rem;
}

label, .form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 0.3rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="datetime-local"],
input[type="search"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 0.45rem 0.7rem;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    color: #0f172a;
    background-color: #ffffff;
    border: 1px solid #bdd4eb;
    border-radius: 0.375rem;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    outline: none;
    background-color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px var(--brand-ring);
}

select.bg-slate-800:focus,
select.bg-slate-900:focus,
select[class*="bg-slate-8"]:focus,
select[class*="bg-slate-9"]:focus,
.dark-select:focus {
    background-color: #0c3966 !important;
    color: #ffffff !important;
}

input[type="checkbox"],
input[type="radio"] {
    width: 0.95rem;
    height: 0.95rem;
    accent-color: #0284c7;
    cursor: pointer;
    border-radius: 0.2rem;
}

/* Enterprise High-Density Tables — Fitted Without Horizontal Scroll */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
}

thead th, table th {
    background: linear-gradient(180deg, #f0f7ff 0%, #e6f1fc 100%);
    color: #1e3a5f;
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.55rem 0.7rem;
    text-align: left;
    border-bottom: 1px solid #cbe0f5;
    white-space: nowrap;
}

tbody td, table td {
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid #eaf2fa;
    color: #1e293b;
    vertical-align: middle;
}

tbody tr {
    transition: background-color 0.1s ease;
}

tbody tr:hover {
    background-color: #f4f9ff;
}

/* Structured Technical Badges */
.sp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.45rem;
    border-radius: 0.25rem;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.sp-badge-emerald {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.sp-badge-rose {
    background-color: #fff1f2;
    color: #9f1239;
    border: 1px solid #fecdd3;
}
.sp-badge-amber {
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}
.sp-badge-indigo, .sp-badge-sky {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}
.sp-badge-slate {
    background-color: #f0f6fc;
    color: #1e3a5f;
    border: 1px solid #cbd5e1;
}

/* Module HTML Content Formatting */
.module-prose h1, .module-prose h2, .module-prose h3 {
    font-weight: 700;
    color: #0c2340;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.module-prose h2 {
    font-size: 1.15rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #d4e3f3;
}
.module-prose p {
    color: #334155;
    line-height: 1.65;
    margin-bottom: 0.875rem;
}
.module-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    border: 1px solid #bdd4eb;
    margin: 1.25rem 0;
    box-shadow: 0 2px 8px rgba(10, 41, 74, 0.06);
}
.module-prose img[src*="Labdiagram"],
.module-prose img[src*="labdiagram"] {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    cursor: zoom-in;
}
.module-prose code, .module-prose strong {
    color: #0c2340;
}

/* Status indicator dot */
@keyframes sp-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
.sp-dot-live {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background-color: #10b981;
    display: inline-block;
    animation: sp-pulse 2s infinite;
}
