/* =============================================
   Terminal Theme — HARC Members
   Green phosphor on black. Monospaced. Sharp.
   ============================================= */
:root {
    --primary:       #00ff41;
    --primary-dark:  #00cc33;
    --primary-light: #001a00;
    --secondary:     #2a7a2a;
    --success:       #00ff41;
    --danger:        #33ff66;
    --warning:       #aaff00;
    --surface:       #000800;
    --surface-alt:   #000400;
    --border:        #003d00;
    --text:          #00ff41;
    --text-muted:    #227722;
    --navbar-bg:     #000000;
    --navbar-height: 48px;
    --radius:        0px;
    --shadow-sm:     0 0 8px rgba(0,255,65,.12);
    --shadow:        0 0 14px rgba(0,255,65,.18);
    --shadow-lg:     0 0 24px rgba(0,255,65,.22);
    --transition:    100ms ease;
}

/* Scanline overlay for authenticity */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,.08) 2px,
        rgba(0,0,0,.08) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

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

html, body {
    height: 100%;
    font-family: 'Share Tech Mono', 'Courier New', Courier, monospace;
    font-size: 14px;
    color: var(--text);
    background: #000000;
    -webkit-font-smoothing: none;
    text-rendering: optimizeSpeed;
}

h1 { font-size: 1.4rem; font-weight: normal; color: var(--text); margin-bottom: 1.5rem; letter-spacing: .05em; }
h2 { font-size: 1.15rem; font-weight: normal; letter-spacing: .04em; }
h5 { font-size: 1rem;    font-weight: normal; letter-spacing: .03em; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: #66ffaa; text-shadow: 0 0 8px rgba(0,255,65,.6); }

/* =============================================
   Layout
   ============================================= */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #000000;
}

.app-main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* =============================================
   Navbar
   ============================================= */
.app-navbar {
    background: var(--navbar-bg);
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--primary);
    box-shadow: 0 1px 12px rgba(0,255,65,.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1rem;
    font-weight: normal;
    color: var(--primary) !important;
    letter-spacing: .1em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-right: 1rem;
    text-shadow: 0 0 10px rgba(0,255,65,.7);
}

.navbar-brand::before { content: '> '; opacity: .6; }
.navbar-brand svg { display: none; }

.nav-links {
    display: flex;
    align-items: center;
    gap: .1rem;
    flex: 1;
}

.nav-link-item {
    color: var(--text-muted);
    padding: .3rem .75rem;
    border: 1px solid transparent;
    font-size: .875rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link-item::before { content: '['; opacity: 0; transition: opacity var(--transition); }
.nav-link-item::after  { content: ']'; opacity: 0; transition: opacity var(--transition); }

.nav-link-item:hover {
    color: var(--primary);
    border-color: var(--border);
    background: var(--surface);
    text-shadow: 0 0 8px rgba(0,255,65,.5);
}

.nav-link-item:hover::before,
.nav-link-item:hover::after { opacity: .5; }

.nav-link-item.active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
    text-shadow: 0 0 10px rgba(0,255,65,.6);
}

.nav-link-item.active::before,
.nav-link-item.active::after { opacity: 1; }

.nav-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
    margin: 0 .4rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-left: auto;
}

.nav-username {
    color: var(--text-muted);
    font-size: .8rem;
    letter-spacing: .05em;
}

.nav-username::before { content: 'user: '; opacity: .5; }

.nav-avatar {
    width: 28px;
    height: 28px;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 6px rgba(0,255,65,.6);
}

/* =============================================
   Buttons
   ============================================= */
.btn {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: .8rem;
    font-weight: normal;
    border-radius: 0;
    padding: .4rem .9rem;
    transition: all var(--transition);
    border: 1px solid;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.btn::before { content: '[ '; }
.btn::after  { content: ' ]'; }

.btn-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
    text-shadow: 0 0 8px rgba(0,255,65,.5);
}
.btn-primary:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 16px rgba(0,255,65,.5);
    text-shadow: none;
}

