:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --dark: #0f172a;
    --nav-bg: #020617;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-light: #64748b;
    --border: #cbd5e1;
}

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    margin: 0;
    color: var(--text);
    line-height: 1.6;
}

nav {
    background: var(--nav-bg);
    padding: 0 5%;
    height: 60px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.brand-logo svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.nav-links {
    position: absolute;
    left: 5%;
    display: flex;
    gap: 2px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 6px 12px;
    border-radius: 6px;
    letter-spacing: 0.01em;
    transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.07);
}

.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.nav-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-btn {
    padding: 7px 17px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.nav-btn.primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: transparent;
    color: white;
    border-radius: 999px;
    padding: 6px 15px 6px 11px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(37, 99, 235, 0.5);
    display: inline-flex;
    align-items: center;
}

.nav-btn.primary::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 7px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") no-repeat center / contain;
}

.nav-btn.primary:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.45), 0 0 0 1px rgba(59, 130, 246, 0.6);
    transform: translateY(-1px);
}

.nav-btn.hidden {
    display: none;
}


header {
    background-color: var(--dark);
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 22px 22px;
    color: white;
    padding: 68px 5% 90px;
    text-align: center;
    border-bottom: 3px solid var(--primary);
}

header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.15;
}

header p {
    margin: 0;
    color: #94a3b8;
    font-size: 1.05rem;
}


.controls-wrapper {
    background: white;
    position: sticky;
    top: 60px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 16px 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border);
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
}

.filter-btn {
    padding: 7px 18px;
    border: 1.5px solid var(--border);
    background: white;
    color: var(--text-light);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.4;
    font-family: inherit;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

#difficultyBar {
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.difficulty-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid;
    border-radius: 25px;
    padding: 4px 6px 4px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    animation: diffIn 0.18s ease;
}

.difficulty-indicator.hidden { display: none !important; }

