/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-green) var(--bg-primary);
}

body {
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: var(--fs-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Scanline removed for cleaner look */

/* Scrollbar - Neon */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
    background: var(--neon-green);
    border-radius: 0;
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.5);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: var(--fw-semibold);
    line-height: 1.3;
    margin-bottom: var(--gap-sm);
    letter-spacing: -0.02em;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
h5 { font-size: var(--fs-base); }
h6 { font-size: var(--fs-sm); }

p { margin-bottom: var(--gap-md); }
p:last-child { margin-bottom: 0; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--accent-hover);
}

strong, b { font-weight: var(--fw-semibold); color: var(--text-primary); }
em, i { font-style: italic; }

code, pre {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
}

code {
    background: rgba(0, 255, 136, 0.1);
    color: var(--neon-green);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--neon-green);
    border-radius: var(--radius-sm);
    padding: var(--gap-md);
    overflow-x: auto;
    margin-bottom: var(--gap-md);
    position: relative;
}
pre::before {
    content: '>';
    position: absolute;
    top: var(--gap-md);
    left: -2px;
    color: var(--neon-green);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
}
pre code { background: none; padding: 0; border: none; }

blockquote {
    border-left: 3px solid var(--neon-green);
    padding-left: var(--gap-md);
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: var(--gap-md);
    background: rgba(0, 255, 136, 0.03);
    padding: var(--gap-sm) var(--gap-md);
}

/* Lists */
ul, ol { padding-left: var(--gap-lg); margin-bottom: var(--gap-md); }
li { margin-bottom: var(--gap-xs); }

/* Images */
img { max-width: 100%; height: auto; display: block; }

/* Selection - Neon */
::selection {
    background: var(--neon-green);
    color: #000;
    text-shadow: none;
}

/* Forms - Terminal style */
input, textarea, select, button {
    font-family: var(--font-main);
    font-size: var(--fs-base);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
textarea,
select {
    width: 100%;
    background: var(--bg-input);
    color: var(--neon-green);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
    caret-color: var(--neon-green);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--neon-green);
    box-shadow: 0 0 0 1px var(--neon-green), 0 0 15px rgba(0, 255, 136, 0.15);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

textarea { resize: vertical; min-height: 100px; }

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2300ff88' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 01.708 0L8 10.293l5.646-5.647a.5.5 0 01.708.708l-6 6a.5.5 0 01-.708 0l-6-6a.5.5 0 010-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

label {
    display: block;
    color: var(--text-primary);
    font-weight: var(--fw-medium);
    font-size: var(--fs-sm);
    margin-bottom: var(--gap-xs);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--gap-sm);
    padding: 8px 16px;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
    position: relative;
}

.btn-primary {
    background: transparent;
    color: var(--neon-green);
    border-color: var(--neon-green);
}
.btn-primary:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    text-shadow: none;
}

.btn-gradient {
    background: var(--accent-gradient);
    color: #000;
    border: none;
    font-weight: var(--fw-semibold);
}
.btn-gradient:hover {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    color: #000;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-outline:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.btn-success {
    background: transparent;
    color: var(--neon-green);
    border-color: var(--neon-green);
}
.btn-success:hover {
    background: var(--neon-green);
    color: #000;
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-sm { padding: 5px 10px; font-size: var(--fs-xs); }
.btn-lg { padding: 12px 24px; font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

.btn:disabled, .btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    border-radius: var(--radius-sm);
    line-height: 1.5;
    border: 1px solid transparent;
}

.badge-primary {
    background: rgba(0, 255, 136, 0.1);
    color: var(--neon-green);
    border-color: rgba(0, 255, 136, 0.3);
}
.badge-success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--neon-green);
    border-color: rgba(0, 255, 136, 0.3);
}
.badge-warning {
    background: rgba(255, 184, 0, 0.1);
    color: var(--neon-yellow);
    border-color: rgba(255, 184, 0, 0.3);
}
.badge-danger {
    background: rgba(255, 51, 85, 0.1);
    color: var(--danger);
    border-color: rgba(255, 51, 85, 0.3);
}
.badge-hot {
    background: var(--danger);
    color: #fff;
    animation: badge-pulse 2s ease-in-out infinite;
}
.badge-new {
    background: var(--neon-green);
    color: #000;
    font-weight: var(--fw-bold);
}
.badge-sale {
    background: var(--neon-yellow);
    color: #000;
    font-weight: var(--fw-bold);
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 51, 85, 0.5); }
    50% { box-shadow: 0 0 15px rgba(255, 51, 85, 0.8); }
}

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    color: var(--neon-green);
    font-weight: var(--fw-medium);
    font-size: var(--fs-xs);
    background: var(--bg-secondary);
}
tr:hover td {
    background: rgba(0, 255, 136, 0.03);
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); text-shadow: 0 0 10px rgba(0, 255, 136, 0.3); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--text-primary); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-mono { font-family: var(--font-mono); }

.mt-sm { margin-top: var(--gap-sm); }
.mt-md { margin-top: var(--gap-md); }
.mt-lg { margin-top: var(--gap-lg); }
.mt-xl { margin-top: var(--gap-xl); }
.mb-sm { margin-bottom: var(--gap-sm); }
.mb-md { margin-bottom: var(--gap-md); }
.mb-lg { margin-bottom: var(--gap-lg); }
.mb-xl { margin-bottom: var(--gap-xl); }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }
.d-block { display: block; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--gap-sm); }
.gap-md { gap: var(--gap-md); }
.gap-lg { gap: var(--gap-lg); }

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 255, 136, 0.2);
    border-top-color: var(--neon-green);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Toast notification */
.toast {
    position: fixed;
    top: calc(var(--header-height) + 12px);
    right: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    z-index: var(--z-toast);
    transform: translateX(120%);
    transition: transform var(--transition-base);
    max-width: 320px;
    border: 1px solid transparent;
}
.toast.show { transform: translateX(0); }
.toast-success {
    background: rgba(0, 255, 136, 0.12);
    color: var(--neon-green);
    border-color: rgba(0, 255, 136, 0.4);
}
.toast-error {
    background: rgba(255, 51, 85, 0.12);
    color: var(--danger);
    border-color: rgba(255, 51, 85, 0.4);
}
.toast-info {
    background: rgba(0, 212, 255, 0.12);
    color: var(--neon-cyan);
    border-color: rgba(0, 212, 255, 0.4);
}

