/* =========================================================
   LEARNDATA
   PREMIUM SQL / DATA ANALYTICS LEARNING UI
   CLEAN + STABLE VERSION
   ========================================================= */


/* =========================================================
   ROOT
   ========================================================= */

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-soft: #eef2ff;

    --blue: #2563eb;
    --blue-soft: #eff6ff;

    --green: #10b981;
    --green-soft: #ecfdf5;

    --orange: #f59e0b;
    --orange-soft: #fffbeb;

    --red: #ef4444;
    --red-soft: #fef2f2;

    --purple: #8b5cf6;
    --purple-soft: #f5f3ff;

    --dark: #0f172a;
    --dark-2: #1e293b;
    --dark-3: #334155;

    --text: #334155;
    --text-light: #64748b;

    --white: #ffffff;
    --bg: #f8fafc;
    --border: #e5e7eb;

    --shadow-xs:
        0 1px 3px rgba(15, 23, 42, .05);

    --shadow-sm:
        0 4px 14px rgba(15, 23, 42, .07);

    --shadow:
        0 10px 30px rgba(15, 23, 42, .09);

    --shadow-lg:
        0 20px 55px rgba(15, 23, 42, .13);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;

    --transition:
        all .25s cubic-bezier(.4, 0, .2, 1);
}


/* =========================================================
   RESET
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
}

body {
    margin: 0;

    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    color: var(--text);

    background:
        radial-gradient(
            circle at 10% 0%,
            rgba(99, 102, 241, .06),
            transparent 30%
        ),
        radial-gradient(
            circle at 90% 10%,
            rgba(37, 99, 235, .05),
            transparent 30%
        ),
        var(--bg);

    line-height: 1.65;
}


/* =========================================================
   SELECTION
   ========================================================= */

::selection {
    background: #4f46e5;
    color: #ffffff;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* =========================================================
   CONTAINER
   ========================================================= */

.container {
    max-width: 1180px;
}


/* =========================================================
   HEADER
   ========================================================= */

.learn-header {
    position: relative;
    overflow: hidden;

    padding: 75px 25px 100px;

    color: #ffffff;

    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(99, 102, 241, .35),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 15%,
            rgba(59, 130, 246, .25),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #080d1c 0%,
            #111827 50%,
            #172554 100%
        );

    border-radius: 0 0 36px 36px;

    box-shadow:
        0 25px 70px rgba(15, 23, 42, .18);
}

.learn-header::before,
.learn-header::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
}

.learn-header::before {
    width: 420px;
    height: 420px;

    right: -180px;
    top: -200px;

    background: rgba(99, 102, 241, .15);

    filter: blur(10px);
}

.learn-header::after {
    width: 280px;
    height: 280px;

    left: -130px;
    bottom: -190px;

    background: rgba(37, 99, 235, .14);
}

.learn-header h1 {
    position: relative;
    z-index: 2;

    margin: 0;

    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.1;
    font-weight: 850;

    letter-spacing: -1.8px;
}

.learn-header p {
    position: relative;
    z-index: 2;

    max-width: 720px;

    margin: 16px auto 0;

    color: #cbd5e1;

    font-size: 16px;
}


/* =========================================================
   BRAND
   ========================================================= */

.brand-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
}

.brand-title i {
    margin-right: 8px;
    color: #818cf8;
}


/* =========================================================
   HEADER CONTROLS
   ========================================================= */

.learn-header a,
.learn-header button,
.learn-header .btn {
    position: relative;
    z-index: 10;
    pointer-events: auto;
}


/* =========================================================
   MAIN CONTAINER
   ========================================================= */

.main-container {
    width: 100%;
    max-width: 1200px;

    margin: auto;

    padding: 35px 20px 80px;
}


/* =========================================================
   TOP SEARCH
   ========================================================= */

.search-section {
    position: relative;
    z-index: 50;

    max-width: 900px;

    margin: -42px auto 0;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 8px;

    background: rgba(255, 255, 255, .94);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 18px;

    box-shadow:
        0 20px 50px rgba(15, 23, 42, .15);

    transition: var(--transition);
}

