/* ==================================================
   Nuclear Fancy Pants Edition™ — NUCLEAR+++
   File: /assets/css/featured-image-picker.css
   Description: Featured image picker modal styles — post editor
   Last Edited: 2026-05-04
   ================================================== */

/* ── Trigger button ─────────────────────────────── */
#amai-featured-image-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 7px 14px;
    background: #D97757;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    width: 100%;
    justify-content: center;
}
#amai-featured-image-btn:hover {
    background: #c4623e;
    transform: translateY(-1px);
}
#amai-featured-image-btn svg {
    flex-shrink: 0;
}

/* ── Backdrop ───────────────────────────────────── */
#amai-fip-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999990;
}
#amai-fip-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}
.amai-fip-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28, 25, 23, 0.55);
    backdrop-filter: blur(4px);
    animation: fipFadeIn 0.2s ease;
}
@keyframes fipFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Panel ──────────────────────────────────────── */
.amai-fip-panel {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(28,25,23,0.22), 0 4px 16px rgba(28,25,23,0.08);
    width: 720px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fipSlideUp 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fipSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ─────────────────────────────────────── */
.amai-fip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
    flex-shrink: 0;
}
.amai-fip-title {
    font-family: 'Nunito', -apple-system, sans-serif;
    font-size: 17px;
    font-weight: 800;
    color: #1C1917;
    letter-spacing: -0.02em;
}
.amai-fip-eyebrow {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #D97757;
    margin-bottom: 2px;
}
.amai-fip-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid #E7DDD5;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #78716C;
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.amai-fip-close:hover {
    background: #FFF4F0;
    color: #D97757;
}

/* ── Tabs ───────────────────────────────────────── */
.amai-fip-tabs {
    display: flex;
    gap: 2px;
    padding: 16px 24px 0;
    border-bottom: 2px solid #F3EDE8;
    flex-shrink: 0;
}
.amai-fip-tab {
    padding: 8px 16px 10px;
    border: none;
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #78716C;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.amai-fip-tab:hover {
    color: #1C1917;
}
.amai-fip-tab.is-active {
    color: #D97757;
    border-bottom-color: #D97757;
}
.amai-fip-tab svg {
    flex-shrink: 0;
}

/* ── Tab panels ─────────────────────────────────── */
.amai-fip-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.amai-fip-pane {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 24px;
    flex-direction: column;
}
.amai-fip-pane.is-active {
    display: flex;
}

/* ── Media Library pane ─────────────────────────── */
.amai-fip-media-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.amai-fip-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #F9FAFB;
    border: 1.5px solid #E7DDD5;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #44403C;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.amai-fip-upload-btn:hover {
    background: #FFF4F0;
    border-color: #D97757;
    color: #D97757;
}
.amai-fip-media-search {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid #E7DDD5;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #1C1917;
    outline: none;
    transition: border-color 0.15s;
}
.amai-fip-media-search:focus {
    border-color: #D97757;
}
.amai-fip-media-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    flex: 1;
}
.amai-fip-media-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
    position: relative;
}
.amai-fip-media-item:hover {
    transform: scale(1.02);
    border-color: #D97757;
}
.amai-fip-media-item.is-selected {
    border-color: #D97757;
    box-shadow: 0 0 0 2px rgba(217,119,87,0.3);
}
.amai-fip-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.amai-fip-media-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: #D97757;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
}
.amai-fip-media-item.is-selected .amai-fip-media-check {
    display: flex;
}
.amai-fip-media-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: #78716C;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
}
.amai-fip-media-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: #D97757;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
}