.btn-success {
    background: transparent;
    color: var(--success);
    border-color: var(--success);
    text-shadow: 0 0 8px rgba(0,255,65,.5);
}
.btn-success:hover { background: var(--success); color: #000; box-shadow: 0 0 16px rgba(0,255,65,.5); text-shadow: none; }

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #000; box-shadow: 0 0 16px rgba(51,255,102,.5); text-shadow: none; }

.btn-warning {
    background: transparent;
    color: var(--warning);
    border-color: var(--warning);
}
.btn-warning:hover { background: var(--warning); color: #000; text-shadow: none; }

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface); color: var(--text); border-color: var(--secondary); }

.btn-outline-light {
    background: transparent;
    color: var(--primary);
    border-color: var(--border);
    text-shadow: 0 0 6px rgba(0,255,65,.4);
}
.btn-outline-light:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0,255,65,.3);
}

.btn-sm { font-size: .75rem; padding: .25rem .6rem; }
.btn-icon { padding: .4rem .55rem; }
.btn-icon::before, .btn-icon::after { display: none; }

/* =============================================
   Cards
   ============================================= */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
    font-weight: normal;
    font-size: .875rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header::before { content: '>> '; opacity: .5; }

.card-body { padding: 1.25rem; }

/* =============================================
   Forms
   ============================================= */
.form-label {
    font-size: .8rem;
    font-weight: normal;
    color: var(--text-muted);
    margin-bottom: .3rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.form-label::before { content: '$ '; opacity: .5; }

.form-control, .form-select {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: .875rem;
    border: 1px solid var(--border);
    border-radius: 0;
    padding: .45rem .65rem;
    color: var(--text);
    background: var(--surface-alt);
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}

.form-control::placeholder { color: var(--text-muted); opacity: .6; }

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), 0 0 12px rgba(0,255,65,.2);
    outline: none;
    background: #000d00;
}

.form-text { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }
.validation-message { font-size: .75rem; color: var(--danger); margin-top: .25rem; }
.validation-message::before { content: '! '; }

/* =============================================
   Tables
   ============================================= */
.table {
    font-size: .875rem;
    border-collapse: collapse;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: var(--shadow-sm);
}

.table th {
    background: var(--surface-alt);
    font-weight: normal;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--primary);
}

