:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-hover: rgba(31, 41, 55, 0.85);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    --accent-primary: #38bdf8;
    --accent-secondary: #818cf8;
    --accent-spring: #10b981;
    --accent-spring-hover: #059669;
    --accent-glow: rgba(56, 189, 248, 0.25);
    --success: #10b981;
    --error: #f43f5e;
    --warning: #f59e0b;
    --info: #3b82f6;
    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(56, 189, 248, 0.3);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --sidebar-width: 290px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ── BACKGROUND PARTICLES & ORBS ── */
.background-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    animation: float 22s infinite alternate ease-in-out;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
}

.orb-2 {
    bottom: -15%;
    right: -10%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
    animation-delay: -6s;
}

.orb-3 {
    top: 35%;
    left: 65%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, var(--accent-spring) 0%, transparent 70%);
    opacity: 0.2;
    animation-delay: -12s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(4%, 8%) scale(1.08); }
    100% { transform: translate(-4%, -4%) scale(0.95); }
}

.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.25;
    animation: particleRise linear infinite;
}

@keyframes particleRise {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    50% { opacity: 0.4; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ── GLASS CONTAINERS ── */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.glass-panel-inner {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: var(--transition);
}

.glass-panel-inner:hover {
    border-color: var(--glass-border-hover);
}

/* ── SIDEBAR & NAVIGATION ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 300;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid var(--glass-border);
    border-radius: 0;
    background: rgba(11, 15, 25, 0.92);
    backdrop-filter: blur(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text-main);
}

.logo-icon {
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-text .highlight {
    color: var(--accent-primary);
}

.sidebar-version {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.sidebar-user {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(56, 189, 248, 0.03);
}

.user-level {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.user-level span:first-child {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.9rem;
}

.user-level-badge {
    font-size: 0.75rem;
    background: rgba(56, 189, 248, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-weight: 700;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.user-xp {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-spring));
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.sidebar-progress {
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.sidebar-search {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-search input {
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.sidebar-search input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-nav {
    padding: 0.85rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.nav-section-title {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: 700;
    padding: 0 0.75rem 0.4rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--accent-primary);
    background: rgba(56, 189, 248, 0.1);
    font-weight: 600;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-icon {
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-badge {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.nav-item.active .nav-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 700;
}

/* ── MOBILE HAMBURGER BUTTON & DRAWER ── */
.sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 350;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 250;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* ── MAIN CONTENT WRAPPER ── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.top-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(16px);
}

.breadcrumb {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb .crumb-highlight {
    color: var(--text-main);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.spring-bridge-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--accent-spring);
    font-weight: 600;
}

.content {
    flex: 1;
    padding: clamp(1rem, 3vw, 2.5rem);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ── PAGE SECTIONS ── */
.page-section {
    display: none;
    animation: fadeIn 0.35s ease;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-card {
    padding: clamp(1.25rem, 3vw, 2.5rem);
    margin-bottom: 2rem;
}

/* ── HERO & HEADINGS ── */
.hero-section {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent-primary);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.badge.badge-spring {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-spring);
}

.title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.85rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.85rem;
    letter-spacing: -0.03em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #38bdf8 50%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-spring {
    background: linear-gradient(135deg, #10b981 0%, #34d399 50%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: var(--text-muted);
    max-width: 800px;
    line-height: 1.7;
    margin-bottom: 1.75rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--accent-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ── MODULE HEADERS ── */
.module-hero {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.module-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-primary);
    background: rgba(56, 189, 248, 0.1);
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.65rem;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.module-hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.module-hero p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0369a1, #075985);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

.btn-spring {
    background: linear-gradient(135deg, var(--accent-spring), #059669);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-spring:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.3);
    color: #fca5a5;
}

.btn-danger:hover {
    background: var(--error);
    color: #ffffff;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.mark-complete-btn {
    margin-top: 2rem;
    width: 100%;
    padding: 0.9rem;
    font-size: 0.95rem;
}

.mark-complete-btn.completed {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-spring);
    cursor: default;
}

/* ── ALERT BOXES & CARDS ── */
.alert-box {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin: 1.25rem 0;
    border-left: 4px solid var(--accent-primary);
    background: rgba(56, 189, 248, 0.06);
}

.alert-box.spring-bridge {
    border-left-color: var(--accent-spring);
    background: rgba(16, 185, 129, 0.06);
}

.alert-box.warning {
    border-left-color: var(--warning);
    background: rgba(245, 158, 11, 0.06);
}

.alert-box.danger {
    border-left-color: var(--error);
    background: rgba(244, 63, 94, 0.06);
}

.alert-box h3, .alert-box h4 {
    margin-bottom: 0.4rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-box p {
    font-size: 0.925rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.tech-card {
    text-align: center;
    padding: 1.5rem 1rem;
}

.tech-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.tech-card h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.tech-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 1.25rem;
}

.grid-3-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1.25rem;
}

.border-error { border-color: rgba(244, 63, 94, 0.3); }
.border-success { border-color: rgba(16, 185, 129, 0.3); }
.text-error { color: #fda4af; }
.text-success { color: #86efac; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }

/* ── CODE RENDERER & FILE HEADERS ── */
.code-block-wrapper {
    margin: 1.25rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: #0d1117;
}

.code-file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.file-path {
    color: var(--text-main);
}

.lang-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
}

.file-header-right {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.code-block {
    position: relative;
    padding: 1.25rem !important;
    margin: 0 !important;
    background: #0d1117 !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
    overflow-x: auto;
}

.code-block code {
    white-space: pre-wrap;
    word-break: break-word;
}

.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 600;
}

/* ── AI PROMPT BOX ── */
.prompt-box {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.05) 0%, rgba(129, 140, 248, 0.08) 100%);
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin: 1.5rem 0;
    position: relative;
}

.prompt-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
}

.prompt-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-main);
    white-space: pre-wrap;
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.prompt-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.prompt-copy-btn {
    background: var(--accent-secondary);
    color: #ffffff;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.prompt-copy-btn:hover {
    background: #6366f1;
    transform: translateY(-1px);
}