.search-box:focus-within {
    transform: translateY(-2px);

    border-color:
        rgba(99, 102, 241, .35);

    box-shadow:
        0 25px 60px rgba(79, 70, 229, .18);
}

.search-box input,
#searchInput {
    flex: 1;
    min-width: 0;

    padding: 15px 17px;

    border: none;
    outline: none;

    background: transparent;

    color: var(--dark);

    font-size: 15px;
}

.search-box input::placeholder {
    color: #94a3b8;
}


/* =========================================================
   SEARCH BUTTON
   ========================================================= */

.search-btn {
    border: none;
    outline: none;

    padding: 13px 22px;

    border-radius: 12px;

    color: #ffffff;

    font-weight: 750;

    background:
        linear-gradient(
            135deg,
            #4f46e5,
            #2563eb
        );

    box-shadow:
        0 8px 18px rgba(79, 70, 229, .25);

    cursor: pointer;

    transition: var(--transition);
}

.search-btn:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 25px rgba(79, 70, 229, .35);
}

.search-btn:active {
    transform: translateY(0);
}


/* =========================================================
   GLOBAL SEARCH RESULTS
   ========================================================= */

.search-results {
    margin-top: 10px;
    padding: 7px;

    max-height: 330px;

    overflow-y: auto;

    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: 16px;

    box-shadow:
        0 18px 45px rgba(15, 23, 42, .12);
}

.search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 13px 14px;

    border: 1px solid transparent;
    border-radius: 11px;

    cursor: pointer;

    transition: var(--transition);
}

.search-item:hover {
    background:
        linear-gradient(
            90deg,
            #eef2ff,
            #f8fafc
        );

    border-color: #c7d2fe;

    transform: translateX(3px);
}

