@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

html { scroll-behavior: smooth; }

:root {
    --brand:        #F98900;
    --brand-dark:   #d97400;
    --brand-light:  rgba(249, 137, 0, 0.12);
    --slate: #6f7174;
    --slate-dark:   #2a3238;
    --slate-light:  rgba(57, 68, 74, 0.08);

    --app-radius:   1.25rem;
    --app-radius-sm: 0.75rem;
    --app-shadow:   0 1rem 2.5rem rgba(57, 68, 74, 0.12);
    --app-shadow-soft: 0 0.5rem 1.5rem rgba(57, 68, 74, 0.07);
    --app-border:   rgba(57, 68, 74, 0.1);

    /* Override Bootstrap blue with brand */
    --bs-primary: #F98900;
    --bs-primary-rgb: 249, 137, 0;
    --bs-link-color: #F98900;
    --bs-link-hover-color: #d97400;
}

/* ── Base ── */
body {
    font-family: 'Inter', Arial, sans-serif;
    background:
        radial-gradient(circle at 15% 0%, rgba(249,137,0,.05) 0%, transparent 35%),
        radial-gradient(circle at 85% 5%, rgba(57,68,74,.04) 0%, transparent 30%),
        #f5f6f7;
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
}

/* ── Bootstrap overrides ── */
.btn-primary {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}
.btn-outline-primary {
    color: var(--brand);
    border-color: var(--brand);
}
.btn-outline-primary:hover {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.border-primary { border-color: var(--brand) !important; }
.text-bg-primary { background-color: var(--brand) !important; color: #fff !important; }

.form-control:focus, .form-select:focus {
    border-color: rgba(249, 137, 0, 0.4);
    box-shadow: 0 0 0 0.25rem rgba(249, 137, 0, 0.15);
}

/* ── Navbar ── */
.app-navbar {
    background: #fff;
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 1px 8px rgba(57,68,74,.06);
}

.navbar-brand-logo {
    font-weight: 800;
    font-size: 1.75rem;
    color: var(--slate);
    letter-spacing: -0.02em;
}
.navbar-brand-logo span {
    color: var(--brand);
}
.navbar-brand-logo:hover { color: var(--slate); }

.navbar-search {
    background: #f3f4f6;
    border-radius: 20px;
    overflow: hidden;
    width: 260px;
    transition: width .2s, box-shadow .2s;
}
.navbar-search:focus-within {
    width: 340px;
    box-shadow: 0 0 0 2px var(--brand-light);
}
.navbar-search .form-control {
    font-size: .875rem;
    color: var(--slate-dark);
    padding: .35rem .75rem;
}
.navbar-search .form-control::placeholder { color: #9ca3af; }
.navbar-search .form-control:focus { box-shadow: none; }
.navbar-search .btn { color: #9ca3af; }
.navbar-search .btn:hover { color: var(--brand); }

@media (max-width: 991.98px) {
    .navbar-search { width: 100%; margin: .5rem 0; }
    .navbar-search:focus-within { width: 100%; }
}

.nav-link {
    font-weight: 500;
    color: #4b5563;
    transition: color 0.15s;
    border-radius: var(--app-radius-sm);
    padding: 0.4rem 0.7rem !important;
}
.nav-link:hover { color: var(--brand); }
.nav-link.active { color: var(--brand); font-weight: 600; }

/* ── Cards ── */
.card {
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-soft);
}
.card-body { position: relative; }

/* ── Alerts ── */
.alert {
    border: 0;
    border-radius: 1rem;
}
.message-stack .alert { backdrop-filter: blur(8px); }
.message-indicator {
    display: inline-block;
    width: 0.625rem;
    min-width: 0.625rem;
    height: 0.625rem;
    border-radius: 999px;
    margin-top: 0.375rem;
    background: currentColor;
    opacity: 0.45;
}

/* ── Forms ── */
.form-control, .form-select {
    min-height: 2.9rem;
    border-radius: 0.9rem;
    border-color: rgba(57, 68, 74, 0.15);
}
.btn { border-radius: 0.9rem; }
.badge { font-weight: 600; }

/* ── Profile ── */
.profile-avatar, .profile-avatar-placeholder {
    width: 112px;
    height: 112px;
    object-fit: cover;
}
.profile-avatar-placeholder {
    background: linear-gradient(135deg, var(--brand) 0%, var(--slate) 100%);
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
}

/* ── Model images ── */
.model-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}
.model-gallery-main {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
}
.model-gallery-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.model-card-image, .model-gallery-main, .model-gallery-thumb {
    background: linear-gradient(135deg, rgba(249,137,0,.06), rgba(57,68,74,.06));
}

/* ── Hover lift ── */
.hover-lift { transition: transform 0.22s ease, box-shadow 0.22s ease; }
.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--app-shadow);
}

