:root {
    --google-blue: #4285F4;
    --google-red: #EA4335;
    --google-yellow: #FBBC05;
    --google-green: #34A853;

    --bg-color: #ffffff;
    --surface-color: #f8f9fa;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border-color: #dadce0;
    --hover-bg: #f1f3f4;

    --easy-color: #00b8a3;
    --medium-color: #ffc01e;
    --hard-color: #ff375f;

    --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --shadow-md: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    --font-family: 'Roboto', 'Product Sans', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Header & Search */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: var(--bg-color);
    z-index: 100;
}

.logo-container {
    display: inline-block;
    font-size: 3rem;
    font-weight: 500;
    letter-spacing: -2px;
    margin-bottom: 24px;
    font-family: 'Product Sans', sans-serif;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.logo.G {
    color: var(--google-blue);
}

.logo.o1 {
    color: var(--google-red);
}

.logo.o2 {
    color: var(--google-yellow);
}

.logo.g {
    color: var(--google-blue);
}

.logo.l {
    color: var(--google-green);
}

.logo.e {
    color: var(--google-red);
}

.logo.d {
    color: var(--google-yellow);
}

.logo.e2 {
    color: var(--google-blue);
}

.logo-text {
    font-size: 1.5rem;
    color: var(--text-secondary);
    vertical-align: super;
    margin-left: -5px;
    letter-spacing: 0;
    font-family: 'Product Sans', sans-serif;
}

.search-container {
    width: 100%;
    max-width: 684px;
    display: flex;
    gap: 12px;
}

.search-bar {
    flex-grow: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 0 14px;
    box-shadow: none;
    transition: box-shadow 0.2s, border-color 0.2s;
    height: 48px;
}

.search-bar:hover,
.search-bar:focus-within {
    box-shadow: var(--shadow-sm);
    border-color: transparent;
}

.search-icon {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
}

#searchInput {
    border: none;
    outline: none;
    font-size: 16px;
    width: 100%;
    padding: 10px;
}

