/* ═══════════════════════════════════════════════════
   AutoSMM Create Post — Focused Cards UX
   Reuses sh- design system variables from user_article_list.css
   BEM naming with cp- prefix (create-post)
   ═══════════════════════════════════════════════════ */

/* ─── Cards ─── */

.cp-card {
    background: var(--sh-card-bg);
    border-radius: var(--sh-radius);
    padding: 20px 24px;
    box-shadow: var(--sh-shadow);
    border: 1px solid var(--sh-border);
    margin-bottom: 16px;
}

.cp-card:last-child {
    margin-bottom: 0;
}

/* Accent card — main text card, always open */
.cp-card--accent {
    border-top: 3px solid transparent;
    border-image: linear-gradient(135deg, var(--sh-primary) 0%, var(--sh-primary-light) 100%) 1;
    border-image-slice: 1 0 0 0;
    padding: 24px 28px;
}

/* ─── Card Header ─── */

.cp-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--sh-text);
    margin: 0 0 16px;
}

.cp-card__header i {
    font-size: 16px;
    color: var(--sh-primary);
}

.cp-card__header .cp-card__icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* ─── Expandable Card ─── */

.cp-card--expandable {
    padding: 0;
}

.cp-card--expandable .cp-card__header {
    padding: 16px 24px;
    margin: 0;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    border-radius: var(--sh-radius);
}

.cp-card--expandable .cp-card__header:hover {
    background: var(--sh-primary-bg);
}

.cp-card__badge {
    font-size: 12px;
    font-weight: 400;
    color: var(--sh-text-muted);
    background: #f3f4f6;
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: 4px;
}

.cp-card__chevron {
    margin-left: auto;
    font-size: 14px;
    color: var(--sh-text-muted);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cp-card--open .cp-card__chevron {
    transform: rotate(180deg);
}

/* Expandable body — animated max-height */
.cp-card--expandable .cp-card__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.35s ease;
    padding: 0 24px;
}

.cp-card--expandable.cp-card--open .cp-card__body {
    max-height: 1200px;
    padding: 0 24px 20px;
}

/* Carousel card needs more height for media content */
#cp-carousel.cp-card--open .cp-card__body {
    max-height: 2000px;
}

.cp-card--expandable.cp-card--open .cp-card__header {
    border-radius: var(--sh-radius) var(--sh-radius) 0 0;
}

/* ─── Settings Card ─── */

.cp-settings {
    padding: 20px 24px;
}

.cp-settings__row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.cp-settings__row:last-child {
    margin-bottom: 0;
}

.cp-settings__field {
    flex: 1;
    min-width: 200px;
}

.cp-settings__field-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--sh-text);
    margin: 0 0 6px;
    line-height: 1.4;
}

.cp-settings__field-label a {
    color: var(--sh-primary);
    text-decoration: none;
}

.cp-settings__field-label a:hover {
    text-decoration: underline;
}

.cp-settings__field-hint {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    color: var(--sh-text-muted);
    margin: 0 0 6px;
}

/* Settings select */
.cp-settings select {
    width: 100%;
    padding: 9px 36px 9px 12px;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius-xs);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: var(--sh-text);
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M12 15.0006L7.75732 10.758L9.17154 9.34375L12 12.1722L14.8284 9.34375L16.2426 10.758L12 15.0006Z" fill="%236c757d"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
    cursor: pointer;
    transition: border-color var(--sh-transition);
    box-sizing: border-box;
}

.cp-settings select:focus {
    outline: none;
    border-color: var(--sh-primary);
    box-shadow: 0 0 0 3px rgba(15, 51, 239, 0.1);
}

/* ─── Sphere select (reused from old layout) ─── */

.post-label__select-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-label__select-wrap select {
    flex: 1;
    padding: 9px 36px 9px 12px;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius-xs);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: var(--sh-text);
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M12 15.0006L7.75732 10.758L9.17154 9.34375L12 12.1722L14.8284 9.34375L16.2426 10.758L12 15.0006Z" fill="%236c757d"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
    cursor: pointer;
    transition: border-color var(--sh-transition);
    box-sizing: border-box;
}

.post-label__select-wrap select:focus {
    outline: none;
    border-color: var(--sh-primary);
    box-shadow: 0 0 0 3px rgba(15, 51, 239, 0.1);
}

.post-label-select__rest {
    flex-shrink: 0;
}