.search-left {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.search-left strong {
    color: var(--dark);

    font-size: 14px;
    font-weight: 750;
}

.search-left small {
    color: var(--text-light);
    font-size: 12px;
}

.search-score {
    flex-shrink: 0;

    padding: 5px 9px;

    border-radius: 20px;

    color: #4338ca;
    background: #eef2ff;

    font-size: 10px;
    font-weight: 800;
}


/* =========================================================
   LEARNING LAYOUT
   ========================================================= */

.learning-layout {
    display: grid;

    grid-template-columns:
        minmax(250px, 320px)
        minmax(0, 1fr);

    gap: 24px;

    align-items: start;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.learn-sidebar,
#learningSidebar {
    position: sticky;

    top: 80px;

    width: 100%;
    max-width: 320px;

    max-height: calc(100vh - 95px);

    align-self: start;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 18px;

    box-shadow:
        0 8px 25px rgba(15, 23, 42, .06);

    overflow: hidden;
}


/* =========================================================
   SIDEBAR HEADER
   ========================================================= */

.sidebar-header {
    display: flex;
    align-items: center;

    gap: 13px;

    padding: 18px 16px;

    background:
        linear-gradient(
            135deg,
            #f8faff,
            #eef3ff
        );

    border-bottom: 1px solid #e5e7eb;
}

.sidebar-icon {
    width: 42px;
    min-width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    color: #4f46e5;

    background: #ffffff;

    box-shadow:
        0 4px 12px rgba(79, 70, 229, .12);
}

.sidebar-icon i {
    font-size: 18px;
}

.sidebar-header h5 {
    margin: 0;

    color: #111827;

    font-size: 15px;
    font-weight: 700;

    line-height: 1.3;
}

.sidebar-header small {
    display: block;

    margin-top: 4px;

    color: #6b7280;

    font-size: 12px;
}


/* =========================================================
   LESSON SEARCH
   ========================================================= */

.lesson-search-box {
    position: relative;
    z-index: 20;

    padding: 14px;

    background: #ffffff;

    border-bottom: 1px solid #e5e7eb;
}

.search-input-wrapper {
    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
}

.lesson-search-box .search-icon,
.search-input-wrapper .search-icon {
    position: absolute;

    left: 13px;

    color: #94a3b8;

    pointer-events: none;

    z-index: 2;
}

.lesson-search-input {
    width: 100%;
    height: 42px;

    padding: 0 40px;

    border: 1px solid #d9dee7;
    border-radius: 11px;

    outline: none;

    background: #f8fafc;

    color: #1e293b;

    font-size: 14px;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.lesson-search-input:hover {
    border-color: #c7ced9;
}

.lesson-search-input:focus {
    background: #ffffff;

    border-color: #6366f1;

    box-shadow:
        0 0 0 3px rgba(99, 102, 241, .10);
}

.lesson-search-input::placeholder {
    color: #94a3b8;
}


/* =========================================================
   SEARCH CLEAR BUTTON
   ========================================================= */

.search-clear-btn {
    position: absolute;

    right: 8px;

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 7px;

    background: transparent;

    color: #94a3b8;

    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease;
}

.search-clear-btn:hover {
    background: #eef2ff;
    color: #4f46e5;
}


/* =========================================================
   LESSON SEARCH DROPDOWN
   ========================================================= */

.lesson-search-results {
    position: absolute;

    top: calc(100% - 3px);

    left: 6px;
    right: 6px;

    width: auto;

    margin: 0;

    padding: 8px;

    background: #ffffff;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    box-shadow:
        0 14px 35px rgba(15, 23, 42, .16);

    z-index: 9999;

    max-height: 420px;

    overflow-y: auto;
    overflow-x: hidden;

    animation:
        searchDropIn .18s ease;
}

@keyframes searchDropIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   SEARCH RESULT COUNT
   ========================================================= */

.search-result-count {
    padding: 7px 9px 8px;

    margin-bottom: 5px;

    color: #64748b;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: .4px;

    text-transform: uppercase;

    border-bottom: 1px solid #f1f5f9;
}


/* =========================================================
   SEARCH RESULT ITEM
   ========================================================= */

.search-result-item {
    width: 100%;

    display: flex;
    align-items: flex-start;

    gap: 10px;

    padding: 10px;

    margin: 3px 0;

    min-height: 54px;

    border: 1px solid transparent;
    border-radius: 10px;

    background: #ffffff;

    text-align: left;

    cursor: pointer;

    transition:
        background .18s ease,
        border-color .18s ease,
        transform .18s ease;
}

.search-result-item:hover {
    background: #f5f7ff;

    border-color: #dfe4ff;

    transform: translateX(2px);
}


/* =========================================================
   SEARCH RESULT ICON
   ========================================================= */

.search-result-icon {
    width: 34px;
    min-width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: #eef2ff;

    color: #4f46e5;

    font-size: 14px;
}


/* =========================================================
   SEARCH RESULT CONTENT
   ========================================================= */

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-content strong {
    display: block;

    color: #1e293b;

    font-size: 13px;
    font-weight: 650;

    line-height: 1.4;

    white-space: normal;

    overflow: visible;

    overflow-wrap: anywhere;
}

.search-result-content small {
    display: block;

    margin-top: 3px;

    color: #94a3b8;

    font-size: 10px;

    line-height: 1.4;

    white-space: normal;

    overflow: visible;

    overflow-wrap: anywhere;
}


/* =========================================================
   SEARCH RESULT ARROW
   ========================================================= */

.search-result-arrow {
    width: 24px;
    min-width: 24px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #94a3b8;

    font-size: 11px;

    transition:
        color .18s ease,
        transform .18s ease;
}

.search-result-item:hover .search-result-arrow {
    color: #4f46e5;

    transform: translateX(2px);
}


/* =========================================================
   SEARCH EMPTY / MORE
   ========================================================= */

.search-no-result {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 20px 10px;

    color: #64748b;

    font-size: 12px;

    text-align: center;
}

.search-no-result i {
    color: #f59e0b;
}

.search-more {
    padding: 9px 6px 6px;

    margin-top: 4px;

    color: #94a3b8;

    font-size: 10px;

    text-align: center;

    border-top: 1px solid #f1f5f9;
}


/* =========================================================
   SEARCH RESULT SCROLLBAR
   ========================================================= */

.lesson-search-results::-webkit-scrollbar {
    width: 5px;
}

.lesson-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.lesson-search-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.lesson-search-results::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* =========================================================
   LESSON LIST
   ========================================================= */

.lesson-list {
    position: relative;
    z-index: 1;

    padding: 10px;

    display: flex;
    flex-direction: column;

    gap: 5px;

    max-height: calc(100vh - 245px);

    overflow-y: auto;
}

.lesson-list::-webkit-scrollbar {
    width: 5px;
}

.lesson-list::-webkit-scrollbar-track {
    background: transparent;
}

.lesson-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 20px;
}

.lesson-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}