/* ── Section helpers ── */
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.section-heading h1, .section-heading h2 { margin-bottom: 0; }

.stat-card {
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    background: rgba(255, 255, 255, 0.9);
}

.empty-state {
    border-radius: var(--app-radius);
    border: 1px dashed rgba(57, 68, 74, 0.15);
    background: rgba(255, 255, 255, 0.7);
}

.sticky-sidebar { position: sticky; top: 6.25rem; }

/* ── User dropdown ── */
.user-dropdown-toggle {
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}
.user-dropdown-toggle:hover,
.user-dropdown-toggle:focus,
.user-dropdown-toggle.show {
    background-color: var(--slate-light);
    color: var(--slate);
}

/* ── Category tree ── */
.category-tree { font-size: 0.92rem; }
.cat-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem;
    border-radius: 0.6rem;
    color: #4b5563;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cat-link:hover { background: var(--brand-light); color: var(--brand); }
.cat-link.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.cat-link.cat-link-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.parent-cat { font-weight: 500; }
.cat-logo { width: 16px; height: 16px; object-fit: contain; border-radius: 3px; flex-shrink: 0; }
.cat-children {
    padding-left: 0.75rem;
    border-left: 2px solid rgba(249, 137, 0, 0.2);
    margin-left: 0.6rem;
}
.child-cat { font-size: 0.78rem; }

/* ── Gallery ── */
.gallery-main-wrap { position: relative; }
.gallery-main {
    width: 100%;
    height: 420px;
    object-fit: contain;
    background: #f3f4f6;
    display: block;
    transition: opacity 0.15s ease;
}
.gallery-status-badge { position: absolute; top: 0.75rem; left: 0.75rem; }
.gallery-thumbs {
    background: #f8f9fa;
    border-top: 1px solid rgba(0,0,0,.06);
}
.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 2px; }
.gallery-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: border-color 0.15s, opacity 0.15s;
    opacity: 0.7;
}
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { border-color: var(--brand); opacity: 1; }

/* ── Model meta ── */
.model-meta-list { display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.85rem; }
.model-meta-list li { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.meta-label { color: #6b7280; font-size: 0.78rem; white-space: nowrap; }

/* ── File tree ── */
.file-folder-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
}
.file-list { display: flex; flex-direction: column; gap: 0.5rem; }
.file-item {
    background: #f8f9fa;
    border-radius: 0.6rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid rgba(0,0,0,.06);
}
.file-name { font-size: 0.78rem; color: #374151; min-width: 0; }
.file-format-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: var(--brand-light);
    color: var(--brand);
    padding: 0.1rem 0.35rem;
    border-radius: 0.3rem;
    flex-shrink: 0;
    letter-spacing: .03em;
}
.file-thumb {
    width: 80px;
    height: 80px;
    border-radius: 0.4rem;
    object-fit: cover;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    flex-shrink: 0;
}

/* ── STL Viewer ── */
.stl-viewer {
    height: 60vh;
    min-height: 320px;
    background: #0b1220;
    position: relative;
}
.stl-viewer canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.stl-viewer-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.65);
    font-size: 0.85rem;
}