.filter-select {
    height: 48px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    padding: 0 16px;
    background: white;
    color: var(--text-secondary);
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.filter-select:hover {
    background: var(--surface-color);
}

/* Main Content */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 20px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.sidebar {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 140px;
    /* offset from sticky header */
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    padding-right: 8px;
    /* space for scrollbar */
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.sidebar-title {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.content-area {
    flex-grow: 1;
    min-width: 0;
}

.results-info {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 6px;
}

/* Sidebar announcement block */
.sidebar-announcement {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(145deg, #f0f4ff 0%, #e8f0fe 100%);
    border: 1px solid #c5d8fb;
    border-left: 3px solid var(--google-blue);
    border-radius: 10px;
    padding: 12px 13px;
    margin-bottom: 20px;
    overflow: hidden;
}

.announcement-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.announcement-icon {
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
}

.announcement-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--google-blue);
}

.announcement-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.announcement-row {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.announcement-row-icon {
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 1px;
}

.announcement-row strong {
    color: var(--text-primary);
    font-weight: 600;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.tag-btn {
    background: white;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.tag-btn:hover {
    background: var(--hover-bg);
}

.tag-btn.active {
    background: #e8f0fe;
    color: var(--google-blue);
    border-color: transparent;
}

/* Question List */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.question-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.question-card:hover {
    background: var(--surface-color);
}

.q-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.q-title {
    font-size: 18px;
    font-weight: 400;
    color: var(--google-blue);
    margin-bottom: 4px;
}

.q-title:hover {
    text-decoration: underline;
}

.q-snippet {
    font-size: 14px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge.easy {
    color: var(--easy-color);
    background: rgba(0, 184, 163, 0.1);
}

.badge.medium {
    color: var(--medium-color);
    background: rgba(255, 192, 30, 0.1);
}

.badge.hard {
    color: var(--hard-color);
    background: rgba(255, 55, 95, 0.1);
}

/* Question Page Layout */
.question-main-content {
    display: flex;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    gap: 24px;
}

.split-pane {
    min-width: 300px;
    background: #fff;
    border: 1px solid #eaecef;
    border-radius: 10px;
    padding: 28px;
    height: calc(100vh - 160px);
    overflow-y: auto;
    box-shadow: 0 1px 4px rgba(60, 64, 67, 0.08);
}

.left-pane {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.right-pane {
    flex: 3;
    background: #fafafa;
}

.q-page-header {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.q-page-header h1 {
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 500;
}

.q-page-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.q-tags {
    font-size: 13px;
    color: var(--text-secondary);
}

.content-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Content Styling */
/* Let highlight.js handle PRE blocks but keep margins/border-radius */
.html-content pre,
pre {
    margin: 16px 0;
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    /* Remove padding/background so highlight.js themes take full control of the inner block */
}

/* We still want padding inside the code block */
.html-content pre code,
pre code {
    padding: 16px !important;
}

/* Specific inline code styling */
.html-content p code,
.html-content li code {
    background: var(--hover-bg);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: #c7254e;
}

.html-content p {
    margin-bottom: 12px;
}

.html-content ul {
    margin-left: 24px;
    margin-bottom: 16px;
}

.mt-4 {
    margin-top: 16px;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--hover-bg);
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    font-size: 12px;
    color: var(--text-secondary);
    font-family: monospace;
}

.code-header+pre {
    border-radius: 0 0 8px 8px;
    margin-top: 0;
}

.copy-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: var(--border-color);
}

/* Hide giant SVG links often found in LeetCode solutions */
.html-content a[href^="#"],
.html-content a[aria-hidden="true"],
.html-content .svg-inline--fa,
.html-content svg {
    display: none !important;
}

.html-content img,
.html-content iframe,
.html-content video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

/* ============================================================
   QUESTION PAGE — Full Redesign
   ============================================================ */

.q-body {
    background: #f5f7fa;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top navigation bar */
.q-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 52px;
    background: #fff;
    border-bottom: 1px solid #e8eaed;
    flex-shrink: 0;
    gap: 16px;
    z-index: 10;
}

.q-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
}

.q-back-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.q-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.q-nav-arrows {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.q-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-family);
}

.q-nav-btn:hover:not(:disabled) {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: #bbb;
}

.q-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.q-nav-label {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 48px;
    text-align: center;
}

/* Main split layout */
.q-split-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 16px;
    gap: 0;
}

/* The thin divider line between panes */
.q-divider {
    width: 1px;
    background: #e0e3e8;
    flex-shrink: 0;
    margin: 0 12px;
    align-self: stretch;
}

/* Individual panes */
.q-pane {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eaecef;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.07);
    padding: 0;
    display: flex;
    flex-direction: column;
}

.q-left-pane {
    flex: 2;
}

.q-right-pane {
    flex: 3;
    background: #fafbfc;
}

/* Problem header inside left pane */
.q-problem-header {
    padding: 24px 28px 18px;
    border-bottom: 1px solid #f0f2f5;
    background: linear-gradient(to bottom, #fff 0%, #fafbfc 100%);
    border-radius: 10px 10px 0 0;
}

.q-problem-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.q-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.q-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.q-tag-badge {
    font-size: 11px;
    font-weight: 500;
    color: #5f6368;
    background: #f1f3f4;
    border: 1px solid #e0e3e8;
    border-radius: 12px;
    padding: 2px 9px;
    letter-spacing: 0.01em;
    transition: background 0.15s;
}

/* Clickable tag variant */
a.q-tag-link {
    text-decoration: none;
    cursor: pointer;
}

a.q-tag-link:hover {
    background: #e3eafd;
    border-color: #aac4f5;
    color: var(--google-blue);
}


/* Sections within panes */
.q-section {
    padding: 24px 28px;
    flex: 1;
}

.q-starter-section {
    padding-top: 0;
    flex: none;
}

/* Section label (small header with icon) */
.q-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #80868b;
    margin-bottom: 18px;
}

.q-section-label svg {
    color: #9aa0a6;
    flex-shrink: 0;
}

/* Description content tweaks */
.q-description-content p:first-child {
    margin-top: 0;
}

/* Enhanced example blocks inside description */
.q-description-content pre,
.q-right-pane .html-content pre {
    border-radius: 8px;
    overflow-x: auto;
}

/* Solution content h3, h4 get visual separation */
.q-solution-content h3,
.q-solution-content h2 {
    color: var(--text-primary);
    font-weight: 500;
    margin: 22px 0 8px;
    font-size: 15px;
}

.q-solution-content h3:first-child,
.q-solution-content h2:first-child {
    margin-top: 0;
}

.q-solution-content hr {
    border: none;
    border-top: 1px solid #eaecef;
    margin: 24px 0;
}

/* Code header (left pane) */
.code-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 4px 9px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font-family);
    color: var(--text-secondary);
    transition: all 0.15s;
}

.copy-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: #bbb;
}

/* Scrollbar styling inside panes */
.q-pane::-webkit-scrollbar {
    width: 6px;
}

.q-pane::-webkit-scrollbar-track {
    background: transparent;
}

.q-pane::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 4px;
}

.q-pane::-webkit-scrollbar-thumb:hover {
    background: #bec1c6;
}

/* ── Draggable Resize Handle ────────────────────────────── */
.q-resize-handle {
    flex-shrink: 0;
    width: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: col-resize;
    position: relative;
    z-index: 5;
    margin: 0 4px;
    border-radius: 4px;
    transition: background 0.15s;
}

.q-resize-handle:hover,
.q-resizing .q-resize-handle {
    background: rgba(66, 133, 244, 0.08);
}

.q-resize-dots {
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
}

.q-resize-dots span {
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #c0c4cc;
    transition: background 0.15s;
}

.q-resize-handle:hover .q-resize-dots span,
.q-resizing .q-resize-dots span {
    background: var(--google-blue);
}

/* Prevent text selection while dragging */
.q-resizing {
    user-select: none;
    cursor: col-resize !important;
}

.q-resizing * {
    pointer-events: none;
}

.q-resizing .q-resize-handle {
    pointer-events: auto;
}