.difficulty-indicator[data-diff="Beginner"]     { color: #16a34a; border-color: #86efac; background: #dcfce7; }
.difficulty-indicator[data-diff="Intermediate"] { color: #d97706; border-color: #fcd34d; background: #fef9c3; }
.difficulty-indicator[data-diff="Advanced"]     { color: #dc2626; border-color: #fca5a5; background: #fee2e2; }

@keyframes diffIn {
    from { opacity: 0; transform: scale(0.88); }
    to   { opacity: 1; transform: scale(1); }
}

.diff-indicator-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.08);
    color: inherit;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s;
}

.diff-indicator-clear:hover { background: rgba(0,0,0,0.15); }
.diff-indicator-clear svg { width: 11px; height: 11px; }

html.dark-mode .difficulty-indicator[data-diff="Beginner"]     { color: #4ade80; border-color: #166534; background: #052e16; }
html.dark-mode .difficulty-indicator[data-diff="Intermediate"] { color: #fbbf24; border-color: #78350f; background: #1c0f00; }
html.dark-mode .difficulty-indicator[data-diff="Advanced"]     { color: #f87171; border-color: #7f1d1d; background: #1a0000; }

.difficulty-btn {
    padding: 5px 14px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border-width: 1.5px;
}

.difficulty-btn[data-diff="All"]          { color: var(--text-light); }
.difficulty-btn[data-diff="Beginner"]     { color: #16a34a; border-color: #bbf7d0; background: #f0fdf4; }
.difficulty-btn[data-diff="Intermediate"] { color: #d97706; border-color: #fde68a; background: #fffbeb; }
.difficulty-btn[data-diff="Advanced"]     { color: #dc2626; border-color: #fecaca; background: #fef2f2; }

.difficulty-btn[data-diff="All"]:hover          { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.difficulty-btn[data-diff="Beginner"]:hover     { background: #dcfce7; border-color: #86efac; }
.difficulty-btn[data-diff="Intermediate"]:hover { background: #fef9c3; border-color: #fcd34d; }
.difficulty-btn[data-diff="Advanced"]:hover     { background: #fee2e2; border-color: #fca5a5; }

.difficulty-btn.active[data-diff="All"]          { background: var(--primary); border-color: var(--primary); color: white; }
.difficulty-btn.active[data-diff="Beginner"]     { background: #16a34a; border-color: #16a34a; color: white; }
.difficulty-btn.active[data-diff="Intermediate"] { background: #d97706; border-color: #d97706; color: white; }
.difficulty-btn.active[data-diff="Advanced"]     { background: #dc2626; border-color: #dc2626; color: white; }

.search-bar {
    width: 100%;
    max-width: 480px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 11px 16px 11px 42px;
    border-radius: 25px;
    border: 1.5px solid var(--border);
    background: #f8fafc;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--dark);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
    outline: none;
}

.search-bar input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    z-index: 500;
    overflow: hidden;
}

.search-dropdown.hidden { display: none; }

.sd-section-label {
    padding: 8px 14px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-light);
}

.sd-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    text-decoration: none;
    gap: 10px;
    transition: background 0.15s;
}

.sd-item:hover { background: #f1f5f9; }

.sd-item-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-item-meta {
    font-size: 0.75rem;
    color: var(--text-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.sd-see-all {
    display: block;
    padding: 9px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    border-top: 1px solid var(--border);
    transition: background 0.15s;
}

.sd-see-all:hover { background: var(--primary-light); }

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    width: 17px;
    height: 17px;
    pointer-events: none;
}


.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 40px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
    border-color: #c7d9fc;
}

.card-img {
    height: 200px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.9rem;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.card:hover .card-img img {
    transform: scale(1.04);
}

.card-content {
    padding: 20px 22px 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.tag-container {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.category-tag {
    font-size: 0.68rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 0.04em;
}

.difficulty-tag {
    font-size: 0.68rem;
    background: #f1f5f9;
    border: 1px solid var(--border);
    color: #475569;
    padding: 2px 9px;
    border-radius: 12px;
    font-weight: 600;
}

.card-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--dark);
    line-height: 1.3;
}

.card-content p {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.55;
    margin: 0;
    flex-grow: 1;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-light);
    padding: 60px 20px;
    font-size: 1.05rem;
}

.modal {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.75);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    transition: color 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: inherit;
    font-size: 0.95rem;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-tab:hover {
    color: var(--dark);
}

.fixed-area {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text);
}

.fixed-area:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-solid {
    padding: 11px 20px;
    background: var(--primary);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    font-size: 0.9rem;
}

.btn-solid:hover {
    background: var(--primary-dark);
}

.btn-solid:active {
    transform: scale(0.98);
}

.btn-danger {
    padding: 11px 20px;
    background: #ef4444;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    font-family: inherit;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: #dc2626;
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    text-decoration: underline;
    font-size: inherit;
    transition: color 0.15s;
}

.link-btn:hover {
    color: var(--primary-dark);
}

.hidden {
    display: none !important;
}

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--dark);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    animation: toast-in 0.25s ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.account-modal-content {
    max-width: 400px;
    width: 90%;
    padding: 0;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    max-height: min(640px, 90vh);
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.07);
    background: #fff;
}

.acct-panels-wrapper {
    position: relative;
}

.acct-main {
    display: flex;
    flex-direction: column;
    background: #fff;
    min-height: 0;
    flex: 1;
    overflow-y: auto;
}


.acct-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid #e8edf5;
    background: linear-gradient(135deg, #eef4ff 0%, #f8faff 100%);
}

.acct-avatar {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}

.acct-avatar svg {
    width: 22px;
    height: 22px;
    stroke: white;
}

.acct-header-info {
    flex: 1;
    min-width: 0;
}

.acct-display-name {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.acct-email {
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.acct-close-btn {
    background: rgba(0,0,0,0.05);
    border: none;
    cursor: pointer;
    color: #64748b;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    flex-shrink: 0;
    font-family: inherit;
}

.acct-close-btn svg { width: 15px; height: 15px; }
.acct-close-btn:hover { background: rgba(0,0,0,0.1); color: #0f172a; }

.verify-email-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    background: #fff7ed;
    border-bottom: 1px solid #fed7aa;
    font-size: 0.82rem;
    color: #9a3412;
    font-weight: 500;
}

.verify-email-box.hidden { display: none !important; }

.acct-menu {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    gap: 2px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: #fff;
}

.acct-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 12px;
    background: none;
    border: none;
    border-bottom: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    border-radius: 12px;
}

.acct-menu-item:hover { background: #f1f5f9; }
.acct-menu-item:active { background: #e2e8f0; }

.acct-menu-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.acct-menu-icon svg {
    width: 17px;
    height: 17px;
    stroke: #4f46e5;
}

.acct-menu-item:hover .acct-menu-icon { background: #e0e7ff; }

.acct-menu-danger .acct-menu-icon { background: #fef2f2; }
.acct-menu-danger .acct-menu-icon svg { stroke: #ef4444; }
.acct-menu-danger .acct-menu-title { color: #dc2626; }
.acct-menu-danger:hover { background: #fff5f5; }
.acct-menu-danger:hover .acct-menu-icon { background: #fee2e2; }

.acct-menu-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.acct-menu-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.acct-menu-sub {
    font-size: 0.75rem;
    color: #94a3b8;
}

.acct-chevron {
    width: 15px;
    height: 15px;
    stroke: #c7d2e0;
    flex-shrink: 0;
}

.acct-footer {
    padding: 10px 20px 16px;
    border-top: 1px solid #e8edf5;
    flex-shrink: 0;
}

.acct-signout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: inherit;
    justify-content: center;
}

.acct-signout-btn svg { width: 16px; height: 16px; stroke: currentColor; }
.acct-signout-btn:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }

.acct-sub-panel {
    display: none;
    flex-direction: column;
    background: #fff;
}

.acct-sub-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid #e8edf5;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    background: linear-gradient(135deg, #eef4ff 0%, #f8faff 100%);
    flex-shrink: 0;
}

.acct-back-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(0,0,0,0.06);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
    flex-shrink: 0;
    font-family: inherit;
}

.acct-back-btn svg { width: 15px; height: 15px; stroke: #475569; }
.acct-back-btn:hover { background: rgba(0,0,0,0.12); }

.acct-sub-body {
    padding: 20px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.acct-sub-desc {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 4px;
    line-height: 1.5;
}

.acct-field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: -4px;
}

.acct-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #dde3ed;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    color: #0f172a;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
    outline: none;
}

.acct-input:focus {
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.acct-submit-btn {
    width: 100%;
    margin-top: 4px;
    padding: 11px;
    font-size: 0.9rem;
}

.acct-danger-box {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 14px;
    color: #991b1b;
    font-size: 0.85rem;
    line-height: 1.55;
}

.acct-danger-box svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: #dc2626;
    margin-top: 1px;
}

.acct-danger-box p { margin: 0; }

.theme-toggle {
    display: flex;
    gap: 10px;
}

.theme-btn {
    flex: 1;
    padding: 16px 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.theme-btn:hover {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.theme-icon { width: 24px; height: 24px; stroke: currentColor; }
.theme-btn-light { background: linear-gradient(135deg, #f8fafc, #eef4ff); color: #0f172a; }
.theme-btn-dark  { background: linear-gradient(135deg, #1e293b, #0f172a); color: #f1f5f9; }


html.dark-mode {
    --bg: #0f172a;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --border: #334155;
    --card-bg: #1e293b;
}

html.dark-mode body {
    background: var(--bg);
    color: var(--text);
}

html.dark-mode .controls-wrapper {
    background: #1e293b;
    border-color: var(--border);
}

html.dark-mode .filter-btn {
    background: #1e293b;
    border-color: var(--border);
    color: var(--text-light);
}

html.dark-mode .filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

html.dark-mode .filter-btn:hover:not(.active) {
    background: #162032;
    color: #93c5fd;
    border-color: #1e3a5f;
}

html.dark-mode #difficultyBar { border-color: var(--border); }
html.dark-mode .difficulty-btn[data-diff="Beginner"]     { color: #4ade80; border-color: #166534; background: #052e16; }
html.dark-mode .difficulty-btn[data-diff="Intermediate"] { color: #fbbf24; border-color: #78350f; background: #1c0f00; }
html.dark-mode .difficulty-btn[data-diff="Advanced"]     { color: #f87171; border-color: #7f1d1d; background: #1a0000; }
html.dark-mode .difficulty-btn[data-diff="Beginner"]:hover     { background: #14532d; border-color: #15803d; }
html.dark-mode .difficulty-btn[data-diff="Intermediate"]:hover { background: #451a03; border-color: #b45309; }
html.dark-mode .difficulty-btn[data-diff="Advanced"]:hover     { background: #450a0a; border-color: #b91c1c; }

html.dark-mode .search-dropdown { background: #1e293b; border-color: #334155; box-shadow: 0 12px 32px rgba(0,0,0,0.4); }
html.dark-mode .sd-item:hover { background: #162032; }
html.dark-mode .sd-item-name { color: #e2e8f0; }
html.dark-mode .sd-see-all { border-color: #334155; }
html.dark-mode .sd-see-all:hover { background: #162032; }

html.dark-mode .search-bar input {
    background: #0f172a;
    border-color: var(--border);
    color: var(--text);
}

html.dark-mode .search-bar input:focus {
    background: #162032;
}

html.dark-mode .card {
    border-color: var(--border);
}

html.dark-mode .card:hover {
    border-color: #334155;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

html.dark-mode .card-content h3 {
    color: var(--text);
}

html.dark-mode .difficulty-tag {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

html.dark-mode .modal-content {
    background: #1e293b;
    color: var(--text);
}

html.dark-mode .account-modal-content { background: #151f2e; }
html.dark-mode .acct-main { background: #151f2e; }
html.dark-mode .acct-header { background: linear-gradient(135deg, #1a2540 0%, #1e293b 100%); border-color: #2a3a52; }
html.dark-mode .acct-display-name { color: #f1f5f9; }
html.dark-mode .acct-email { color: #7a8fa8; }
html.dark-mode .acct-close-btn { color: #7a8fa8; }
html.dark-mode .acct-close-btn:hover { background: rgba(255,255,255,0.1); color: #f1f5f9; }

html.dark-mode .acct-menu { background: #151f2e; }
html.dark-mode .acct-menu-item { border: none; border-bottom: none; }
html.dark-mode .acct-menu-item:hover { background: #1e2d42; }
html.dark-mode .acct-menu-item:active { background: #243352; }
html.dark-mode .acct-menu-icon { background: #1e2d42; }
html.dark-mode .acct-menu-icon svg { stroke: #818cf8; }
html.dark-mode .acct-menu-item:hover .acct-menu-icon { background: #2a3c58; }
html.dark-mode .acct-menu-title { color: #e2e8f0; }
html.dark-mode .acct-menu-sub { color: #566880; }
html.dark-mode .acct-chevron { stroke: #3a4f68; }
html.dark-mode .acct-footer { border-color: #2a3a52; }
html.dark-mode .acct-signout-btn { background: #1e2d42; border-color: #2a3a52; color: #7a8fa8; }
html.dark-mode .acct-signout-btn:hover { background: #3d1a1a; border-color: #7c2d2d; color: #f87171; }
html.dark-mode .acct-sub-panel { background: #151f2e; }html.dark-mode .acct-sub-header { background: linear-gradient(135deg, #1a2540 0%, #1e293b 100%); color: #f1f5f9; border-color: #2a3a52; }
html.dark-mode .acct-back-btn { background: rgba(255,255,255,0.07); }
html.dark-mode .acct-back-btn svg { stroke: #94a3b8; }
html.dark-mode .acct-back-btn:hover { background: rgba(255,255,255,0.13); }
html.dark-mode .acct-field-label { color: #94a3b8; }
html.dark-mode .acct-input { background: #0f172a; border-color: #2a3a52; color: #e2e8f0; }
html.dark-mode .acct-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.18); background: #111827; }
html.dark-mode .acct-danger-box { background: #1a0a0a; border-color: #5c1d1d; color: #fca5a5; }
html.dark-mode .acct-danger-box svg { stroke: #f87171; }
html.dark-mode .acct-menu-danger .acct-menu-icon { background: #2d1010; }
html.dark-mode .acct-menu-danger .acct-menu-icon svg { stroke: #f87171; }
html.dark-mode .acct-menu-danger .acct-menu-title { color: #f87171; }
html.dark-mode .acct-menu-danger:hover { background: #1f0d0d; }
html.dark-mode .acct-menu-danger:hover .acct-menu-icon { background: #3d1616; }
html.dark-mode .verify-email-box { background: #2a1a08; border-color: #7c4d12; color: #fbbf72; }
html.dark-mode .theme-btn { border-color: #2a3a52; }
html.dark-mode .theme-btn:hover { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
html.dark-mode .theme-btn-light { background: linear-gradient(135deg, #2a3a52, #334155); color: #cbd5e1; }
html.dark-mode .theme-btn-dark { background: linear-gradient(135deg, #334155, #475569); color: #e2e8f0; }


@media (max-width: 768px) {
    nav {
        height: auto;
        flex-direction: column;
        gap: 10px;
        padding: 12px 5%;
    }

    .brand-logo {
        position: static;
        transform: none;
    }

    .nav-links { position: static; }

    .nav-buttons {
        width: 100%;
        justify-content: center;
    }

    header {
        padding: 48px 5% 72px;
    }

    header h1 {
        font-size: 1.85rem;
    }

    /* Remove sticky so nav and controls don't overlap when scrolling */
    .controls-wrapper {
        position: static;
    }

    .project-grid {
        grid-template-columns: 1fr;
        padding: 24px 5%;
        gap: 16px;
    }

    /* Prevent iOS Safari from zooming on input focus */
    .fixed-area, .acct-input { font-size: 1rem; }
}

@media (max-width: 480px) {
    header h1 { font-size: 1.55rem; }
    .project-grid { padding: 16px 4%; }
}