/* ── Comment ── */
.comment-item {
    background: #f8f9fa;
    border: 1px solid rgba(0,0,0,.06);
}

/* ══════════════════════════════════════════
   HOME PAGE
══════════════════════════════════════════ */

/* Hero */
.home-hero {
    background: var(--slate);
    border-radius: var(--app-radius);
    position: relative;
    overflow: hidden;
    box-shadow: var(--app-shadow);
}

.home-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Decorative blobs — статичные, без анимации */
.home-hero-bg::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249,137,0,.25) 0%, transparent 70%);
    top: -150px;
    right: -100px;
}
.home-hero-bg::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249,137,0,.15) 0%, transparent 70%);
    bottom: -80px;
    left: 10%;
}

/* Hero grid overlay */
.home-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

.home-hero-content { position: relative; z-index: 2; }

.home-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(249,137,0,.2);
    border: 1px solid rgba(249,137,0,.35);
    color: #ffc96b;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
    letter-spacing: 0.02em;
}
.home-hero-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
}

.home-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}
.home-hero h1 .accent { color: var(--brand); }

.home-hero-desc {
    color: rgba(255,255,255,.75);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.home-hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn-hero-primary {
    background: var(--brand);
    color: #fff;
    border: none;
    font-weight: 700;
    padding: 0.75rem 1.75rem;
    border-radius: 0.9rem;
    font-size: 0.95rem;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(249,137,0,.4);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-hero-primary:hover {
    background: var(--brand-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(249,137,0,.5);
}

.btn-hero-secondary {
    background: rgba(255,255,255,.15);
    color: rgba(255,255,255,.9);
    border: 1px solid rgba(255,255,255,.2);
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    border-radius: 0.9rem;
    font-size: 0.95rem;
    transition: background 0.2s, transform 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-hero-secondary:hover {
    background: rgba(255,255,255,.18);
    color: #fff;
    transform: translateY(-2px);
}

/* Hero stats */
.home-hero-stats { display: flex; flex-direction: column; gap: 0.75rem; }

.home-stat-pill {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    min-width: 180px;
    transition: background 0.2s, transform 0.2s;
}
.home-stat-pill:hover {
    background: rgba(255,255,255,.14);
    transform: translateX(-4px);
}
.home-stat-pill-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(249,137,0,.2);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}
.home-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.2rem;
    letter-spacing: -0.03em;
}
.home-stat-label {
    font-size: 0.78rem;
    color: rgba(255,255,255,.65);
    font-weight: 500;
}

/* Floating 3D cube animation */
.hero-3d-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cube-wrap {
    position: relative;
    width: 160px;
    height: 160px;
}

/* ── Scroll reveal ── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Section label ── */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand);
    margin-bottom: 0.6rem;
}
.section-label::before {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: var(--brand);
    border-radius: 2px;
}

/* ── Model cards (home) ── */
.model-card {
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    background: #fff;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    text-decoration: none;
    display: block;
    height: 100%;
    color: inherit;
}
.model-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--app-shadow);
    color: inherit;
}
.model-card-img-wrap {
    position: relative;
    overflow: hidden;
}
.model-card-img-wrap img, .model-card-img-placeholder {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
    background: linear-gradient(135deg, rgba(249,137,0,.06), rgba(57,68,74,.06));
}
.model-card:hover .model-card-img-wrap img {
    transform: scale(1.05);
}
.model-card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}
.model-card-category {
    position: absolute;
    bottom: 0.6rem;
    left: 0.6rem;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(6px);
    border-radius: 0.5rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--slate);
}
.model-card-body {
    padding: 1rem 1.1rem;
}
.model-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--slate);
    margin-bottom: 0.4rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.model-card-desc {
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.6rem;
}
.model-card-date {
    font-size: 0.72rem;
    color: #9ca3af;
}