/* =========================================================
   LESSON ITEM
   ========================================================= */

.lesson-item {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 11px;

    padding: 10px 11px;

    border: 1px solid transparent;
    border-radius: 10px;

    background: transparent;

    text-align: left;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    outline: none;

    transition:
        background .2s ease,
        border-color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

.lesson-item:hover {
    background: #f8faff;

    border-color: #e0e7ff;

    transform: translateX(2px);
}

.lesson-item.active {
    background: #eef2ff;

    border-color: #c7d2fe;

    box-shadow:
        0 3px 10px rgba(79, 70, 229, .08);
}

.lesson-item.active:hover {
    background: #e8edff;
}

.lesson-item.completed {
    background: #f8fafc;
}

.lesson-item.completed:hover {
    background: #f1f5f9;
}


/* =========================================================
   LESSON NUMBER
   ========================================================= */

.lesson-number {
    width: 28px;
    min-width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    color: #9ca3af;

    background: #f3f4f6;
}

.lesson-number i {
    font-size: 14px;
}

.lesson-item.active .lesson-number {
    background: #4f46e5;
    color: #ffffff;
}

.lesson-item.completed .lesson-number {
    background: #dcfce7;
    color: #16a34a;
}


/* =========================================================
   LESSON INFO
   ========================================================= */

.lesson-info {
    min-width: 0;
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 3px;
}

.lesson-info strong {
    display: block;

    color: #1f2937;

    font-size: 13px;
    font-weight: 600;

    line-height: 1.35;

    white-space: normal;

    overflow-wrap: anywhere;
}

.lesson-item.active .lesson-info strong {
    color: #3730a3;
}

.lesson-info small {
    display: block;

    color: #9ca3af;

    font-size: 11px;

    line-height: 1.2;

    white-space: nowrap;
}


/* =========================================================
   TOPIC NAVIGATION
   ========================================================= */

.topic-navigation {
    margin-top: 38px;
}

.topic-navigation .nav-link {
    padding: 9px 14px;

    border-radius: 10px;

    color: #64748b;

    font-size: 13px;
    font-weight: 700;

    transition: var(--transition);
}

.topic-navigation .nav-link:hover {
    color: #4f46e5;
    background: #eef2ff;
}

.topic-navigation .nav-link.active {
    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #4f46e5,
            #6366f1
        );

    box-shadow:
        0 6px 15px rgba(79, 70, 229, .22);
}


/* =========================================================
   CATEGORY CARD
   ========================================================= */

.category-card {
    position: relative;

    height: 100%;

    padding: 24px;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: 18px;

    box-shadow: var(--shadow-xs);

    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-7px);

    border-color: #c7d2fe;

    box-shadow:
        0 18px 40px rgba(15, 23, 42, .10);
}

.category-icon {
    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 15px;

    color: #4f46e5;

    background:
        linear-gradient(
            135deg,
            #eef2ff,
            #e0e7ff
        );

    font-size: 21px;
}

.category-card h3 {
    margin-bottom: 7px;

    color: var(--dark);

    font-size: 17px;
    font-weight: 800;
}

.category-card p {
    margin: 0;

    color: var(--text-light);

    font-size: 13px;
}


/* =========================================================
   TOPIC CARD
   ========================================================= */

.topic-card {
    position: relative;

    height: 100%;

    padding: 26px;

    background: rgba(255, 255, 255, .96);

    border: 1px solid var(--border);

    border-radius: 20px;

    box-shadow: var(--shadow-sm);

    transition: var(--transition);
}

