:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #12121f;
    --bg-tertiary: #1a1a2e;
    --bg-card: #1e1e33;
    
    --accent-primary: #a78bfa;
    --accent-secondary: #c4b5fd;
    --accent-glow: #8b5cf6;
    
    --text-primary: #f0f0f5;
    --text-secondary: #c0c0d0;
    --text-tertiary: #9090a8;
    
    --border: #2d2e48;
    --border-glow: #4040 5e;
    
    --pink: #f0abfc;
    --blue: #93c5fd;
    --green: #86efac;
    --yellow: #fde68a;
    --orange: #fdba74;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
}

/* Header with Image */
header {
    margin-bottom: 3.5rem;
    animation: fadeInDown 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2.5rem;
}

.header-text {
    flex: 1;
}

.header-text h1 {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa 0%, #f0abfc 50%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
    filter: drop-shadow(0 0 40px rgba(167, 139, 250, 0.5));
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.description {
    font-size: 1.1rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

.header-doodle {
    max-width: 280px;
    max-height: 280px;
    object-fit: contain;
    border-radius: 20px;
    padding: 0;
    border: none;
    transition: transform 0.3s ease;
}

.header-doodle:hover {
    animation: gentleBounce 1.5s ease-in-out;
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(2deg); }
    50% { transform: translateY(-15px) rotate(-1deg); }
    75% { transform: translateY(-8px) rotate(1deg); }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-box {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-primary);
    pointer-events: none;
    filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.5));
}

.search-box input {
    width: 100%;
    padding: 1.125rem 1.5rem 1.125rem 3.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 18px;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.15), 0 8px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.search-box input::placeholder {
    color: var(--text-tertiary);
}

.filter-box {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    min-width: 320px;
}

.filter-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-secondary);
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.3);
}

.rating-inputs {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.rating-inputs input {
    flex: 1;
    padding: 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.rating-inputs input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15), 0 6px 20px rgba(0, 0, 0, 0.3);
}

.rating-inputs span {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 1.1rem;
}

.filter-buttons {
    display: flex;
    gap: 0.875rem;
}

.filter-buttons button {
    flex: 1;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-glow));
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: inherit;
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.filter-buttons button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(167, 139, 250, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.filter-buttons button:active {
    transform: translateY(-1px);
}

#resetBtn {
    background: var(--bg-card);
    border: 2px solid var(--border-glow);
    color: var(--text-secondary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#resetBtn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.2);
}

/* Table Container */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 2rem;
}

.table-container {
    background: var(--bg-secondary);
    border: 2px solid var(--border-glow);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(167, 139, 250, 0.1);
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s both;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

thead {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-card));
    border-bottom: 2px solid var(--border-glow);
}

thead th {
    padding: 1.5rem 1.75rem;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.3);
}

.col-code {
    width: 10%;
}

.col-name {
    width: 50%;
}

.col-rating {
    width: 15%;
}

.col-action {
    width: 25%;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--bg-card);
    box-shadow: inset 0 0 30px rgba(167, 139, 250, 0.08);
    transform: scale(1.01);
}

tbody td {
    padding: 1.75rem 1.75rem;
    font-size: 1.05rem;
}

tbody td:first-child {
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.problem-name-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.problem-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.15rem;
}

.problem-rating-cell {
    font-family: 'JetBrains Mono', monospace;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.05rem;
    filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.5));
}

.show-code-btn {
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-glow));
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: inherit;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.show-code-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(167, 139, 250, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.show-code-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2.5rem;
    padding: 1.75rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-glow);
    border-radius: 20px;
    gap: 1.25rem;
    flex-wrap: wrap;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.page-btn {
    padding: 0.875rem 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-glow);
    border-radius: 14px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(167, 139, 250, 0.3);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
    justify-content: center;
}

.page-num {
    min-width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'JetBrains Mono', monospace;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-num:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.page-num.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-glow));
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.page-jump {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.page-jump span {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 700;
}

.page-jump input {
    width: 90px;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-jump input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15), 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-jump button {
    padding: 0.75rem 1.25rem;
    background: var(--accent-primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(167, 139, 250, 0.4);
}

.page-jump button:hover {
    background: var(--accent-glow);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.5);
}

/* Footer Images */
.footer-image-container {
    margin-top: 4.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 1.2s ease-out 1s both;
}

.footer-image {
    max-width: 400px;
    max-height: 330px;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
}

.footer-image-caption {
    margin-top: 0.80rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #c0c0c0;  /* Silver color */
    text-shadow: 0 0 10px rgba(192, 192, 192, 0.3);
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* No Results */
.no-results {
    padding: 4.5rem 2rem;
    text-align: center;
    color: var(--text-tertiary);
}

.no-results svg {
    margin-bottom: 1.75rem;
    opacity: 0.7;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.5));
}