/* ── Unsplash pane ──────────────────────────────── */
.amai-fip-unsplash-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.amai-fip-unsplash-input {
    flex: 1;
    padding: 9px 14px;
    border: 1.5px solid #E7DDD5;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #1C1917;
    outline: none;
    transition: border-color 0.15s;
}
.amai-fip-unsplash-input:focus {
    border-color: #D97757;
}
.amai-fip-unsplash-search-btn {
    padding: 9px 18px;
    background: #D97757;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.amai-fip-unsplash-search-btn:hover {
    background: #c4623e;
}
.amai-fip-unsplash-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.amai-fip-unsplash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    flex: 1;
}
.amai-fip-unsplash-item {
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2.5px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
    position: relative;
    aspect-ratio: 4/3;
}
.amai-fip-unsplash-item:hover {
    transform: scale(1.02);
    border-color: #D97757;
}
.amai-fip-unsplash-item.is-selected {
    border-color: #D97757;
    box-shadow: 0 0 0 2px rgba(217,119,87,0.3);
}
.amai-fip-unsplash-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.amai-fip-unsplash-credit {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.55));
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    color: rgba(255,255,255,0.9);
    opacity: 0;
    transition: opacity 0.15s;
}
.amai-fip-unsplash-item:hover .amai-fip-unsplash-credit {
    opacity: 1;
}
.amai-fip-unsplash-credit a {
    color: rgba(255,255,255,0.9);
    text-decoration: underline;
}
.amai-fip-unsplash-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #D97757;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
}
.amai-fip-unsplash-item.is-selected .amai-fip-unsplash-check {
    display: flex;
}
.amai-fip-unsplash-hint {
    text-align: center;
    padding: 40px 0 0;
    color: #A8A29E;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    flex: 1;
}
.amai-fip-unsplash-loading,
.amai-fip-unsplash-empty {
    text-align: center;
    padding: 40px 0;
    color: #78716C;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    grid-column: 1 / -1;
}
.amai-fip-unsplash-loading {
    color: #D97757;
}

/* ── AI pane ────────────────────────────────────── */
.amai-fip-ai-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
}
.amai-fip-ai-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #FFF4F0, #FFE8DE);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D97757;
}
.amai-fip-ai-title {
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #1C1917;
    text-align: center;
}
.amai-fip-ai-sub {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #78716C;
    text-align: center;
    max-width: 340px;
    line-height: 1.5;
}
.amai-fip-ai-prompt-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #A8A29E;
    align-self: flex-start;
    width: 100%;
    max-width: 400px;
}
.amai-fip-ai-prompt-preview {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    background: #F9FAFB;
    border: 1.5px solid #E7DDD5;
    border-radius: 8px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: #78716C;
    line-height: 1.5;
    min-height: 48px;
}
.amai-fip-ai-generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #D97757;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 2px 12px rgba(217,119,87,0.3);
}
.amai-fip-ai-generate-btn:hover:not(:disabled) {
    background: #c4623e;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(217,119,87,0.4);
}
.amai-fip-ai-generate-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}
.amai-fip-ai-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fipSpin 0.7s linear infinite;
    display: none;
}
.amai-fip-ai-generate-btn.is-loading .amai-fip-ai-spinner {
    display: block;
}
.amai-fip-ai-generate-btn.is-loading .amai-fip-ai-btn-icon {
    display: none;
}
@keyframes fipSpin {
    to { transform: rotate(360deg); }
}
.amai-fip-ai-preview {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid #E7DDD5;
    display: none;
    position: relative;
}
.amai-fip-ai-preview.is-visible {
    display: block;
}
.amai-fip-ai-preview img {
    width: 100%;
    display: block;
}
.amai-fip-ai-preview-label {
    padding: 8px 12px;
    background: #F9FAFB;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    color: #78716C;
    text-align: center;
}
.amai-fip-ai-no-provider {
    background: #FFF4F0;
    border: 1.5px solid #FFD4C2;
    border-radius: 10px;
    padding: 16px 20px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #92400E;
    text-align: center;
    max-width: 380px;
}

/* ── Footer ─────────────────────────────────────── */
.amai-fip-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1.5px solid #F3EDE8;
    flex-shrink: 0;
    background: #FAFAF9;
}
.amai-fip-cancel-btn {
    padding: 8px 18px;
    background: transparent;
    border: 1.5px solid #E7DDD5;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #78716C;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.amai-fip-cancel-btn:hover {
    background: #F9FAFB;
    border-color: #C7BDB8;
}
.amai-fip-set-btn {
    padding: 8px 20px;
    background: #D97757;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.amai-fip-set-btn:hover:not(:disabled) {
    background: #c4623e;
    transform: translateY(-1px);
}
.amai-fip-set-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.amai-fip-set-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fipSpin 0.7s linear infinite;
    display: none;
}
.amai-fip-set-btn.is-loading .amai-fip-set-spinner {
    display: block;
}
.amai-fip-set-btn.is-loading .amai-fip-set-label {
    opacity: 0.7;
}
.amai-fip-status {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: #78716C;
    flex: 1;
}
.amai-fip-status.is-error {
    color: #DC2626;
}
.amai-fip-status.is-success {
    color: #16A34A;
}