.topic-card:hover {
    border-color: #c7d2fe;

    box-shadow:
        0 20px 45px rgba(15, 23, 42, .10);
}


/* =========================================================
   TOPIC HEADER
   ========================================================= */

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    gap: 20px;

    margin-bottom: 22px;
}

.topic-title {
    margin: 0;

    color: var(--dark);

    font-size: clamp(22px, 3vw, 30px);

    line-height: 1.25;

    font-weight: 850;

    letter-spacing: -.5px;
}

.topic-description {
    margin-top: 8px;

    color: var(--text-light);

    font-size: 14px;
}


/* =========================================================
   BADGES
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;

    gap: 5px;

    padding: 6px 10px;

    border-radius: 20px;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: .3px;

    border: 1px solid transparent;
}

.badge-beginner {
    color: #047857;

    background: #ecfdf5;

    border-color: #a7f3d0;
}

.badge-intermediate {
    color: #b45309;

    background: #fffbeb;

    border-color: #fde68a;
}

.badge-advanced {
    color: #b91c1c;

    background: #fef2f2;

    border-color: #fecaca;
}

.badge-sql {
    color: #4338ca;

    background: #eef2ff;

    border-color: #c7d2fe;
}


/* =========================================================
   SECTION TITLE
   ========================================================= */

.section-title {
    display: flex;
    align-items: center;

    gap: 10px;

    margin: 32px 0 16px;

    color: var(--dark);

    font-size: 18px;
    font-weight: 850;

    letter-spacing: -.2px;
}

.section-title i {
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    color: #4f46e5;

    background: #eef2ff;

    font-size: 13px;
}


/* =========================================================
   CODE CARD
   ========================================================= */

.code-card {
    overflow: hidden;

    margin: 20px 0;

    background: #0b1120;

    border: 1px solid #1e293b;

    border-radius: 18px;

    box-shadow:
        0 18px 40px rgba(2, 6, 23, .18);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 52px;

    padding: 10px 16px;

    color: #cbd5e1;

    background: #111827;

    border-bottom: 1px solid #1e293b;

    font-size: 12px;
    font-weight: 750;
}

.code-header span {
    display: flex;
    align-items: center;

    gap: 9px;
}

.code-header span::before {
    content: "";

    width: 9px;
    height: 9px;

    border-radius: 50%;

    background: #22c55e;

    box-shadow:
        15px 0 #f59e0b,
        30px 0 #ef4444;

    margin-right: 30px;
}

.copy-code-btn {
    padding: 7px 13px;

    border: 1px solid #334155;
    border-radius: 9px;

    background: #1e293b;

    color: #cbd5e1;

    font-size: 11px;
    font-weight: 750;

    cursor: pointer;

    transition: var(--transition);
}

.copy-code-btn:hover {
    color: #ffffff;

    background: #334155;

    border-color: #475569;
}

.copy-code-btn.copied {
    color: #ffffff;

    background: #059669;

    border-color: #059669;
}


/* =========================================================
   CODE
   ========================================================= */

pre {
    margin: 0;
}

pre code,
.sql-code {
    display: block;

    padding: 22px;

    overflow-x: auto;

    background: #0b1120;

    color: #e2e8f0;

    font-family:
        "Cascadia Code",
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 13px;

    line-height: 1.8;

    tab-size: 4;
}


/* =========================================================
   EXPLANATION
   ========================================================= */

.explanation-card {
    position: relative;

    padding: 22px 24px;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: 17px;

    box-shadow: var(--shadow-xs);
}

.explanation-card::before {
    content: "";

    position: absolute;

    left: 0;
    top: 18px;
    bottom: 18px;

    width: 4px;

    border-radius: 0 5px 5px 0;

    background:
        linear-gradient(
            180deg,
            #4f46e5,
            #2563eb
        );
}

.explanation-card p {
    margin: 0;

    color: #475569;

    font-size: 14px;

    line-height: 1.8;
}


/* =========================================================
   BUSINESS CASE
   ========================================================= */

.business-case {
    position: relative;

    padding: 23px 25px;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #eef2ff,
            #f8fafc
        );

    border: 1px solid #c7d2fe;

    border-radius: 18px;
}

