@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;500;700&display=swap');

:root {
    --matrix-green: #9ce8c5 !important;
    --dark-bg: #090f15 !important;
    --soft-surface: #0f1621 !important;
    --soft-surface-2: #131d29 !important;
    --soft-border: rgba(156, 232, 197, 0.34) !important;
    --text-primary: #e2f5ea !important;
    --text-muted: #bdd9cb !important;
    --link-color: #b4f0d5 !important;
    --link-hover: #e4faf0 !important;
    --selection-bg: rgba(156, 232, 197, 0.28) !important;
    --selection-text: #f2fff8 !important;
    --glow-color: rgba(156, 232, 197, 0.08) !important;
}

html[data-theme="light"] {
    --matrix-green: #1f6b4e !important;
    --dark-bg: #f3f7fa !important;
    --soft-surface: #ffffff !important;
    --soft-surface-2: #edf3f7 !important;
    --soft-border: rgba(31, 107, 78, 0.24) !important;
    --text-primary: #16261f !important;
    --text-muted: #446256 !important;
    --link-color: #1f6b4e !important;
    --link-hover: #174d38 !important;
    --selection-bg: rgba(31, 107, 78, 0.2) !important;
    --selection-text: #102118 !important;
    --glow-color: rgba(31, 107, 78, 0.06) !important;
}

body {
    background-color: var(--dark-bg) !important;
    color: var(--text-primary) !important;
    font-family: 'Fira Code', monospace !important;
    overflow-x: hidden;
    line-height: 1.6;
}

html body {
    background-color: var(--dark-bg) !important;
    color: var(--text-primary) !important;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 232, 197, 0.48) rgba(15, 22, 33, 0.42);
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: rgba(15, 22, 33, 0.42);
    border-radius: 9999px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(156, 232, 197, 0.62) 0%, rgba(109, 187, 150, 0.76) 100%);
    border: 2px solid rgba(15, 22, 33, 0.5);
    border-radius: 9999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(176, 240, 211, 0.82) 0%, rgba(129, 202, 168, 0.9) 100%);
}

html[data-theme="light"] * {
    scrollbar-color: rgba(31, 107, 78, 0.56) rgba(31, 107, 78, 0.12);
}

html[data-theme="light"] *::-webkit-scrollbar-track {
    background: rgba(31, 107, 78, 0.12);
}

html[data-theme="light"] *::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(31, 107, 78, 0.58) 0%, rgba(25, 84, 61, 0.74) 100%);
    border-color: rgba(236, 245, 241, 0.75);
}

html[data-theme="light"] *::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(31, 107, 78, 0.72) 0%, rgba(20, 72, 52, 0.88) 100%);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .min-h-screen {
    background-color: var(--dark-bg) !important;
}

html[data-theme="light"] body,
html[data-theme="light"] .min-h-screen {
    background-color: var(--dark-bg) !important;
}

