/* ===========================
   GLOBAL RETRO THEME
   =========================== */

html, body {
    height: 100%;
}

body {
    background-color: #000;
    color: #00ff66;
    font-family: Consolas, "Courier New", monospace;
    margin: 0;
    padding: 0;

    display: flex;
    flex-direction: column;
}

/* CRT scanlines */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,0.02) 0px,
        rgba(255,255,255,0.02) 1px,
        rgba(0,0,0,0.05) 2px
    );
    z-index: 1;
    mix-blend-mode: overlay;
}

/* ===========================
   BOOT OVERLAY — RETRO POPUP
   =========================== */

#boot-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    color: #00ff66;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.boot-text {
    border: 1px solid #00ff66;
    padding: 16px 22px;
    border-radius: 6px;
    background: #000;
    font-size: 16px;
    line-height: 1.4;
    white-space: nowrap;
    text-align: left;

    overflow: hidden;
    display: inline-block;
    animation: bootType .5s steps(40, end) forwards;
}

@keyframes bootType {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}

/* ===========================
   TOP NAVIGATION BAR
   =========================== */

.top-nav {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    background: #0a0a0a;
    border-bottom: 2px solid #00ff66;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    z-index: 1000;
    box-sizing: border-box;
}

/* Site title wrapper prevents nav shifting */
.site-title-wrapper {
    width: 17ch; /* Fits 'Haberman.io_' exactly */
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* HEADER TYPING ANIMATION */
.site-title {
    color: #00ff66;
    text-decoration: none;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 1px;

    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid #00ff66;

    width: 0;
    animation: headerType 1.8s steps(20, end) forwards 1.0s,
               blink 0.7s infinite;
}

@keyframes headerType {
    from { width: 0; }
    to { width: 17ch; }
}

@keyframes blink {
    0% { border-color: transparent; }
    50% { border-color: #00ff66; }
    100% { border-color: transparent; }
}

/* NAVIGATION LINKS */
.nav-links {
    display: flex;
    gap: 14px;
    align-items: center;
    white-space: nowrap;
    margin-right: 40px;

    opacity: 0;
    animation: navFade .5s ease forwards;
    animation-delay: 1.9s;
}

@keyframes navFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nav-links a {
    color: #00ff66;
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid #00ff66;
    border-radius: 4px;
    font-size: 14px;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
    background: #00ff66;
    color: #000;
}

/* ===========================
   PAGE CONTENT + PANELS
   =========================== */

.page-content {
    max-width: 1000px;
    margin: 90px auto 40px auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
    flex: 1 0 auto;
}

.panel {
    background: #0a0a0a;
    border: 1px solid #00ff66;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
    box-shadow: 0 0 10px #003300 inset;
}

.panel h2 {
    margin: 0 0 12px 0;
    border-bottom: 1px solid #00ff66;
    padding-bottom: 6px;
    font-weight: normal;
}

/* ===========================
   FORMS
   =========================== */

form label {
    display: block;
    margin-bottom: 6px;
}

form input[type="text"],
form input[type="password"],
form input[type="email"] {
    width: 100%;
    padding: 6px;
    margin-bottom: 12px;
    background: #000;
    border: 1px solid #00ff66;
    color: #00ff66;
    font-family: inherit;
}

form button {
    padding: 8px 16px;
    background: #00ff66;
    color: #000;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

form button:hover {
    background: #33ff88;
}

/* ===========================
   DOWNLOADS TABLE
   =========================== */

.downloads-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
}

.downloads-table th,
.downloads-table td {
    border-bottom: 1px solid #004422;
    padding: 4px 6px;
}

.downloads-table th {
    text-align: left;
    color: #00ff66;
}

.download-button {
    color: #00ff66;
    border: 1px solid #00ff66;
    padding: 2px 8px;
    text-decoration: none;
    border-radius: 3px;
}

.download-button:hover {
    background: #00ff66;
    color: #000;
}

/* ===========================
   ACCOUNT AVATAR + DROPDOWN
   =========================== */

.account-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-links a {
    color: #00ff66;
    text-decoration: none;
    margin-left: 10px;
    border: 1px solid #00ff66;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.account-links a:hover {
    background: #00ff66;
    color: #000;
}

.account-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #000;
    color: #00ff66;
    border: 1px solid #00ff66;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}

.account-toggle:hover {
    background: #001a00;
}

.account-avatar {
    width: 24px;
    height: 24px;
    object-fit: cover;
    background: #000;
    border: 1px solid #00ff66;
}

.account-menu {
    position: absolute;
    top: 48px;
    right: 20px;
    background: #000;
    border: 1px solid #00ff66;
    box-shadow: 0 0 10px #003300;
    padding: 8px 0;
    min-width: 220px;
    z-index: 1500;
    display: none;
}

.account-menu.open {
    display: block;
}

.account-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}

.account-avatar-large {
    width: 48px;
    height: 48px;
    object-fit: cover;
    background: #000;
    border: 1px solid #00ff66;
}

.account-menu-item {
    display: block;
    padding: 6px 12px;
    color: #00ff66;
    text-decoration: none;
    font-size: 13px;
}

.account-menu-item:hover {
    background: #00ff66;
    color: #000;
}

/* ===========================
   REAL FOOTER
   =========================== */

.footer {
    flex-shrink: 0;
    border-top: 1px solid #008833;
    padding: 8px 16px;
    background: #000;
    color: #00ff66;
    text-align: center;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    font-size: 13px;
}

.footer-brand {
    color: #00ff66;
    text-decoration: none;
}

.footer-brand:hover {
    text-decoration: underline;
}

/* ===========================
   AVATAR INTERACTION
   =========================== */

.avatar-wrapper {
    display: inline-block;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.2s ease, box-shadow 0.2s ease;
    border-radius: 4px;
}

.avatar-wrapper:hover {
    border: 2px solid #00ff66;
    box-shadow: 0 0 8px #003300;
}

/* ===========================
   ACCOUNT PAGE — LINK ROWS
   =========================== */

.link-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.link-row input {
    flex: 1;
    padding: 6px;
    background: #000;
    border: 1px solid #00ff66;
    color: #00ff66;
    font-family: inherit;
}

.remove-link {
    background: #330000;
    color: #ff6666;
    border: 1px solid #ff0000;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.remove-link:hover {
    background: #660000;
}

/* ===========================
   ACCOUNT PAGE — BIO FIELD
   =========================== */

.account-form textarea {
    width: 100%;
    height: 80px;
    background: #000;
    border: 1px solid #00ff66;
    color: #00ff66;
    font-family: inherit;
    padding: 6px;
    resize: vertical;
}

/* ===========================
   ACCOUNT PAGE — SECTION HEADERS
   =========================== */

.account-form h2 {
    margin-top: 25px;
    border-bottom: 1px solid #00ff66;
    padding-bottom: 6px;
    font-weight: normal;
}

/* ===========================
   CHANGE PASSWORD PANEL
   =========================== */

.panel form input[type="password"] {
    width: 100%;
    padding: 6px;
    margin-bottom: 12px;
    background: #000;
    border: 1px solid #00ff66;
    color: #00ff66;
    font-family: inherit;
}


/* ===========================
   ADMIN PANEL
   =========================== */

.admin-header {
    background: #001900;
    border-bottom: 2px solid #00ff66;
    padding: 10px 0;
}

.admin-header-inner {
    width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-title {
    font-size: 20px;
    color: #00ff66;
}

.admin-nav a {
    margin-left: 20px;
    color: #00ff66;
    text-decoration: none;
}

.admin-nav a:hover {
    text-decoration: underline;
}

.admin-content {
    width: 1000px;
    margin: 20px auto;
}

.admin-footer {
    background: #001900;
    border-top: 2px solid #00ff66;
    padding: 10px 0;
    margin-top: 40px;
}

.admin-footer-inner {
    width: 1000px;
    margin: 0 auto;
    color: #00ff66;
    text-align: center;
}


/* ===========================
   ADMIN TABLE
   =========================== */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.admin-table th,
.admin-table td {
    border: 1px solid #00ff66;
    padding: 8px;
    color: #00ff66;
}

.admin-table th {
    background: #002200;
    font-weight: bold;
}

.admin-table tr:nth-child(even) {
    background: #001500;
}

.admin-table a {
    color: #00ff66;
    text-decoration: none;
}

.admin-table a:hover {
    text-decoration: underline;
}


/* ===========================
   ADMIN DASHBOARD WIDGETS
   =========================== */

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.admin-stat-box {
    background: #001500;
    border: 1px solid #00ff66;
    padding: 15px;
    text-align: center;
}

.stat-label {
    font-size: 14px;
    color: #00ff66;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #00ff66;
}