.post-label-select__rest a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--sh-radius-xs);
    border: 1px solid var(--sh-border);
    background: #fff;
    transition: background var(--sh-transition), border-color var(--sh-transition);
}

.post-label-select__rest a:hover {
    background: var(--sh-primary-bg);
    border-color: var(--sh-primary);
}

/* ─── Checkbox label ─── */

.post__label_checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
}

.post__label_checkbox h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--sh-text);
    margin: 0;
    line-height: 1.4;
}

.post__label_checkbox h3 a {
    color: var(--sh-primary);
    text-decoration: none;
}

.post__label_checkbox h3 a:hover {
    text-decoration: underline;
}

.post__label_checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--sh-primary);
    cursor: pointer;
}

/* ─── Additional option label (inside settings) ─── */

.post__label {
    display: flex;
    flex-direction: column;
}

.post__label h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--sh-text);
    margin: 0 0 4px;
    line-height: 1.4;
}

.post__label p {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    color: var(--sh-text-muted);
    margin: 0 0 6px;
}

/* ─── Add sphere link ─── */

.add__sphere {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.add__sphere a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--sh-primary);
    text-decoration: none;
    transition: opacity var(--sh-transition);
}

.add__sphere a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.add-sphere__info-img {
    display: flex;
    align-items: center;
}

.add-sphere__info-img a {
    display: flex;
}

/* ─── Image/video generation wrapper ─── */

.image_generation_wrapper {
    width: 100%;
}

/* ─── Submit bar ─── */

.cp-submit {
    background: var(--sh-card-bg);
    border-radius: var(--sh-radius);
    padding: 20px 24px;
    box-shadow: var(--sh-shadow);
    border: 1px solid var(--sh-border);
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ─── Submit button ─── */

.post__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--sh-radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--sh-transition), box-shadow var(--sh-transition), opacity var(--sh-transition);
    text-decoration: none;
    line-height: 1.4;
    background: linear-gradient(135deg, var(--sh-primary) 0%, var(--sh-primary-light) 100%);
    color: #fff;
}

.post__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(15, 51, 239, 0.3);
}

.post__btn:active {
    transform: translateY(0);
}

button.post__btn {
    width: 100%;
    max-width: 400px;
}

/* ─── Disabled state ─── */

.post__btn.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.disabled-element {
    opacity: 0.45;
    pointer-events: none;
}

/* ─── Warning ─── */

.post-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--sh-radius-xs);
    background: #fef3c7;
    border: 1px solid #fcd34d;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: #92400e;
    line-height: 1.5;
    width: 100%;
    box-sizing: border-box;
}

.post-warning i {
    color: var(--sh-warning);
    font-size: 16px;
    flex-shrink: 0;
}

/* ─── File upload blocks ─── */

.inline-container {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    background: #fff;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.add__file {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.add__file input[type="file"] {
    display: none;
}

.add__file .post__btn {
    font-size: 13px;
    padding: 8px 18px;
}

.file-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    color: var(--sh-text-muted);
    margin-top: 2px;
}

/* ─── Action links (add/delete block, new social) ─── */

.post-label-select__new-social {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: var(--sh-primary);
    transition: opacity var(--sh-transition);
}

.post-label-select__new-social:hover {
    opacity: 0.8;
}

.post-label-select__new-social div {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-label-select__new-social h3 {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    color: var(--sh-text);
}

/* ─── Hidden content plan input ─── */

input[name="create_from_cp"] {
    display: none;
}

/* ─── Responsive ─── */

@media (max-width: 640px) {
    .cp-card {
        padding: 16px;
        border-radius: 12px;
    }

    .cp-card--accent {
        padding: 18px 16px;
    }

    .cp-card--expandable .cp-card__header {
        padding: 14px 16px;
    }

    .cp-card--expandable .cp-card__body {
        padding: 0 16px;
    }

    .cp-card--expandable.cp-card--open .cp-card__body {
        padding: 0 16px 16px;
    }

    .cp-card__header {
        font-size: 14px;
    }

    .cp-settings {
        padding: 16px;
    }

    .cp-settings__row {
        flex-direction: column;
        gap: 12px;
    }

    .cp-settings__field {
        min-width: unset;
        width: 100%;
    }

    .post-label__select-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .post-label__select-wrap select {
        width: 100%;
    }

    .post-label-select__rest {
        align-self: flex-start;
    }

    .cp-submit {
        padding: 16px;
    }

    button.post__btn {
        font-size: 14px;
        padding: 12px 20px;
    }

    .inline-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }
}