.no-results p {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Problem Detail Page */
.problem-page .container {
    max-width: 950px;
}

.problem-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    gap: 1.25rem;
    animation: fadeInDown 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-controls {
    display: flex;
    gap: 0.875rem;
}

.nav-btn {
    padding: 1rem 1.75rem;
    background: var(--bg-card);
    border: 2px solid var(--border-glow);
    border-radius: 14px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-btn:hover:not(:disabled) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(167, 139, 250, 0.3);
}

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

.problem-detail {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.problem-header-detail {
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

.problem-code-detail {
    font-family: 'JetBrains Mono', monospace;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    font-size: 1rem;
    color: var(--accent-primary);
    font-weight: 700;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

.problem-title-detail {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    line-height: 1.2;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.problem-rating-detail {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(240, 171, 252, 0.2));
    border: 2px solid var(--accent-primary);
    border-radius: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 1.1rem;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hint-section,
.code-section,
.complexity-section,
.explanation-section {
    background: var(--bg-card);
    border: 2px solid var(--border-glow);
    border-radius: 24px;
    padding: 2.25rem;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(167, 139, 250, 0.1);
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.hint-section { animation-delay: 0.3s; }
.code-section { animation-delay: 0.4s; }
.complexity-section { animation-delay: 0.5s; }
.explanation-section { animation-delay: 0.6s; }

.section-label {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    display: block;
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.3);
}

.hint-section p,
.explanation-section p {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-secondary);
    white-space: pre-line;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.language-selector select {
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-glow);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.language-selector select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15), 0 6px 20px rgba(0, 0, 0, 0.3);
}

.copy-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-glow);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.copy-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.2);
}

.copy-btn.copied {
    background: var(--green);
    color: var(--bg-primary);
    border-color: var(--green);
    box-shadow: 0 6px 20px rgba(134, 239, 172, 0.4);
}

.code-wrapper {
    background: #16161e;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid var(--border);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
}

.code-wrapper pre {
    margin: 0;
    padding: 2rem;
    overflow-x: auto;
}

.code-wrapper code {
    font-family: 'JetBrains Mono', monospace !important;
    font-variant-ligatures: none !important;
    font-feature-settings: "liga" 0, "calt" 0 !important;
    font-size: 1rem !important;
    line-height: 1.8 !important;
}

.complexity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
}

.complexity-item {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(167, 139, 250, 0.1);
}

.complexity-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.complexity-value {
    font-family: 'JetBrains Mono', monospace;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.3);
}

.problem-footer-image-container {
    margin-top: 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 1.2s ease-out 1.2s both;
}

.problem-footer-image {
    max-width: 400px;
    max-height: 400px;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
}

