
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto; 
}

:root {
    --primary: #6366f1;
    --primary-soft: #818cf8;
    --accent: #22c55e;
    --danger: #ef4444;

    --bg-main: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.6);
    --bg-dark: #0f172a;

    --text-main: #0f172a;
    --text-soft: #64748b;

    --radius: 18px;
    --shadow-soft: 0 8px 25px rgba(0,0,0,0.06);
    --shadow-hover: 0 15px 40px rgba(0,0,0,0.12);
}

/* ==========================
   BODY
========================== */
body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #e0e0e0, #1c1c1c);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================
   HEADER
========================== */
.header {
    background-color: #0f172a;
    color: white;
    padding: 28px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: var(--shadow-soft);
}

.header h2{
     text-align: left;
     padding: 0%;
     color: #e0e0e0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: var(--shadow-soft);
}

/* ==========================
   LAYOUT
========================== */
.layout-container {
    flex: 1;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    padding: 30px;
    max-width: 1300px;
    margin:auto;
}

/* ==========================
   SIDEBAR
========================== */
.sidebar {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    color: white;
    padding: 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 20px;
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

.sidebar a {
    display: block;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 12px;
    text-decoration: none;
    color: #e2e8f0;
    transition: all 0.25s ease;
}

.sidebar a:hover {
    background: var(--primary);
    transform: translateX(6px);
}

/* ACTIVE MENU LINK */
.sidebar a.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
    transform: translateX(6px);
}

/* ==========================
   CONTENT SECTIONS
========================== */
.content,
#exercise2,
#exercise3,
#exercise4 {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

/* Hover effect */
.content:hover,
#exercise2:hover,
#exercise3:hover,
#exercise4:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

/* HIDE ALL SECTIONS */
.content-area section {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* SHOW ACTIVE SECTION */
.content-area section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* HEADINGS */
h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

h3 {
    margin-top: 15px;
    font-weight: 600;
}

/* TEXT */
p {
    color: var(--text-soft);
    line-height: 1.7;
    color: #000000;
}

/* ==========================
   BUTTONS
========================== */
button {
    padding: 10px 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-soft));
    color: white;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

button:active {
    transform: scale(0.97);
}

/* Reset button */
#reset {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* ==========================
   INPUTS
========================== */
input {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    margin-bottom: 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: rgba(255,255,255,0.7);
    transition: all 0.2s ease;
}

input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

/* ==========================
   RESULT BOX
========================== */
.result {
    margin-top: 15px;
    padding: 16px;
    background: rgba(99, 102, 241, 0.08);
    border-left: 5px solid var(--primary);
    border-radius: 12px;
    font-weight: 600;
}

/* ==========================
   IMAGE
========================== */
img {
    margin-top: 12px;
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease;
}

img:hover {
    transform: scale(1.05);
}

/* ==========================
   FOOTER
========================== */
.footer {
    background: #0f172a;
    color: #cbd5f5;
    text-align: center;
    padding: 16px;
    font-size: 14px;
}

/* ==========================
   DARK MODE
========================== */
body.dark {
    background: var(--bg-dark);
    color: white;
}

body.dark .sidebar,
body.dark .content,
body.dark #exercise2,
body.dark #exercise3,
body.dark #exercise4 {
    background: rgba(30, 41, 59, 0.7);
}

body.dark input {
    background: #1e293b;
    color: white;
    border: 1px solid #334155;
}

/* ==========================
   RESPONSIVE
========================== */
@media (max-width: 900px) {
    .layout-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        top: 0;
    }
}

@media (max-width: 500px) {
    .header {
        font-size: 20px;
    }

    h1 {
        font-size: 24px;
    }

    button {
        width: 100%;
    }
}