.business-case h4 {
    position: relative;
    z-index: 2;

    margin-bottom: 7px;

    color: #3730a3;

    font-size: 16px;
    font-weight: 800;
}

.business-case p {
    position: relative;
    z-index: 2;

    margin: 0;

    color: #475569;

    font-size: 14px;
}


/* =========================================================
   TABLES
   ========================================================= */

.table-wrapper,
.output-table {
    overflow: auto;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: 17px;

    box-shadow: var(--shadow-xs);
}

.table-wrapper table,
.output-table table {
    width: 100%;

    border-collapse: collapse;
}

.table-wrapper table {
    min-width: 600px;
}

.output-table table {
    min-width: 500px;
}

.table-wrapper th {
    padding: 13px 15px;

    color: #475569;

    background: #f8fafc;

    border-bottom: 1px solid var(--border);

    font-size: 11px;
    font-weight: 850;

    text-align: left;

    text-transform: uppercase;

    letter-spacing: .5px;
}

.table-wrapper td {
    padding: 12px 15px;

    color: #475569;

    border-bottom: 1px solid #f1f5f9;

    font-size: 13px;
}

.table-wrapper tbody tr:hover {
    background: #f8fafc;
}

.table-wrapper tbody tr:last-child td,
.output-table tr:last-child td {
    border-bottom: none;
}

.output-table th {
    padding: 13px 15px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #111827,
            #1e293b
        );

    font-size: 12px;
    font-weight: 750;

    text-align: left;
}

.output-table td {
    padding: 12px 15px;

    border-bottom: 1px solid #f1f5f9;

    font-size: 13px;
}


/* =========================================================
   INTERVIEW
   ========================================================= */

.interview-card {
    padding: 22px;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: 17px;

    box-shadow: var(--shadow-xs);

    transition: var(--transition);
}

.interview-card:hover {
    transform: translateY(-3px);

    box-shadow: var(--shadow);

    border-color: #c7d2fe;
}

.interview-question {
    display: flex;

    gap: 11px;

    color: var(--dark);

    font-size: 14px;

    font-weight: 800;
}

.interview-question i {
    flex-shrink: 0;

    color: #4f46e5;

    margin-top: 4px;
}

.interview-answer {
    padding-left: 27px;

    margin-top: 9px;

    color: #64748b;

    font-size: 13px;

    line-height: 1.8;
}


/* =========================================================
   ERROR
   ========================================================= */

.error-card {
    position: relative;

    padding: 17px 20px 17px 23px;

    margin-bottom: 11px;

    background: #ffffff;

    border: 1px solid #fecaca;

    border-radius: 14px;

    box-shadow: var(--shadow-xs);
}

.error-card::before {
    content: "";

    position: absolute;

    left: 0;
    top: 0;
    bottom: 0;

    width: 4px;

    background: #ef4444;

    border-radius: 4px 0 0 4px;
}

.error-card strong {
    color: #991b1b;

    font-size: 13px;
}

.error-card p {
    margin: 4px 0 0;

    color: #7f1d1d;

    font-size: 13px;
}


/* =========================================================
   TIP
   ========================================================= */

.tip-card {
    display: flex;
    align-items: flex-start;

    gap: 13px;

    padding: 17px 19px;

    margin-bottom: 11px;

    background: #ffffff;

    border: 1px solid #a7f3d0;

    border-radius: 14px;

    box-shadow: var(--shadow-xs);
}

.tip-icon {
    flex-shrink: 0;

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #059669;

    background: #ecfdf5;

    border-radius: 10px;
}

.tip-card p {
    margin: 0;

    color: #166534;

    font-size: 13px;
}


/* =========================================================
   KEYWORDS
   ========================================================= */

.keyword-list {
    display: flex;
    flex-wrap: wrap;

    gap: 7px;
}

.keyword {
    display: inline-flex;
    align-items: center;

    padding: 6px 10px;

    color: #475569;

    background: #f8fafc;

    border: 1px solid #e2e8f0;

    border-radius: 20px;

    font-size: 11px;
    font-weight: 700;

    transition: var(--transition);
}

