/* Custom styles for AI Model Profile Platform */

:root {
    --topbar-bg: linear-gradient(135deg, #111827 0%, #5a7487 100%);
    --topbar-border: rgba(255, 255, 255, 0.1);
    --topbar-text: #f8fafc;
    --topbar-muted: rgba(248, 250, 252, 0.8);
    --topbar-shadow: 0 10px 24px rgba(17, 24, 39, 0.24);
    --topbar-pill-bg: rgba(255, 255, 255, 0.08);
    --topbar-pill-bg-hover: rgba(255, 255, 255, 0.16);
    --topbar-logo-height-desktop: 52px;
    --topbar-logo-height-tablet: 44px;
    --topbar-logo-height-mobile: 42px;
    --topbar-min-height-desktop: 68px;
    --topbar-min-height-mobile: 62px;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.slimline-navbar {
    background: var(--topbar-bg) !important;
    /* Reset Semantic UI border, then add only the bottom divider line */
    border: none !important;
    border-bottom: 1px solid var(--topbar-border) !important;
    box-shadow: var(--topbar-shadow) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    background-color: #1f2937 !important;
    /* Replace Bootstrap sticky-top (not loaded) */
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    /* Enforce consistent height; remove Semantic UI margin: 1rem 0.
       box-sizing: content-box ensures min-height refers to content height
       so total visual height = min-height + 1px border-bottom is consistent. */
    box-sizing: content-box !important;
    align-items: stretch !important;
    min-height: var(--topbar-min-height-desktop) !important;
    margin: 0 !important;
}

.slimline-navbar .ui.container {
    min-height: var(--topbar-min-height-desktop) !important;
    display: flex !important;
    align-items: center !important;
    /* Ensure container fills the full navbar height */
    align-self: stretch !important;
}

.slimline-navbar .right.menu {
    align-items: center;
    flex-wrap: nowrap;
}

.slimline-navbar .item {
    color: var(--topbar-text) !important;
    transition: background 0.2s ease;
}

.slimline-navbar .item:hover {
    background: var(--topbar-pill-bg-hover) !important;
    color: #fff !important;
}

.slimline-navbar__logout-btn {
    border: 1px solid rgba(255, 255, 255, 0.24) !important;
    border-radius: 999px !important;
    background: var(--topbar-pill-bg) !important;
    color: var(--topbar-text) !important;
    padding: 0.3rem 0.8rem !important;
}

.nav-logged-in-as {
    color: #f8fafc;
    font-variant-caps: small-caps;
}

/* Logo default height */
.nav-logo {
    height: var(--topbar-logo-height-desktop);
}

/* Header item: use intrinsic height (logo drives it), not Semantic UI stretch */
.slimline-navbar .header.item {
    align-self: center !important;
    padding: 0.35rem 0.75rem !important;
}

/* ── Hamburger button ────────────────────────────────────────── */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 7px 10px;
    cursor: pointer;
    margin-left: auto;
    align-self: center;
    flex-shrink: 0;
}

.nav-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--topbar-text);
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-hamburger.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.is-active span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Tablet (768px – 1023px): compact but visible ────────────── */
@media (max-width: 1023px) and (min-width: 768px) {
    .nav-logo {
        height: var(--topbar-logo-height-tablet);
    }

    .slimline-navbar {
        min-height: var(--topbar-min-height-desktop) !important;
    }

    .slimline-navbar .ui.container {
        min-height: var(--topbar-min-height-desktop) !important;
    }

    .slimline-navbar .item {
        padding: 0.5rem 0.65rem !important;
        font-size: 0.875rem;
    }

    .nav-logged-in-as {
        display: none !important;
    }
}

/* ── Mobile (< 768px): hamburger + dropdown ──────────────────── */
@media (max-width: 767px) {
    .nav-logo {
        height: var(--topbar-logo-height-mobile);
    }

    .slimline-navbar {
        min-height: var(--topbar-min-height-mobile) !important;
    }

    .slimline-navbar .ui.container {
        align-items: center !important;
        padding: 0 0.75rem !important;
        min-height: var(--topbar-min-height-mobile) !important;
    }

    .slimline-navbar .header.item {
        flex: 1 1 auto;
        padding: 0.4rem 0 !important;
    }

    .nav-hamburger {
        display: flex;
    }

    /* Collapse the right menu */
    .slimline-navbar .right.menu {
        display: none !important;
        /* Absolute dropdown: appears below the sticky nav bar */
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        flex-direction: column !important;
        background: #1f2937;
        border-top: 1px solid var(--topbar-border);
        padding: 0.25rem 0 0.5rem;
        margin: 0 !important;
        z-index: 999;
    }

    /* Show when toggled open */
    .slimline-navbar .right.menu.nav-open {
        display: flex !important;
    }

    .slimline-navbar .right.menu .item {
        justify-content: flex-start !important;
        padding: 0.75rem 1rem !important;
        border-radius: 0 !important;
        width: 100%;
    }

    .slimline-navbar .right.menu .slimline-navbar__logout-item {
        padding: 0.5rem 1rem;
        width: 100%;
    }

    .slimline-navbar .right.menu .slimline-navbar__logout-form {
        width: 100%;
    }

    .slimline-navbar .right.menu .slimline-navbar__logout-btn {
        width: 100%;
    }

    .nav-logged-in-as {
        display: none !important;
    }
}

/* ── Bootstrap-compatible utility stubs (Bootstrap not loaded) ── */
.d-none  { display: none !important; }
.d-block { display: block !important; }
.d-flex  { display: flex !important; }

/* Creator dashboard */
.creator-dashboard-section-header {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    width: 100%;
}

.creator-dashboard-section-header .ui.header {
    margin: 0;
}

.creator-dashboard-new-gallery-btn {
    margin-left: auto !important;
    white-space: nowrap;
}

/* Custom badge styles for tiers */
.ui.label.green.basic { border-color: #21ba45 !important; color: #21ba45 !important; }
.ui.label.orange.basic { border-color: #f2711c !important; color: #f2711c !important; }
.ui.label.red.basic { border-color: #db2828 !important; color: #db2828 !important; }

/* Admin users filter layout */
.admin-users-filter-segment {
    padding: 0.5rem 1rem !important;
}

.admin-users-filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-users-filter-search {
    flex: 1 1 260px;
    min-width: 220px;
}

.admin-users-filter-search .ui.input,
.admin-users-filter-search .ui.input > input,
.admin-users-filter-role select {
    width: 100%;
}

.admin-users-filter-role {
    flex: 0 1 180px;
    min-width: 150px;
}

.admin-users-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.admin-users-filter-total {
    margin-left: 0.5rem;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .admin-users-filter-actions {
        margin-left: 0;
    }

    .admin-users-filter-total {
        margin-left: 0;
    }
}
