/*
 * css/styles.css
 * Purpose:
 * - Styling for home pipeline page with type cards, skeleton cards, and creative options.
 *
 * Contains:
 * - Theme tokens for dark-first monochrome style.
 * - Generic card/chip/button primitives used in index.php.
 * - Responsive rules for card grids.
 *
 * Critical notes:
 * - Classes align with jQuery selectors in js/script.js.
 * - Keep visual language close to provided Bootstrap + dark UI baseline.
 */

:root {
    --bg-main: #111;
    --bg-surface: #171b22;
    --text-main: #f5f5f5;
    --text-muted: #a0a7b4;
    --border-soft: rgba(255, 255, 255, 0.2);
    --accent: #f7d54a;
}

html[data-theme="light"],
body[data-theme="light"] {
    --bg-main: #fff;
    --bg-surface: #fff;
    --text-main: #111;
    --text-muted: #5f5f5f;
    --border-soft: rgba(0, 0, 0, 0.22);
    --accent: #f7d54a;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.home-main {
    min-height: calc(100svh - 72px);
    max-width: 980px;
}

.brand {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.custom-navbar {
    position: relative;
    top: 0;
    z-index: 1030;
    background: rgba(17, 17, 17, 0.9);
    backdrop-filter: blur(12px);
    border-color: var(--border-soft) !important;
}

.navbar {
    --bs-navbar-padding-y: 0;
}

body[data-theme="light"] .custom-navbar {
    background: rgba(255, 255, 255, 0.94);
}

.nav-shell {
    position: relative;
    min-height: 64px;
}

.nav-actions {
    margin-left: auto !important;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.brand-mark {
    font-weight: 700;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 0 6px 0 0 !important;
    margin: 0 12px 0 0 !important;
}

.brand-text {
    color: var(--text-main) !important;
}

.brand-logo-bg {
    width: 75px;
    height: 75px;
    flex-shrink: 0;
    align-self: flex-end;
    flex: 0 0 75px;
    background-image: url('/logo-bruno.svg');
    background-repeat: no-repeat;
    background-size: 100%;
    background-position: 5px 5px;
    margin-bottom: -1px; /* last logo pixels touch bottom border */
    z-index: 99999999 !important;
}

.brand-wordmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: clamp(1.35rem, 1.95vw, 0.9rem);
    line-height: 1;
    margin-top: 15px;
    font-weight: 800;
}

.nav-center-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.mobile-nav-toggle {
    min-width: 180px;
    min-height: 56px;
    border: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 18px;
}

.mobile-nav-label {
    font-size: 1.9rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.mobile-nav-angle {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.mobile-nav-toggle.show .mobile-nav-angle {
    transform: rotate(180deg);
}

body[data-theme="light"] .mobile-nav-toggle {
    background: rgba(17, 17, 17, 0.07);
}

.mobile-nav-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1031;
}

.mobile-nav-dropdown {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    margin-top: 12px;
    min-width: 290px;
    padding: 12px;
}

.mobile-nav-dropdown li + li {
    margin-top: 10px;
}

.nav-mobile-item {
    min-height: 54px;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 14px;
}

.nav-center-btn {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-main);
    padding: 6px 2px;
    position: relative;
}

.nav-center-btn::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: var(--text-main);
    opacity: 0;
}

.nav-center-btn:hover::after,
.nav-center-btn.is-active::after {
    opacity: 1;
}

.nav-center-btn.is-active::after {
    background: var(--accent);
}

.btn-ghost,
.icon-action {
    border-radius: 999px;
    border: 0;
    color: var(--text-main);
    background: transparent;
}

.btn-secondary-soft {
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-main);
}

.btn-avatar {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-main);
    border: 0;
    border-radius: 999px;
}

/* Defensive rule if a caret class appears again in future templates. */
.btn-avatar.dropdown-toggle::after {
    display: none;
}

.icon-action {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
}

body[data-theme="light"] .btn-ghost:hover {
    background: rgba(0, 0, 0, 0.08);
}

.dropdown-menu {
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 8px;
    min-width: 190px;
}

.dropdown-menu li + li {
    margin-top: 6px;
}

.dropdown-item {
    color: var(--text-main);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active {
    background: #fff;
    color: #111;
}

body[data-theme="light"] .dropdown-item:hover,
body[data-theme="light"] .dropdown-item:focus,
body[data-theme="light"] .dropdown-item.active {
    background: #111;
    color: #fff;
}

.page-title {
    font-size: clamp(1.8rem, 4.6vw, 3rem);
    margin: 0;
}

.page-subtitle {
    color: var(--text-muted);
}

.block {
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 18px;
}

.type-card,
.skeleton-card {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    min-height: 70px;
    padding: 12px;
    text-align: center;
    transition: all 0.18s ease;
}

.type-card:hover,
.skeleton-card:hover {
    border-color: #fff;
}

body[data-theme="light"] .type-card:hover,
body[data-theme="light"] .skeleton-card:hover {
    border-color: #111;
}

.type-card.is-active,
.skeleton-card.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(247, 213, 74, 0.22);
}