.keyword:hover {
    color: #4338ca;

    background: #eef2ff;

    border-color: #c7d2fe;

    transform: translateY(-1px);
}


/* =========================================================
   QUIZ
   ========================================================= */

.quiz-card {
    padding: 26px;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: 20px;

    box-shadow: var(--shadow);
}

.quiz-question {
    margin-bottom: 20px;

    color: var(--dark);

    font-size: 18px;

    font-weight: 800;
}

.quiz-option {
    display: block;

    width: 100%;

    padding: 13px 15px;

    margin-bottom: 9px;

    color: #475569;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: 11px;

    text-align: left;

    cursor: pointer;

    transition: var(--transition);
}

.quiz-option:hover {
    color: #4338ca;

    background: #eef2ff;

    border-color: #a5b4fc;

    transform: translateX(3px);
}

.quiz-option.correct {
    color: #047857;

    background: #ecfdf5;

    border-color: #6ee7b7;
}

.quiz-option.wrong {
    color: #b91c1c;

    background: #fef2f2;

    border-color: #fca5a5;
}


/* =========================================================
   PROGRESS
   ========================================================= */

.progress-card {
    padding: 20px;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: 16px;

    box-shadow: var(--shadow-xs);
}

.progress {
    height: 8px;

    overflow: hidden;

    background: #e2e8f0;

    border-radius: 20px;
}

.progress-bar {
    border-radius: 20px;

    background:
        linear-gradient(
            90deg,
            #4f46e5,
            #2563eb
        );
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    border-radius: 14px;

    font-size: 13px;
}

.alert-info {
    color: #155e75;

    background: #ecfeff;

    border-color: #a5f3fc;
}

.alert-success {
    color: #166534;

    background: #ecfdf5;

    border-color: #a7f3d0;
}

.alert-warning {
    color: #92400e;

    background: #fffbeb;

    border-color: #fde68a;
}

.alert-danger {
    color: #991b1b;

    background: #fef2f2;

    border-color: #fecaca;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 65px 20px;

    text-align: center;
}

.empty-state i {
    width: 70px;
    height: 70px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 16px;

    color: #818cf8;

    background: #eef2ff;

    border-radius: 20px;

    font-size: 27px;
}

.empty-state h3 {
    margin-bottom: 5px;

    color: var(--dark);

    font-size: 19px;

    font-weight: 800;
}

.empty-state p {
    color: #64748b;

    font-size: 13px;
}


/* =========================================================
   LOADING
   ========================================================= */

.loading {
    display: flex;
    justify-content: center;
    align-items: center;

    padding: 50px;
}

.loading-spinner {
    width: 40px;
    height: 40px;

    border: 3px solid #e0e7ff;

    border-top-color: #4f46e5;

    border-radius: 50%;

    animation:
        spin .75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   FADE
   ========================================================= */

.fade-in {
    animation:
        fadeIn .35s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    border-radius: 10px;

    font-weight: 700;

    transition: var(--transition);
}

.btn-primary {
    background:
        linear-gradient(
            135deg,
            #4f46e5,
            #2563eb
        );

    border: none;

    box-shadow:
        0 6px 15px rgba(79, 70, 229, .18);
}

.btn-primary:hover {
    transform: translateY(-2px);

    box-shadow:
        0 10px 22px rgba(79, 70, 229, .28);
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    position: relative;

    margin-top: 70px;

    padding: 38px 20px;

    overflow: hidden;

    color: #94a3b8;

    background:
        linear-gradient(
            135deg,
            #080d18,
            #111827
        );

    text-align: center;
}

footer::before {
    content: "";

    position: absolute;

    width: 250px;
    height: 250px;

    left: 50%;
    top: -210px;

    transform: translateX(-50%);

    border-radius: 50%;

    background:
        rgba(79, 70, 229, .10);
}

footer p {
    position: relative;
    z-index: 2;

    margin: 0;

    font-size: 13px;
}

footer i {
    margin-right: 6px;

    color: #818cf8;
}

footer a {
    color: #a5b4fc;

    text-decoration: none;

    transition: var(--transition);
}

footer a:hover {
    color: #ffffff;
}


/* =========================================================
   FOCUS
   ========================================================= */

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline:
        3px solid rgba(99, 102, 241, .25);

    outline-offset: 3px;
}