/* ── Pending models page ── */
.pending-models-page .model-card-desc {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
}

/* ── About / features section ── */
.home-about-img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
    display: block;
}

.home-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand-light);
    color: var(--brand);
    flex-shrink: 0;
}

.feature-item {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 0.75rem;
    border-radius: var(--app-radius-sm);
    transition: background 0.2s;
}
.feature-item:hover {
    background: #f9fafb;
}

/* ── Stats bar ── */
.stats-bar {
    background: #fff;
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-soft);
    padding: 1.5rem 2rem;
}
.stats-bar-item {
    text-align: center;
    position: relative;
}
.stats-bar-item + .stats-bar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: var(--app-border);
}
.stats-bar-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--slate);
    line-height: 1;
    margin-bottom: 0.25rem;
    letter-spacing: -0.03em;
}
.stats-bar-value span { color: var(--brand); }
.stats-bar-label {
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 500;
}

/* ── CTA section ── */
.home-cta {
    background: linear-gradient(135deg, var(--slate) 0%, var(--slate-dark) 100%);
    border-radius: var(--app-radius);
    position: relative;
    overflow: hidden;
}
.home-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 50%, rgba(249,137,0,.2) 0%, transparent 60%);
}
.home-cta > * { position: relative; z-index: 1; }

/* ── Footer ── */
.app-footer {
    background: var(--slate-dark);
    border-top: none;
    color: #adb5bd;
}

/* ══════════════════════════════════════════
   PAGE CONTENT: image float (text wrap)
══════════════════════════════════════════ */
.img-float-left {
    float: left;
    margin: .25em 1.5em 1em 0;
    max-width: 45%;
    height: auto;
}
.img-float-right {
    float: right;
    margin: .25em 0 1em 1.5em;
    max-width: 45%;
    height: auto;
}
.img-center {
    display: block;
    margin: 1em auto;
    max-width: 100%;
    height: auto;
}
figure.image {
    display: table;
    margin: 0;
}
figure.image.img-float-left  { float: left;  margin: .25em 1.5em 1em 0; }
figure.image.img-float-right { float: right; margin: .25em 0 1em 1.5em; }
figure.image.img-center      { margin: 1em auto; }
figure.image img { display: block; max-width: 100%; height: auto; }
figure.image figcaption {
    display: table-caption;
    caption-side: bottom;
    font-size: .82rem;
    color: var(--slate);
    text-align: center;
    padding: .35em 0;
}
@media (max-width: 575px) {
    .img-float-left, .img-float-right,
    figure.image.img-float-left, figure.image.img-float-right {
        float: none;
        margin: 1em auto;
        max-width: 100%;
        display: block;
    }
}


.footer-inner {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 2.5rem;
    padding: 3rem 0 2rem;
}

@media (max-width: 767px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 0 1.5rem;
    }
}

.footer-logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -.5px;
    color: #fff;
    display: inline-block;
    margin-bottom: .5rem;
}
.footer-logo span { color: var(--brand); }

.footer-tagline {
    font-size: .82rem;
    color: #adb5bd;
    margin: 0;
    line-height: 1.5;
}

.footer-col-title {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: .85rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.footer-link {
    font-size: .85rem;
    color: #adb5bd;
    text-decoration: none;
    transition: color .15s;
}
.footer-link:hover { color: var(--brand); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.07);
    padding: 1.25rem 0;
    font-size: .78rem;
    color: #6c757d;
}

/* ══════════════════════════════════════════
   PAGE HEADER (catalog, profile, etc.)
══════════════════════════════════════════ */

.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.page-header-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--slate);
    letter-spacing: -0.025em;
    margin: 0;
}
.page-header-sub {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.2rem 0 0;
}