.problem-footer-image-caption {
    margin-top: -1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #c0c0c0;  /* Silver color */
    text-shadow: 0 0 10px rgba(192, 192, 192, 0.3);
}
/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .container {
        padding: 2.5rem 1.75rem;
    }

    .header-text h1 {
        font-size: 3.25rem;
    }

    .header-doodle {
        max-width: 220px;
        max-height: 220px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 2rem 1.25rem;
    }

    .header-content {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        gap: 1.5rem;
    }

    .header-text h1 {
        font-size: 2.75rem;
    }

    .subtitle {
        font-size: 1.3rem;
    }

    .header-doodle {
        max-width: 140px;
        max-height: 140px;
        flex-shrink: 0;
    }

    .controls {
        flex-direction: column;
        gap: 1.75rem;
    }

    .search-box,
    .filter-box {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .rating-inputs {
        gap: 0.5rem;
    }

    .rating-inputs input {
        flex: 1;
        min-width: 0;
        padding: 0.875rem 0.75rem;
    }

    /* Mobile: flat list design - NO FLOATS */
    .table-wrapper {
        overflow-x: visible;
        padding: 0 1rem;
    }

    .table-container {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    table {
        display: block;
    }

    thead {
        display: none;
    }

    tbody {
        display: block;
    }

    tbody tr {
        display: block;
        padding: 1.25rem 0;
        margin-bottom: 0;
        border: none;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        transition: background 0.2s ease;
    }

    tbody tr:hover {
        background: rgba(167, 139, 250, 0.03);
        transform: none !important;
    }

    tbody tr:last-child {
        border-bottom: none;
    }

    tbody td {
        display: block;
        padding: 0;
        border: none;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Row 1: Code and Rating on same line with flexbox */
    tbody td:first-child {
        display: inline-block;
        font-size: 0.9rem;
        font-weight: 700;
        color: var(--accent-primary);
        margin-bottom: 0.6rem;
        width: auto !important;
    }

    tbody td:nth-child(3) {
        display: inline-block;
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--accent-primary);
        margin-bottom: 0.6rem;
        margin-left: auto;
        width: auto !important;
    }

    /* Make row 1 flex with proper width constraints */
    tbody tr {
        display: flex;
        flex-wrap: wrap;
        max-width: calc(100vw - 4rem) !important;
    }

    tbody td:first-child {
        order: 1;
    }

    tbody td:nth-child(3) {
        order: 2;
        margin-left: auto;
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--accent-primary);
        margin-bottom: 0.6rem;
        width: auto !important;
        margin-right: 0.5rem !important;
        text-align: right;
    }

    /* Row 2: Problem name */
    tbody td:nth-child(2) {
        order: 3;
        width: 100% !important;
        margin-bottom: 0.6rem;
    }

    .problem-name-cell {
        margin: 0;
    }

    .problem-name {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-primary);
        line-height: 1.3;
    }

    .problem-rating-cell {
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--accent-primary);
    }

    /* Row 3: Button (right-aligned with strict width control) */
    tbody td:nth-child(4) {
        order: 4;
        width: 100% !important;
        max-width: calc(100vw - 4rem) !important;
        display: flex !important;
        justify-content: flex-end !important;
        overflow: visible !important;
        position: relative !important;
        padding-right: 1rem !important;
    }

    tbody tr .show-code-btn {
        padding: 0.5rem 0.9rem !important;
        font-size: 0.8rem !important;
        font-weight: 600;
        display: inline-block !important;
        border-radius: 18px;
        background: linear-gradient(135deg, var(--accent-primary), var(--pink)) !important;
        color: white !important;
        border: none !important;
        box-shadow: 0 2px 8px rgba(167, 139, 250, 0.3);
        white-space: nowrap;
        max-width: 100% !important;
        position: relative !important;
        right: 0 !important;
        margin-right: 0.5rem !important;
    }

    tbody tr .show-code-btn::after {
        content: '→';
        font-size: 0.95rem;
    }

    tbody tr .show-code-btn:active {
        transform: scale(0.97);
    }

    .pagination {
        flex-direction: column;
        gap: 1.25rem;
    }

    .page-btn .btn-text {
        display: none;
    }

    .page-numbers {
        order: 1;
        width: 100%;
    }

    .page-jump {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .footer-image {
        max-width: 250px;
        max-height: 250px;
    }

    .problem-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-controls {
        width: 100%;
    }

    .nav-btn {
        flex: 1;
    }

    .problem-title-detail {
        font-size: 2.25rem;
    }

    .complexity-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .language-selector {
        width: 100%;
    }

    .language-selector select {
        flex: 1;
    }

    .problem-footer-image {
        max-width: 280px;
        max-height: 320px;
    }
}

@media (max-width: 480px) {
    .header-text h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .description {
        font-size: 0.95rem;
    }

    .header-doodle {
        max-width: 100px;
        max-height: 100px;
    }

    tbody tr {
        padding: 1rem 0;
    }

    tbody td:first-child {
        font-size: 0.85rem;
    }

    .problem-name {
        font-size: 1.05rem;
    }

    .show-code-btn {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }

    .footer-image {
        max-width: 280px;
        max-height: 150px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--border), var(--border-glow));
    border-radius: 7px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--border-glow), var(--accent-primary));
}

/* Footer */
.site-footer {
    margin-top: 5rem;
    padding: 2.5rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.footer-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.footer-text a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-text a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.footer-author {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.footer-author a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-author a:hover {
    color: var(--accent-primary);
}

/* Documentation Page */
.docs-page {
    background: var(--bg-primary);
}

.docs-layout {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.docs-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-secondary);
    border-right: 2px solid var(--border);
    padding: 2rem 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.back-home-btn {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 2px solid var(--border-glow);
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.back-home-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    transform: translateX(-3px);
}

.sidebar-nav h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.625rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.sidebar-nav a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding-left: 1.25rem;
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.15), rgba(240, 171, 252, 0.15));
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
}

.docs-content {
    flex: 1;
    padding: 3rem 4rem;
    max-width: 900px;
}

.docs-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

.docs-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.docs-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.doc-section {
    margin-bottom: 4rem;
    scroll-margin-top: 2rem;
}

.doc-section h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.doc-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.doc-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.doc-section ul,
.doc-section ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.doc-section li {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.doc-section code {
    font-family: 'JetBrains Mono', monospace;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.95em;
    color: var(--accent-primary);
}

.doc-section pre {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.doc-section pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.doc-section a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.doc-section a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.doc-section strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Documentation Mobile */
@media (max-width: 1024px) {
    .docs-layout {
        flex-direction: column;
    }

    .docs-sidebar {
        width: 100%;
        min-width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 2px solid var(--border);
    }

    .docs-content {
        padding: 2rem 2rem;
        max-width: 100%;
    }

    .docs-header h1 {
        font-size: 2.5rem;
    }

    .docs-subtitle {
        font-size: 1.1rem;
    }

    .doc-section h2 {
        font-size: 1.75rem;
    }

    .doc-section h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .docs-content {
        padding: 1.5rem 1rem;
    }

    .docs-header h1 {
        font-size: 2rem;
    }

    .doc-section {
        margin-bottom: 3rem;
    }
}