/* =========================================================
   HOVER UTILITY
   ========================================================= */

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-5px);

    box-shadow: var(--shadow-lg);
}


/* =========================================================
   SOFT BACKGROUNDS
   ========================================================= */

.bg-soft-primary {
    background: #eef2ff !important;
}

.bg-soft-success {
    background: #ecfdf5 !important;
}

.bg-soft-warning {
    background: #fffbeb !important;
}

.bg-soft-danger {
    background: #fef2f2 !important;
}

.bg-soft-blue {
    background: #eff6ff !important;
}


/* =========================================================
   TEXT UTILITIES
   ========================================================= */

.text-primary {
    color: #4f46e5 !important;
}

.text-muted {
    color: #64748b !important;
}

.text-success {
    color: #059669 !important;
}

.text-danger {
    color: #dc2626 !important;
}

.text-warning {
    color: #d97706 !important;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 992px) {

    .learning-layout {
        grid-template-columns: 1fr;
    }

    .learn-sidebar,
    #learningSidebar {
        position: relative;

        top: auto;

        max-width: 100%;

        max-height: none;
    }

    .lesson-list {
        max-height: 420px;
    }
}


/* =========================================================
   TABLET / MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .learn-header {
        padding: 55px 18px 75px;

        border-radius:
            0 0 26px 26px;
    }

    .learn-header h1 {
        font-size: 32px;

        letter-spacing: -1px;
    }

    .learn-header p {
        font-size: 14px;
    }

    .main-container {
        padding:
            25px 14px 55px;
    }

    .search-section {
        margin-top: -32px;

        padding: 0 7px;
    }

    .search-box {
        flex-direction: column;

        align-items: stretch;

        padding: 7px;

        border-radius: 15px;
    }

    .search-box input {
        padding: 13px;
    }

    .search-btn {
        width: 100%;
    }

    .learn-sidebar,
    #learningSidebar {
        border-radius: 14px;
    }

    .sidebar-header {
        padding: 15px;
    }

    .lesson-list {
        max-height: 420px;
    }

    .lesson-item {
        padding: 10px;
    }

    .lesson-info strong {
        font-size: 13px;
    }

    .topic-header {
        flex-direction: column;

        gap: 12px;
    }

    .topic-card {
        padding: 20px;

        border-radius: 17px;
    }

    .category-card {
        padding: 20px;
    }

    .code-card {
        border-radius: 14px;
    }

    .code-header {
        min-height: 48px;

        padding: 9px 12px;
    }

    pre code,
    .sql-code {
        padding: 17px;

        font-size: 12px;

        line-height: 1.7;
    }

    .section-title {
        font-size: 17px;
    }

    .lesson-search-box {
        padding: 12px;
    }

    .lesson-search-results {
        left: 8px;
        right: 8px;

        max-height: 60vh;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .learn-header h1 {
        font-size: 27px;
    }

    .learn-header p {
        font-size: 13px;
    }

    .topic-title {
        font-size: 21px;
    }

    .topic-description {
        font-size: 13px;
    }

    .search-left small {
        font-size: 11px;
    }

    .search-score {
        display: none;
    }

    .code-header span::before {
        display: none;
    }

    .copy-code-btn {
        padding: 6px 9px;

        font-size: 10px;
    }

    .business-case,
    .explanation-card {
        padding: 18px;
    }

    .interview-card {
        padding: 18px;
    }

    .quiz-card {
        padding: 20px;
    }

    .sidebar-header {
        padding: 14px;
    }

    .sidebar-icon {
        width: 38px;
        min-width: 38px;
        height: 38px;
    }

    .lesson-list {
        padding: 8px;
    }

    .lesson-item {
        gap: 9px;
    }

    .lesson-number {
        width: 26px;
        min-width: 26px;
        height: 26px;
    }

    footer {
        padding: 30px 15px;
    }
}


/* =========================================================
   END
   ========================================================= */