/* ── Breadcrumb ── */
.breadcrumb {
    font-size: 0.8rem;
    --bs-breadcrumb-divider: '›';
}
.breadcrumb-item a {
    color: var(--brand);
    text-decoration: none;
}
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: #6b7280; }

/* ══════════════════════════════════════════
   FILTER / SEARCH BAR
══════════════════════════════════════════ */

.filter-bar {
    background: #fff;
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-soft);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
}
.filter-bar .form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}

/* ══════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════ */

.pagination .page-link {
    border-radius: 0.65rem !important;
    border: 1px solid var(--app-border);
    color: var(--slate);
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.45rem 0.9rem;
    margin: 0 2px;
    transition: all 0.15s;
}
.pagination .page-link:hover {
    background: var(--brand-light);
    border-color: rgba(249,137,0,.3);
    color: var(--brand);
}
.pagination .page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 2px 10px rgba(249,137,0,.35);
}
.pagination .page-item.disabled .page-link {
    opacity: 0.4;
}

/* ══════════════════════════════════════════
   CATEGORY LIST
══════════════════════════════════════════ */

.disabled {
    pointer-events: none;
    color: var(--slate);
}

.category-card {
    background: #fff;
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-soft);
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.25rem 0.5rem;
    color: inherit;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--app-shadow);
    color: inherit;
}
.category-card-icon {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.category-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.category-card-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--slate);
    margin-bottom: 1rem;
}
.category-card-desc {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.category-card-count {
    margin-left: auto;
    flex-shrink: 0;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
}
.category-card.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.4);
}
.category-card.disabled .category-card-count {
    background: rgba(0,0,0,.06);
    color: #9ca3af;
}

/* child badges in category_detail */
.child-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fff;
    border: 1px solid var(--app-border);
    color: var(--slate);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.child-cat-badge:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-light);
}

/* ══════════════════════════════════════════
   MODEL DETAIL — extra tweaks
══════════════════════════════════════════ */

.model-detail-tags .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 0.5rem;
}
.model-detail-author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}
.model-detail-author-initial {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Download button ── */
.btn-download {
    background: var(--brand);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
}
.btn-download:hover {
    background: var(--brand-dark);
    color: #fff;
    transform: translateY(-1px);
}

/* ── 3D View button ── */
.btn-view-3d {
    background: var(--brand-light);
    color: var(--brand-dark);
    border: 1px solid rgba(249, 137, 0, 0.35);
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s, border-color 0.15s;
}
.btn-view-3d:hover, .btn-view-3d:focus {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    transform: translateY(-1px);
}

/* ══════════════════════════════════════════
   AUTH PAGES (login / register / password reset)
══════════════════════════════════════════ */

.auth-wrap {
    min-height: calc(100vh - 220px);
    display: flex;
    align-items: center;
}
.auth-card {
    background: #fff;
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
    overflow: hidden;
}
.auth-card-panel {
    background: linear-gradient(160deg, var(--slate) 0%, var(--slate-dark) 100%);
    position: relative;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
}
.auth-card-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 70%, rgba(249,137,0,.2) 0%, transparent 60%);
}
.auth-card-panel-content {
    position: relative;
    z-index: 1;
    text-align: center;
}
.auth-card-logo {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
}
.auth-card-logo span { color: var(--brand); }
.auth-card-tagline {
    color: rgba(255,255,255,.6);
    font-size: 0.85rem;
    margin: 0;
}
.auth-card-body { padding: 2rem 2rem 2.5rem; }
.auth-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--slate);
    letter-spacing: -0.025em;
    margin-bottom: 0.35rem;
}
.auth-sub {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #d1d5db;
    font-size: 0.78rem;
    margin: 1.25rem 0;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--app-border);
}

/* ══════════════════════════════════════════
   PROFILE
══════════════════════════════════════════ */