/* ── RESPONSIVE TABLES ── */
.table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin: 1.25rem 0;
    background: rgba(0, 0, 0, 0.2);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.custom-table th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.custom-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.table-tag.tag-perm { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.table-tag.tag-trans { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }

/* ── TOAST NOTIFICATIONS ── */
#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    padding: 1rem 1.25rem;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: toastSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transition: var(--transition);
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--error); }
.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-info { border-left: 4px solid var(--info); }

.toast-icon { font-size: 1.2rem; }
.toast-body { flex: 1; }
.toast-title { font-size: 0.875rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.15rem; }
.toast-msg { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
.toast-close { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1rem; }
.toast-close:hover { color: var(--text-main); }

@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.toast-leaving {
    transform: translateX(120%);
    opacity: 0;
}

/* ── MODAL SYSTEM ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.35rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover { color: var(--text-main); }

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
}

/* ── FORM ELEMENTS ── */
.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ── SIMULATORS ── */
.simulator-card {
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
}

.sim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--glass-border);
}

.sim-header h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sim-tag {
    font-size: 0.725rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.sim-textarea {
    width: 100%;
    padding: 0.85rem;
    background: #0d1117;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    outline: none;
    resize: vertical;
}

.sim-textarea:focus {
    border-color: var(--accent-primary);
}

.sim-preview {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-height: 120px;
}

.sim-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.endpoint-badge {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.endpoint-badge.get { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.endpoint-badge.post { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.endpoint-badge.put { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.endpoint-badge.delete { background: rgba(244, 63, 94, 0.2); color: #f87171; }

.status-badge {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
}

.status-200 { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
.status-201 { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.4); }
.status-400, .status-404, .status-500 { background: rgba(244, 63, 94, 0.2); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.4); }

/* ── FOOTER ── */
.footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: auto;
}

/* ── RESPONSIVE MEDIA QUERIES (MOBILE FIRST) ── */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .top-header {
        padding: 0 1rem 0 4.5rem;
    }
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .top-header {
        height: auto;
        padding: 0.85rem 1rem 0.85rem 4rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .custom-table thead {
        display: none;
    }

    .custom-table, .custom-table tbody, .custom-table tr, .custom-table td {
        display: block;
        width: 100%;
    }

    .custom-table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-md);
        background: rgba(255, 255, 255, 0.02);
        padding: 0.5rem;
    }

    .custom-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0.75rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        text-align: right;
    }

    .custom-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-align: left;
        padding-right: 1rem;
    }
}
