@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    --bg-dark: #08090c;
    --card-bg: rgba(255, 255, 255, 0.02);
    --border-color: rgba(255, 255, 255, 0.06);
    --primary: #6366f1; /* Neon Violet */
    --primary-hover: #4f46e5;
    --accent: #d946ef; /* Hot Pink/Magenta */
    --accent-glow: rgba(217, 70, 239, 0.15);
    --primary-glow: rgba(99, 102, 241, 0.15);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Ambient Background Lights */
body::before {
    content: "";
    position: fixed;
    top: -20%;
    left: -20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0) 70%);
    z-index: -1;
    filter: blur(80px);
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    bottom: -20%;
    right: -20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(217, 70, 239, 0.1) 0%, rgba(217, 70, 239, 0) 70%);
    z-index: -1;
    filter: blur(80px);
    pointer-events: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Navbar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 8%;
    background: rgba(8, 9, 12, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 50%, #d946ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: "{ }";
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d946ef 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-right: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 50%, var(--accent) 100%);
    background-size: 200% auto;
    color: white;
    padding: 0.75rem 1.6rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(217, 70, 239, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    padding: 0.75rem 1.6rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 8rem 5% 6rem;
    position: relative;
}

.hero h1 {
    font-size: 4.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.15;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #f8fafc 40%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero h1 span {
    background: linear-gradient(135deg, #6366f1 0%, #d946ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(99, 102, 241, 0.2);
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.25rem;
    max-width: 650px;
    margin: 0 auto 2.5rem;
    font-weight: 400;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2.2rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(130deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 60%);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 15px 45px -10px rgba(99, 102, 241, 0.15);
    background: rgba(255, 255, 255, 0.025);
}

/* Grids */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.section {
    padding: 6rem 8%;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #f8fafc 60%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Split Layout / IDE Design */
.split-layout {
    display: grid;
    grid-template-columns: 45% 55%;
    height: calc(100vh - 75px);
    background: #090a0d;
}

.problem-desc {
    padding: 2.5rem;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    background: #0b0c10;
}

.problem-desc h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.editor-container {
    display: flex;
    flex-direction: column;
    background: #0e0f14;
}

textarea.code-editor {
    flex: 1;
    background: #0c0d12;
    color: #e2e8f0;
    border: none;
    padding: 2rem;
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    font-size: 1.05rem;
    line-height: 1.7;
    resize: none;
    outline: none;
    border-bottom: 1px solid var(--border-color);
}

.editor-footer {
    padding: 1.2rem 2rem;
    background: #090a0d;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.2rem;
}

#resultMsg {
    margin-right: auto;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

#resultMsg.success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

#resultMsg.error {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

/* Forms */
.form-group {
    margin-bottom: 1.8rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.9rem 1.2rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

/* Badges */
.badge {
    padding: 0.35rem 0.8rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-block;
}

.badge.easy {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge.medium {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge.hard {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Tabs & Course Outline */
.tabs-container {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1px;
}

.tab-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-secondary) !important;
    padding: 0.8rem 1.2rem !important;
    border-radius: 0 !important;
    border-bottom: 2px solid transparent !important;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn.active-tab {
    color: var(--primary) !important;
    border-bottom: 2px solid var(--primary) !important;
}

.tab-content {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.2rem;
    margin-top: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .split-layout, .hero {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Background Decorations mimicking the branding banner */
.bg-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.decor-bracket, .decor-arrow {
    position: absolute;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 800;
    user-select: none;
    pointer-events: none;
    opacity: 0.18; /* Subtle background opacity */
    transition: all 0.5s ease;
}

/* Left bracket { */
.decor-left-1 {
    top: 12%;
    left: 4%;
    font-size: 9rem;
    color: #a855f7;
    text-shadow: 0 0 50px rgba(168, 85, 247, 0.6);
    transform: rotate(-12deg);
}

/* Right bracket } */
.decor-right-1 {
    top: 15%;
    right: 5%;
    font-size: 11rem;
    color: #6366f1;
    text-shadow: 0 0 60px rgba(99, 102, 241, 0.6);
    transform: rotate(18deg);
}

/* Left curly { at bottom */
.decor-left-2 {
    bottom: 12%;
    left: 6%;
    font-size: 10rem;
    color: #22d3ee;
    text-shadow: 0 0 50px rgba(34, 211, 238, 0.5);
    transform: rotate(6deg);
}

/* Right curly } at bottom */
.decor-right-2 {
    bottom: 8%;
    right: 8%;
    font-size: 8rem;
    color: #ec4899;
    text-shadow: 0 0 40px rgba(236, 72, 153, 0.5);
    transform: rotate(-14deg);
}

/* Arrow => */
.decor-arrow-1 {
    top: 48%;
    left: 10%;
    font-size: 3.5rem;
    color: #ec4899;
    transform: rotate(-20deg);
}

.decor-arrow-2 {
    bottom: 30%;
    right: 20%;
    font-size: 4rem;
    color: #6366f1;
    transform: rotate(12deg);
}

/* Parenthesis () */
.decor-parens {
    top: 14%;
    right: 32%;
    font-size: 6rem;
    color: #22d3ee;
    text-shadow: 0 0 35px rgba(34, 211, 238, 0.5);
    transform: rotate(-8deg);
}

/* Grid Overlay on Background */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(8, 9, 12, 0.15) 0%, rgba(8, 9, 12, 0.95) 100%),
        linear-gradient(rgba(255, 255, 255, 0.012) 1.5px, transparent 1.5px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1.5px, transparent 1.5px);
    background-size: 100% 100%, 55px 55px, 55px 55px;
}

/* Background Code Snippet Highlighting */
.bg-code-block {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    background: rgba(8, 9, 12, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 1rem 1.4rem;
    pointer-events: none;
    user-select: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    opacity: 0.18; /* Semi-transparent background layer */
    z-index: -1;
}

.syntax-keyword { color: #f472b6; font-weight: 600; } /* Pink */
.syntax-def { color: #60a5fa; } /* Blue */
.syntax-string { color: #34d399; } /* Green */
.syntax-comment { color: #94a3b8; opacity: 0.7; } /* Gray */
.syntax-number { color: #fbbf24; } /* Orange */

/* Code Blocks Positions */
.code-top-left {
    top: 15%;
    left: 10%;
    transform: rotate(-3deg);
}

.code-top-right {
    top: 10%;
    right: 12%;
    transform: rotate(2deg);
}

.code-bottom-left {
    bottom: 12%;
    left: 8%;
    transform: rotate(2deg);
}

.code-bottom-right {
    bottom: 18%;
    right: 10%;
    transform: rotate(-3deg);
}