.profile-header-card {
    background: #fff;
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-soft);
    overflow: hidden;
}
.profile-header-banner {
    height: 80px;
    background: linear-gradient(135deg, var(--slate) 0%, var(--slate-dark) 60%, rgba(249,137,0,.4) 100%);
}
.profile-header-body {
    padding: 0 1.5rem 1.5rem;
    margin-top: -40px;
}
.profile-avatar-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    overflow: hidden;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}
.profile-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-stat-card {
    background: #fff;
    border-radius: var(--app-radius-sm);
    border: 1px solid var(--app-border);
    padding: 1rem 1.25rem;
    text-align: center;
    transition: border-color 0.15s;
}
.profile-stat-card:hover { border-color: rgba(249,137,0,.3); }
.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--slate);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.2rem;
}
.profile-stat-label {
    font-size: 0.72rem;
    color: #9ca3af;
    font-weight: 500;
}
.profile-stat-card.stat-published .profile-stat-value { color: #16a34a; }
.profile-stat-card.stat-pending .profile-stat-value { color: #ca8a04; }
.profile-stat-card.stat-rejected .profile-stat-value { color: #dc2626; }

/* ══════════════════════════════════════════
   NOTIFICATIONS
══════════════════════════════════════════ */

.notif-item {
    background: #fff;
    border-radius: var(--app-radius-sm);
    border: 1px solid var(--app-border);
    padding: 1rem 1.25rem;
    transition: border-color 0.15s;
    margin-bottom: 0.6rem;
}
.notif-item.unread {
    border-left: 3px solid var(--brand);
    background: rgba(249,137,0,.025);
}
.notif-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notif-item-icon.success { background: rgba(22,163,74,.12); color: #16a34a; }
.notif-item-icon.danger  { background: rgba(220,38,38,.12);  color: #dc2626; }
.notif-item-icon.info    { background: var(--brand-light);   color: var(--brand); }

/* ══════════════════════════════════════════
   MY MODELS LIST
══════════════════════════════════════════ */

.my-model-card {
    background: #fff;
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-soft);
    overflow: hidden;
    transition: box-shadow 0.2s;
    margin-bottom: 1rem;
}
.my-model-card:hover { box-shadow: var(--app-shadow); }
.my-model-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, rgba(249,137,0,.06), rgba(57,68,74,.06));
}
.my-model-thumb-placeholder {
    height: 160px;
    background: linear-gradient(135deg, rgba(249,137,0,.05), rgba(57,68,74,.05));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
}

/* ══════════════════════════════════════════
   UPLOAD / EDIT FORM — drop zone
══════════════════════════════════════════ */

#image-drop-zone {
    border-color: var(--app-border) !important;
    border-radius: var(--app-radius-sm) !important;
    transition: border-color .2s, background .2s;
}
#image-drop-zone:hover {
    border-color: rgba(249,137,0,.4) !important;
    background: rgba(249,137,0,.02);
}
#image-drop-zone.drag-over {
    border-color: var(--brand) !important;
    background: rgba(249,137,0,.05);
}
.img-thumb-wrap { border-radius: .6rem !important; }
.img-thumb-wrap.is-primary { border-color: var(--brand) !important; }
.img-thumb-badge { background: var(--brand) !important; }

/* ══════════════════════════════════════════
   404 / ERROR PAGES
══════════════════════════════════════════ */

.error-page-wrap {
    min-height: 100vh;
    background: var(--slate);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.error-page-wrap::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249,137,0,.18) 0%, transparent 65%);
    top: -150px;
    right: -100px;
}
.error-page-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 40px 40px;
}
.error-page-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    animation: fadeInUp 0.6s ease;
}
.error-code {
    font-size: clamp(80px, 15vw, 140px);
    font-weight: 800;
    color: var(--brand);
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 0;
}
.error-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
}
.error-desc {
    color: rgba(255,255,255,.55);
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}
.error-btn-group { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.error-btn-primary {
    background: var(--brand);
    color: #fff;
    border: none;
    font-weight: 700;
    padding: 0.7rem 1.5rem;
    border-radius: 0.9rem;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 4px 18px rgba(249,137,0,.4);
}
.error-btn-primary:hover {
    background: var(--brand-dark);
    color: #fff;
    transform: translateY(-2px);
}
.error-btn-secondary {
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.85);
    border: 1px solid rgba(255,255,255,.2);
    font-weight: 600;
    padding: 0.7rem 1.5rem;
    border-radius: 0.9rem;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(8px);
}
.error-btn-secondary:hover {
    background: rgba(255,255,255,.18);
    color: #fff;
    transform: translateY(-2px);
}

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