html,
body,
a,
button,
input,
textarea,
select,
[class*="bg-"],
[class*="text-"],
[class*="border-"] {
    transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after,
    html,
    body,
    a,
    button,
    input,
    textarea,
    select,
    [class*="bg-"],
    [class*="text-"],
    [class*="border-"] {
        animation: none !important;
        transition: none !important;
    }
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

a,
button {
    min-height: 44px;
}

.terminal-glow {
    box-shadow: 0 0 18px var(--glow-color) !important;
}

.blink {
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

nav a {
    text-decoration: underline dotted transparent;
    transition: all 0.2s;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0 0.5rem;
}

.nav-link-active {
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--text-primary);
    padding-bottom: 0.25rem;
}

.menu-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.menu-scroll::-webkit-scrollbar {
    display: none;
}

.security-note-box {
    background: linear-gradient(180deg, rgba(73, 176, 128, 0.16) 0%, rgba(73, 176, 128, 0.08) 100%);
    border-left: 4px solid #67d9a4;
}

.security-note-title {
    color: #b6f7d7 !important;
    letter-spacing: 0.12em;
}

.security-note-text {
    color: #d9f6e8 !important;
    line-height: 1.75;
    text-transform: none;
}

html[data-theme="light"] .security-note-box {
    background: linear-gradient(180deg, rgba(31, 107, 78, 0.12) 0%, rgba(31, 107, 78, 0.06) 100%);
    border-left-color: #1f6b4e;
}

html[data-theme="light"] .security-note-title {
    color: #1b5d44 !important;
}

html[data-theme="light"] .security-note-text {
    color: #153c2f !important;
}

[class*="bg-black"] {
    background-color: var(--soft-surface) !important;
}

[class*="bg-zinc-950"] {
    background-color: var(--soft-surface-2) !important;
}

[class*="border-green-900"],
[class*="border-green-800"],
[class*="border-green-700"],
[class*="border-green-600"],
[class*="border-green-500"] {
    border-color: var(--soft-border) !important;
}

.text-green-500,
.text-green-400,
.text-green-300 {
    color: var(--text-primary) !important;
}

.text-green-700,
.text-green-600,
.text-green-900 {
    color: var(--text-muted) !important;
}

.hover\:bg-green-500:hover,
.hover\:bg-green-700:hover {
    background-color: rgba(156, 232, 197, 0.16) !important;
    border-color: rgba(156, 232, 197, 0.52) !important;
    color: var(--text-primary) !important;
    box-shadow: inset 0 0 0 1px rgba(156, 232, 197, 0.16);
}

.hover\:text-black:hover {
    color: var(--text-primary) !important;
}

.nav-link {
    color: var(--link-color) !important;
}

.nav-link:hover {
    color: var(--link-hover) !important;
}

html[data-theme="light"] .text-white,
html[data-theme="light"] .hover\:text-white:hover,
html[data-theme="light"] .nav-link-active {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .hover\:bg-green-500:hover,
html[data-theme="light"] .hover\:bg-green-700:hover {
    background-color: rgba(31, 107, 78, 0.14) !important;
    border-color: rgba(31, 107, 78, 0.38) !important;
    color: var(--text-primary) !important;
    box-shadow: inset 0 0 0 1px rgba(31, 107, 78, 0.12);
}

html[data-theme="light"] .nav-link-active {
    border-bottom-color: var(--text-primary) !important;
}

html[data-theme="light"] .text-red-500,
html[data-theme="light"] .text-red-400 {
    color: #b42318 !important;
}

html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
    color: var(--text-primary) !important;
    background-color: var(--soft-surface) !important;
    border-color: var(--soft-border) !important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
    color: var(--text-muted) !important;
    opacity: 1;
}

html[data-theme="light"] .prose,
html[data-theme="light"] .prose-invert,
html[data-theme="light"] .article-content,
html[data-theme="light"] .article-content * {
    color: var(--text-primary) !important;
}

a {
    color: var(--link-color);
}

a:hover {
    color: var(--link-hover);
}

nav a:hover {
    text-decoration-color: var(--matrix-green) !important;
}

::selection {
    background: var(--selection-bg);
    color: var(--selection-text);
}

.theme-toggle-btn {
    border: 1px solid var(--soft-border);
    background: var(--soft-surface);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    border-radius: 9999px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
}

.theme-toggle-btn:hover {
    border-color: var(--matrix-green);
}

.theme-toggle-btn[data-current-theme="dark"] {
    box-shadow: 0 0 0 2px rgba(134, 217, 179, 0.35), 0 3px 10px rgba(0, 0, 0, 0.14);
}

.theme-toggle-btn[data-current-theme="light"] {
    box-shadow: 0 0 0 2px rgba(31, 107, 78, 0.35), 0 3px 10px rgba(0, 0, 0, 0.14);
}

.theme-toggle-inline {
    position: static;
    margin-left: 0.35rem;
}

.theme-toggle-list-item {
    display: inline-flex;
    align-items: center;
}

.theme-toggle-floating {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 9999;
}

.sb-action-zone {
    border: 2px solid rgba(156, 232, 197, 0.34);
    background: linear-gradient(180deg, rgba(16, 22, 30, 0.88) 0%, rgba(12, 18, 26, 0.9) 100%);
    box-shadow: 0 0 0 1px rgba(156, 232, 197, 0.12), 0 0 26px rgba(156, 232, 197, 0.08);
}

.sb-action-kicker {
    color: var(--link-hover) !important;
    letter-spacing: 0.11em;
}

.sb-action-text {
    color: var(--link-color) !important;
}

.sb-panel {
    border: 1px solid var(--soft-border);
    background: linear-gradient(180deg, rgba(16, 22, 30, 0.72) 0%, rgba(12, 18, 26, 0.76) 100%);
}

.sb-stat-card {
    border: 1px solid var(--soft-border);
    background: rgba(156, 232, 197, 0.04);
}

.sb-row {
    border: 1px solid rgba(156, 232, 197, 0.16);
    background: rgba(156, 232, 197, 0.03);
    padding: 0.38rem 0.5rem;
}

.sb-btn-primary {
    border: 1px solid rgba(156, 232, 197, 0.58) !important;
    background: rgba(156, 232, 197, 0.09);
    color: var(--text-primary) !important;
    letter-spacing: 0.06em;
    box-shadow: inset 0 0 0 1px rgba(156, 232, 197, 0.16), 0 0 18px rgba(156, 232, 197, 0.08);
}

.sb-btn-primary:hover {
    border-color: rgba(156, 232, 197, 0.86) !important;
    background: rgba(156, 232, 197, 0.17) !important;
    color: var(--text-primary) !important;
    box-shadow: inset 0 0 0 1px rgba(156, 232, 197, 0.24), 0 0 24px rgba(156, 232, 197, 0.14);
}

.sb-btn-secondary {
    border: 1px solid rgba(156, 232, 197, 0.38) !important;
    background: rgba(156, 232, 197, 0.05);
    color: var(--link-color) !important;
}

.sb-btn-secondary:hover {
    border-color: rgba(156, 232, 197, 0.68) !important;
    background: rgba(156, 232, 197, 0.12) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .sb-action-zone {
    border-color: rgba(31, 107, 78, 0.32);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(239, 245, 250, 0.92) 100%);
    box-shadow: 0 0 0 1px rgba(31, 107, 78, 0.08), 0 0 20px rgba(31, 107, 78, 0.08);
}

html[data-theme="light"] .sb-panel {
    border-color: rgba(31, 107, 78, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(244, 249, 252, 0.98) 100%);
    box-shadow: 0 0 0 1px rgba(31, 107, 78, 0.06), 0 8px 22px rgba(21, 56, 42, 0.06);
}

html[data-theme="light"] .sb-btn-primary {
    border-color: rgba(31, 107, 78, 0.46) !important;
    background: rgba(31, 107, 78, 0.08);
    box-shadow: inset 0 0 0 1px rgba(31, 107, 78, 0.16), 0 0 14px rgba(31, 107, 78, 0.08);
}

html[data-theme="light"] .sb-btn-primary:hover {
    border-color: rgba(31, 107, 78, 0.72) !important;
    background: rgba(31, 107, 78, 0.14) !important;
    box-shadow: inset 0 0 0 1px rgba(31, 107, 78, 0.2), 0 0 18px rgba(31, 107, 78, 0.12);
}

html[data-theme="light"] .sb-btn-secondary {
    border-color: rgba(31, 107, 78, 0.32) !important;
    background: rgba(31, 107, 78, 0.06);
}

html[data-theme="light"] .sb-btn-secondary:hover {
    border-color: rgba(31, 107, 78, 0.58) !important;
    background: rgba(31, 107, 78, 0.12) !important;
}

html[data-theme="light"] .sb-stat-card {
    border-color: rgba(31, 107, 78, 0.24);
    background: rgba(31, 107, 78, 0.05);
}

html[data-theme="light"] .sb-row {
    border-color: rgba(31, 107, 78, 0.2);
    background: rgba(31, 107, 78, 0.055);
}

html[data-theme="light"] .bg-black\/95 {
    background-color: rgba(255, 255, 255, 0.97) !important;
}

html[data-theme="light"] .bg-black\/60 {
    background-color: rgba(247, 251, 253, 0.95) !important;
}

html[data-theme="light"] .bg-black\/50 {
    background-color: rgba(249, 252, 254, 0.94) !important;
}

html[data-theme="light"] .bg-black\/40 {
    background-color: rgba(251, 253, 255, 0.93) !important;
}

html[data-theme="light"] .bg-black\/30 {
    background-color: rgba(252, 254, 255, 0.9) !important;
}

html[data-theme="light"] .bg-black {
    background-color: rgba(251, 253, 255, 0.98) !important;
}