.table td {
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td {
    background: var(--primary-light);
    color: #33ff66;
    text-shadow: 0 0 6px rgba(0,255,65,.3);
}

/* =============================================
   Alerts & Badges
   ============================================= */
.alert {
    border-radius: 0;
    padding: .65rem 1rem;
    font-size: .875rem;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: .5rem;
    letter-spacing: .02em;
}

.alert::before { content: '[!] '; font-weight: bold; }

.alert-info    { background: #000d05; border-color: #003322; color: #3399ff; }
.alert-info::before { color: #3399ff; }

.alert-success { background: var(--surface-alt); border-color: var(--border); color: var(--primary); }

.alert-danger  { background: #000d00; border-color: #006600; color: #33ff66; }
.alert-danger::before { color: #33ff66; }

.alert-warning { background: #000d00; border-color: #006633; color: var(--warning); }
.alert-warning::before { color: var(--warning); }

.badge {
    font-size: .7rem;
    font-weight: normal;
    padding: .2rem .5rem;
    border-radius: 0;
    letter-spacing: .06em;
    text-transform: uppercase;
    border: 1px solid;
}

.badge-success   { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.badge-danger    { background: #001a00; border-color: #22cc44; color: #33ff66; }
.badge-warning   { background: #000d00; border-color: #00cc55; color: var(--warning); }
.badge-secondary { background: var(--surface); border-color: var(--border); color: var(--text-muted); }

/* =============================================
   Page Header
   ============================================= */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 { margin-bottom: 0; }
.page-header h1::before { content: '$ '; opacity: .5; }

/* =============================================
   Modal overlay
   ============================================= */
.modal-backdrop-custom {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog-custom {
    background: var(--surface);
    border: 1px solid var(--primary);
    border-radius: 0;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
}

.modal-title {
    font-size: .9rem;
    font-weight: normal;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: .5rem;
    color: var(--primary);
}

.modal-title::before { content: '>> '; opacity: .6; }

.modal-body-text { color: var(--text-muted); font-size: .875rem; margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; }

/* =============================================
   Login Page
   ============================================= */
.login-wrapper {
    min-height: 100vh;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Animated CRT scanline on login */
.login-wrapper::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(
        transparent 50%,
        rgba(0,255,65,.015) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 0;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--primary);
    border-radius: 0;
    box-shadow: 0 0 40px rgba(0,255,65,.2), 0 0 80px rgba(0,255,65,.08);
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 1;
}

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

/* Hide the SVG icon — replace with ASCII art */
.login-logo-icon { display: none; }

.login-logo::before {
    display: block;
    content: '██╗  ██╗ █████╗ ██████╗  ██████╗\A██║  ██║██╔══██╗██╔══██╗██╔════╝\A███████║███████║██████╔╝██║     \A██╔══██║██╔══██║██╔══██╗██║     \A██║  ██║██║  ██║██║  ██║╚██████╗\A╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝';
    white-space: pre;
    font-size: .45rem;
    line-height: 1.3;
    color: var(--primary);
    opacity: .5;
    letter-spacing: .02em;
    font-family: 'Share Tech Mono', monospace;
    margin-bottom: 1rem;
}

.login-title {
    font-size: 1.1rem;
    font-weight: normal;
    color: var(--primary);
    letter-spacing: .15em;
    text-transform: uppercase;
    text-shadow: 0 0 14px rgba(0,255,65,.7);
    margin-bottom: .25rem;
}

.login-title::before { content: '> '; opacity: .6; }

.login-subtitle {
    font-size: .75rem;
    color: var(--text-muted);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.login-subtitle::before { content: '// '; opacity: .5; }

/* =============================================
   Upload page
   ============================================= */
.upload-zone {
    border: 1px dashed var(--border);
    border-radius: 0;
    padding: 2rem;
    text-align: center;
    background: var(--surface-alt);
    transition: border-color var(--transition), background var(--transition);
    cursor: pointer;
    color: var(--text-muted);
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: inset 0 0 20px rgba(0,255,65,.05);
}

/* =============================================
   Utilities
   ============================================= */
.text-muted  { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.fw-medium   { font-weight: 500; }
.gap-2       { gap: .5rem; }
.d-flex      { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.ms-auto     { margin-left: auto; }
.me-2        { margin-right: .5rem; }
.mb-0        { margin-bottom: 0; }
.w-100       { width: 100%; }
.mt-3        { margin-top: .75rem; }

/* =============================================
   Bootstrap overrides — dark terminal surface
   ============================================= */
.form-select {
    color-scheme: dark;
}

option {
    background: var(--surface);
    color: var(--text);
}

input[type="file"] {
    font-family: 'Share Tech Mono', monospace;
    color: var(--text);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    padding: .4rem .6rem;
}

input[type="file"]::file-selector-button {
    font-family: 'Share Tech Mono', monospace;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: .3rem .7rem;
    cursor: pointer;
    margin-right: 1rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary);
    color: #000;
}

/* =============================================
   Blazor error UI
   ============================================= */
#blazor-error-ui {
    color-scheme: dark;
    background: #000d00;
    border-top: 1px solid var(--danger);
    color: var(--danger);
    bottom: 0;
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: 'Share Tech Mono', monospace;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #000d00;
    border: 1px solid var(--danger);
    padding: 1rem;
    color: var(--danger);
    font-family: 'Share Tech Mono', monospace;
}

.blazor-error-boundary::after {
    content: "[ERROR] An unhandled exception has occurred.";
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--border);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--primary);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--primary);
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code { color: var(--primary); }

/* mb-3, mb-4 used in forms */
.mb-3 { margin-bottom: .75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 1.5rem !important; }