/* ══════════════════════════════════════════
   FAVORITES
══════════════════════════════════════════ */

.favorite-card {
    background: #fff;
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-soft);
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.favorite-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--app-shadow);
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */

@media (max-width: 991.98px) {
    .sticky-sidebar { position: static; }
    .home-hero { padding: 2.5rem 1.5rem !important; }
    .home-hero h1 { font-size: 2rem; }
    .stats-bar { padding: 1.25rem 1rem; }
    .auth-card-panel { min-height: 160px; }
}

@media (max-width: 767.98px) {
    body { font-size: 0.97rem; }
    .model-card-image { height: 200px; }
    .model-gallery-main { max-height: 320px; }
    .gallery-main { height: 260px; }
    .gallery-thumb { width: 56px; height: 56px; }
    .home-stat-pill { min-width: unset; }
    .profile-avatar, .profile-avatar-placeholder { width: 96px; height: 96px; }
    .stats-bar-item + .stats-bar-item::before { display: none; }
    .stats-bar-value { font-size: 1.4rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .auth-card-panel { display: none; }
    .auth-card-body { padding: 1.5rem; }
}

/* ══════════════════════════════════════════
   IMAGE UPLOADER THUMBNAILS
══════════════════════════════════════════ */

#image-drop-zone.drag-over {
    border-color: var(--bs-primary) !important;
    background: rgba(var(--bs-primary-rgb), .05);
}

.img-thumb-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: .5rem;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color .15s;
    flex-shrink: 0;
}

.img-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.img-thumb-wrap.is-primary {
    border-color: var(--bs-primary);
}

.img-thumb-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: .6rem;
    font-weight: 600;
    text-align: center;
    padding: 2px 0;
    background: var(--bs-primary);
    color: #fff;
    opacity: 0;
    transition: opacity .15s;
}

.img-thumb-wrap.is-primary .img-thumb-badge {
    opacity: 1;
}

.img-thumb-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    border: none;
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
    z-index: 2;
}

.img-thumb-wrap:hover .img-thumb-remove {
    opacity: 1;
}

/* ══════════════════════════════════════════
   FILE MANAGER
══════════════════════════════════════════ */

#fm-tree { background: var(--bs-body-bg); }

.fm-folder-hd {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    cursor: pointer;
    user-select: none;
    transition: background .12s;
}

.fm-folder-hd:hover { background: rgba(0, 0, 0, .04); }

.fm-folder-hd.fm-drag-over {
    background: rgba(var(--bs-primary-rgb), .1);
    outline: 2px dashed var(--bs-primary);
    border-radius: 4px;
}

.fm-file-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-bottom: 1px solid var(--bs-border-color);
    transition: background .1s;
}

.fm-file-row:hover { background: rgba(0, 0, 0, .025); }
.fm-file-row.fm-dragging { opacity: .35; }
.fm-file-row.fm-existing { background: rgba(var(--bs-success-rgb), .04); }
.fm-file-row.fm-existing:hover { background: rgba(var(--bs-success-rgb), .08); }
.fm-toggle { font-size: .65rem; opacity: .55; min-width: 10px; }
.fm-folder-body { border-left: 2px solid var(--bs-border-color); margin-left: 22px; }
.fm-deleting { opacity: .4; pointer-events: none; }

