@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bs-body-bg: #f8fafc;
    --bs-body-color: #0f172a;
    --n4r-bg: #f8fafc;
    --n4r-surface: #ffffff;
    --n4r-card: #ffffff;
    --n4r-card-hover: #ffffff;
    --n4r-border: #e2e8f0;
    --n4r-border-hover: #cbd5e1;
    
    --n4r-primary: #4f46e5;
    --n4r-primary-hover: #4338ca;
    --n4r-primary-subtle: rgba(79, 70, 229, 0.08);
    
    --n4r-text-main: #0f172a;
    --n4r-text-muted: #64748b;
    --n4r-text-subtle: #94a3b8;

    /* Legacy Tailwind variable mappings to light theme */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-surface: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --primary: #4f46e5;
}

body {
    background-color: var(--n4r-bg) !important;
    background-image: none !important;
    color: var(--n4r-text-main) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    letter-spacing: -0.012em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Global Typography & Text Color Enforcements for Light Theme */
h1, h2, h3, h4, h5, h6 {
    color: #0f172a !important;
}

p, span, div, label {
    color: inherit;
}

.text-white {
    color: #0f172a !important;
}

.text-white-force, .btn-primary, .btn-n4r-primary, .badge.bg-primary, .badge.bg-success, .badge.bg-danger, .btn-success, .btn-danger {
    color: #ffffff !important;
}

.text-zinc-400, .text-zinc-500, .text-muted, .text-secondary {
    color: #64748b !important;
}

.text-zinc-100, .text-zinc-200, .text-zinc-300 {
    color: #334155 !important;
}

/* Override all glass classes from legacy tools */
.glass {
    background-color: #ffffff !important;
    border: 1px solid var(--n4r-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: #0f172a !important;
}

/* Modern Clean Light Navbar */
.n4r-navbar {
    background: #ffffff !important;
    border-bottom: 1px solid var(--n4r-border) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
}

.n4r-navbar .nav-link {
    color: var(--n4r-text-muted) !important;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.n4r-navbar .nav-link:hover, .n4r-navbar .nav-link.active {
    color: var(--n4r-text-main) !important;
    background-color: #f1f5f9;
}

/* Cards */
.n4r-card {
    background-color: var(--n4r-card);
    border: 1px solid var(--n4r-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.n4r-card:hover {
    background-color: var(--n4r-card-hover);
    border-color: var(--n4r-border-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

/* Badges */
.n4r-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background-color: #f1f5f9;
    color: var(--n4r-text-muted) !important;
    border: 1px solid var(--n4r-border);
}

/* Buttons */
.btn-n4r-primary, .btn-primary, button.bg-primary {
    background-color: var(--n4r-primary) !important;
    border-color: var(--n4r-primary) !important;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 8px;
    padding: 0.55rem 1.25rem;
    transition: all 0.15s ease;
}

.btn-n4r-primary:hover, .btn-primary:hover, button.bg-primary:hover {
    background-color: var(--n4r-primary-hover) !important;
    border-color: var(--n4r-primary-hover) !important;
    color: #ffffff !important;
}

.btn-n4r-secondary {
    background-color: #ffffff;
    border: 1px solid var(--n4r-border);
    color: var(--n4r-text-main) !important;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    transition: all 0.15s ease;
}

.btn-n4r-secondary:hover {
    background-color: #f8fafc;
    border-color: var(--n4r-border-hover);
    color: var(--n4r-text-main) !important;
}

/* Inputs, Textareas & Editors across all tools */
input[type="text"], input[type="search"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
    background-color: #ffffff !important;
    border: 1px solid var(--n4r-border) !important;
    color: #0f172a !important;
    border-radius: 8px;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--n4r-primary) !important;
    box-shadow: 0 0 0 3px var(--n4r-primary-subtle) !important;
    outline: none !important;
}

/* Search Box */
.n4r-search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.n4r-search-wrapper i {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--n4r-text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.n4r-search-wrapper input {
    background-color: #ffffff !important;
    border: 1px solid var(--n4r-border) !important;
    color: var(--n4r-text-main) !important;
    border-radius: 10px !important;
    padding: 0.75rem 1rem 0.75rem 2.85rem !important;
    font-size: 0.9rem !important;
    width: 100%;
    outline: none;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.n4r-search-wrapper input::placeholder {
    color: var(--n4r-text-subtle) !important;
}

/* Filter Tabs */
.n4r-filter-pill {
    background-color: #ffffff;
    border: 1px solid var(--n4r-border);
    color: var(--n4r-text-muted) !important;
    font-size: 0.825rem;
    font-weight: 500;
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.n4r-filter-pill:hover {
    color: var(--n4r-text-main) !important;
    border-color: var(--n4r-border-hover);
    background-color: #f8fafc;
}

.n4r-filter-pill.active {
    background-color: var(--n4r-primary);
    border-color: var(--n4r-primary);
    color: #ffffff !important;
    font-weight: 600;
}

/* Dual Editor */
.n4r-editor-box {
    background-color: #ffffff;
    border: 1px solid var(--n4r-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.n4r-editor-header {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--n4r-border);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

textarea.n4r-code-input, pre.n4r-code-output {
    background: transparent;
    border: none !important;
    outline: none !important;
    color: #0f172a !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    padding: 1rem;
    resize: none;
    width: 100%;
}

/* Article Prose & Responsive Images */
.n4r-article-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #334155;
}

.n4r-article-body h1, .n4r-article-body h2, .n4r-article-body h3, .n4r-article-body h4 {
    color: #0f172a !important;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.n4r-article-body p {
    margin-bottom: 1.25rem;
    color: #334155 !important;
}

.n4r-article-body img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    border: 1px solid var(--n4r-border);
    margin: 1.5rem 0;
    display: block;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.n4r-article-body pre {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.875rem;
    margin: 1.5rem 0;
}

.n4r-article-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875em;
    background-color: #f1f5f9;
    color: #4f46e5;
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

.n4r-article-body pre code {
    background-color: transparent !important;
    color: #f8fafc !important;
    padding: 0;
}

/* Prose container reset for light theme */
.prose {
    color: #334155 !important;
    max-width: 100% !important;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose strong {
    color: #0f172a !important;
}

.prose p, .prose li {
    color: #475569 !important;
}

/* Arcade Games Canvas & Screens */
.game-container {
    background: #ffffff;
    border: 1px solid var(--n4r-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

canvas.game-canvas {
    background-color: #0f172a !important;
    border-radius: 12px;
    border: 1px solid var(--n4r-border);
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}

/* Footer */
.n4r-footer {
    background-color: #ffffff;
    border-top: 1px solid var(--n4r-border);
    color: var(--n4r-text-muted);
    font-size: 0.85rem;
}

.n4r-footer a {
    color: var(--n4r-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.n4r-footer a:hover {
    color: var(--n4r-text-main);
}
