/* =========================================================
   BASE MODAL
========================================================= */
.fh-mb-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000001;
    font-family: inherit;
}
.fh-mb-modal .fh-mb-loader {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    z-index: 50;
}
.fh-mb-modal.is-open {
    display: flex;
}

.fh-mb-modal__overlay {
    z-index: 100000;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
}

/* White card */
.fh-mb-modal__dialog {
    position: relative;
    background: #fff;
    width: 86%;
    max-width: 1180px;
    max-height: 78vh;
    padding: 80px 200px;
    z-index: 100001;
    overflow: hidden;
}

/* Shared content wrapper */
.fh-mb-modal__content {
    width: 100%;
    height: 100%;
}

/* =========================================================
   ADD / SELECT STATE  (screens 1,2,4)
========================================================= */
.fh-mb-modal__heading {
    font-size: 30px;
    line-height: 1.3;
    font-weight: 400;
    margin: 0 0 32px;
}

.fh-mb-modal__back-link {
    display: none; /* JS will control visibility */
    margin: 0 0 20px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 13px;
    letter-spacing: .12em;
    cursor: pointer;
    color: #777;
}

.fh-mb-modal__back-link:hover {
    color: #000;
}


/* Input fields */
.fh-mb-modal__input {
    width: 100%;
    font-size: 20px;
    border: 1px solid black;
    font-family: inherit;
    padding: 20px 18px;
}

/* Arrow on the right */
.fh-mb-modal__input--search {
    background-image:
            linear-gradient(45deg, transparent 50%, #000 50%),
            linear-gradient(135deg, #000 50%, transparent 50%);
    background-position:
            calc(100% - 18px) 50%,
            calc(100% - 13px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}


.fh-mb-modal__footer {
    margin-top: 32px;
    display: flex;
    align-items: center;
}

.buttons-container{
    display: flex;
    flex-direction: column;
    gap: 22px;
}
/* Primary button – matches “ADD TO MOODBOARD” */
.fh-mb-modal__primary {
    border: 1px solid black;
    padding: 20px 52px;
    font-family: 'Circular', 'sans-serif';
    background: #000;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .18em;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: all 0.2s ease;
    flex: 2;
}

.fh-mb-modal__primary:hover{
    background: white;
    color: black;
}
.fh-mb-modal__secondary {
    border: 1px solid black;
    padding: 20px 52px;
    font-family: 'Circular', 'sans-serif';
    background: white;
    color: black;
    text-transform: uppercase;
    letter-spacing: .18em;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: all 0.2s ease;
    flex: 2;
}
.fh-mb-modal__secondary:hover{
    background: black;
    color: white;
}
/* =========================================================
   BOARD DROPDOWN (screen 2)
========================================================= */

/* Existing section spacing */
.fh-mb-modal__existing {
    margin-top: 32px;
    position: relative;
}

.fh-mb-modal--mode-choose .fh-mb-modal__existing {
    display: block;
}

.fh-mb-modal--mode-choose .fh-mb-modal__new-fields {
    display: none;
}

/* MODE: create new moodboard */
.fh-mb-modal--mode-create .fh-mb-modal__existing {
    display: none;
}

.fh-mb-modal--mode-create .fh-mb-modal__new-fields {
    display: block;
}


/* Dropdown list – hidden by default */
.fh-mb-modal__board-list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 1px;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #000;
    border-top: none;
    background: #fff;
    z-index: 10;
}

/* When wrapper is open, show dropdown */
.fh-mb-modal__existing.is-open .fh-mb-modal__board-list {
    display: block;
}

/* Each moodboard row */
.fh-mb-modal__board-item {
    padding: 14px 20px;
    cursor: pointer;
    border-bottom: 1px solid #e6e6e6;
    font-size: 16px;
    font-family: 'Circular', 'sans-serif';
    text-transform: uppercase;
    letter-spacing: .1em;
    background: #fff;
}

.fh-mb-modal__board-item:last-child {
    border-bottom: none;
}

/* Active row – solid black like your design */
.fh-mb-modal__board-item.is-active {
    background: #000;
    color: #fff;
}

/* =========================================================
   SUCCESS STATE  (screen 3)
========================================================= */

.fh-mb-modal__content--success {
    display: none; /* toggled via .fh-mb-modal--success */
}

.fh-mb-modal--success .fh-mb-modal__content--add {
    display: none;
}

.fh-mb-modal--success .fh-mb-modal__content--success {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fh-mb-modal__success-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 80px 30px;
}

.fh-mb-modal__success-inner-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
}

/* “Added to” eyebrow */
.fh-mb-modal__eyebrow {
    font-size: 11px;
    font-family: 'Circular', 'sans-serif';
    text-transform: uppercase;
    color: #999;
    margin: 0;
}

/* Board name “Moodboard 1” */
.fh-mb-modal__success-board {
    font-size: 30px;
    margin: 0;
    font-weight: 400;
    flex: 3;
}

/* Centered button in the row */
.fh-mb-modal__primary--center, fh-mb-modal__secondary--center{
    margin-top: 0;
}

/* Keep img/title nodes for JS but visually hide them */
#fh-mb-modal-success-img,
#fh-mb-modal-success-item-title {
    display: none;
}

/* =========================================================
   CLOSE BUTTON
========================================================= */
.fh-mb-modal__close {
    position: absolute;
    top: 10px;
    right: 35px;
    background: none;
    border: 0;
    font-size: 60px;
    cursor: pointer;
}

/* =========================================================
   SMALL SCREENS
========================================================= */
@media (max-width: 768px) {
    .fh-mb-modal__dialog {
        width: 94%;
        min-height: 500px;
        max-height: 94%;
        padding: 40px 24px 48px;
        display:flex;
        justify-content: center;
        align-items: center;
    }

    .fh-mb-modal__col--main {
        max-width: 100%;
    }

    .fh-mb-modal__footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .fh-mb-modal__success-inner {
        flex-direction: column;
        gap: 24px;
        padding: 40px 24px;
        width: 100%;
    }

    .fh-mb-modal__success-inner-right {
        flex-direction: column;
        align-items: flex-start;
    }
}
