:root {
    --primary: #4f46e5;
    /* Indigo 600 */
    --primary-light: #e0e7ff;
    /* Indigo 100 */
    --accent: #0ea5e9;
    /* Sky 500 */
    --bg-main: #f8fafc;
    /* Slate 50 */
    --text-dark: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-dark);
}

.search-box {
    position: relative;
    margin-bottom: 2rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    background: #f1f5f9;
}

.search-box input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.nav-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin: 1.5rem 0 0.75rem 0.5rem;
}

.nav-links {
    list-style: none;
}

.nav-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-item:hover {
    background: #f8fafc;
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 320px;
    padding: 3rem 4rem;
}

.header {
    margin-bottom: 3rem;
    max-width: 800px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.chapter-view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.chapter-view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.definition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
}

.definition-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.75rem;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.definition-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.definition-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, transparent 45%, var(--primary-light) 50%);
    opacity: 0.3;
    transition: all 0.3s ease;
}

.def-term {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.def-meaning {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 1.25rem;
    font-weight: 400;
}

.def-imp {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: #fef2f2;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 100px;
}

.def-tags {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

/* Exam Code Sections */
.exam-tip {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    padding: 2.5rem;
    border-radius: 24px;
    margin-bottom: 3rem;
    position: relative;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.exam-tip h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.exam-tip p {
    opacity: 0.9;
    font-size: 1.05rem;
    max-width: 600px;
}

.exam-tip-icon {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 5rem;
    opacity: 0.1;
}

/* Quick Glance Bar */
.stats-bar {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
    }

    .main-content {
        margin-left: 260px;
        padding: 2.5rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
}