.form-control-dark {
    background: #111;
    color: var(--text-main);
    border: 1px solid var(--border-soft);
}

.input-icon-wrap {
    position: relative;
}

.input-left-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

.input-icon-wrap .form-control-dark,
.input-icon-wrap .form-select.form-control-dark {
    padding-left: 42px;
}

.form-error-text {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #e53935;
    min-height: 16px;
}

.btn-primary-soft {
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    background: transparent;
}

.btn-primary-soft:hover,
.btn-primary-soft:focus {
    border-color: var(--accent);
    color: var(--accent);
}

.auth-modal-content {
    border-radius: 20px;
    border: 1px solid var(--border-soft);
    background: var(--bg-surface);
}

.auth-tabs .nav-link {
    border-radius: 999px;
    color: var(--text-muted);
    border: 1px solid transparent;
    background: transparent;
}

.auth-tabs .nav-link.active {
    color: var(--bg-main);
    background: var(--text-main);
    border-color: var(--text-main);
}

.profile-tabs {
    border-bottom: 0;
}

.profile-tabs .nav-link {
    border: 0;
}

.form-control-dark:focus {
    background: #111;
    color: var(--text-main);
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(247, 213, 74, 0.2);
}

body[data-theme="light"] .form-control-dark {
    background: #fff;
    color: #111;
    border-color: rgba(0, 0, 0, 0.35);
}

body[data-theme="light"] .form-control-dark::placeholder {
    color: rgba(0, 0, 0, 0.55);
}

body[data-theme="light"] .form-control-dark:focus {
    background: #fff;
    color: #111;
    border-color: #111;
    box-shadow: 0 0 0 0.2rem rgba(17, 17, 17, 0.12);
}

.chip-toggle,
.chip-radio {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 8px 14px;
    min-height: 38px;
    transition: all 0.18s ease;
}

.chip-toggle:hover,
.chip-radio:hover {
    border-color: #fff;
}

.chip-toggle.is-active,
.chip-radio.is-active {
    border-color: var(--accent);
    color: var(--accent);
}

#creativeMediaStep[hidden],
#creativeFormatStep[hidden] {
    display: none !important;
}

.alert {
    border-radius: 12px;
}

@media (max-width: 991.98px) {
    .mobile-nav-toggle {
        min-width: 126px;
        min-height: 39px;
        padding: 0 12px;
        border-radius: 11px;
        gap: 8px;
    }

    .mobile-nav-label {
        font-size: 1.3rem;
    }

    .mobile-nav-angle {
        font-size: 0.9rem;
    }

    .mobile-nav-dropdown {
        min-width: 203px;
        padding: 8px;
        margin-top: 8px;
    }

    .mobile-nav-dropdown li + li {
        margin-top: 6px;
    }

    .nav-mobile-item {
        min-height: 38px;
        font-size: 1.4rem;
        padding: 8px 10px;
    }
}

@media (max-width: 767.98px) {
    .custom-navbar .container.nav-shell {
        padding-left: 10px;
        padding-right: 10px;
    }

    .mobile-nav-toggle {
        min-width: 126px;
        min-height: 39px;
        padding: 0 12px;
    }

    .nav-actions {
        gap: 0.35rem !important;
    }

    .nav-actions .btn-secondary-soft {
        padding: 0.35rem 0.6rem;
        font-size: 0.88rem;
    }

    .nav-actions .icon-action {
        width: 34px;
        height: 34px;
    }

    .btn-avatar {
        width: 34px;
        height: 34px;
    }

    .mobile-nav-label {
        font-size: 1.3rem;
    }

    .mobile-nav-angle {
        font-size: 0.9rem;
    }

    .mobile-nav-dropdown {
        min-width: 154px;
        padding: 7px;
        margin-top: 8px;
    }

    .mobile-nav-dropdown li + li {
        margin-top: 6px;
    }

    .nav-mobile-item {
        min-height: 31px;
        font-size: 0.88rem;
        padding: 6px 8px;
    }

    .block {
        padding: 14px;
    }
}

/* Questions page surfaces */
.pipeline-grid {
    display: grid;
    gap: 14px;
}

.pipeline-section {
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
    padding: 14px;
}

body[data-theme="light"] .pipeline-section {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), transparent);
}

.pipeline-field {
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
}

body[data-theme="light"] .pipeline-field {
    background: rgba(0, 0, 0, 0.01);
}

.pipeline-upload {
    display: grid;
    gap: 8px;
}
