/* ==========================================================================
   OB-AutoPost - Meta Marketing & Ads Studio Styles (v26.0)
   ========================================================================== */

/* Layout & Grid Containers */
.marketing-grid {
    display: grid;
    grid-template-columns: 1fr 390px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1100px) {
    .marketing-grid {
        grid-template-columns: 1fr;
    }
}

/* Studio Account Selector Header Bar */
.mkt-account-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    background: rgba(6, 8, 14, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.85rem;
    padding: 0.6rem 1rem;
}

.mkt-account-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #4ade80;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    white-space: nowrap;
}

/* Card Base */
.mkt-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.25rem;
}

.mkt-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

.mkt-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mkt-card-desc {
    font-size: 0.83rem;
    color: #94a3b8;
    margin-bottom: 1.15rem;
    line-height: 1.5;
}

/* Presets Container & Buttons */
.mkt-presets-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.mkt-preset-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 0.45rem 0.85rem;
    border-radius: 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    user-select: none;
}

.mkt-preset-btn:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: #3b82f6;
    color: #93c5fd;
    transform: translateY(-1px);
}

.mkt-preset-btn.active {
    background: rgba(59, 130, 246, 0.28);
    border-color: #60a5fa;
    color: #fff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}

/* Clickable Quick Suggestion Chips */
.mkt-chips-container {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
    margin-bottom: 1.15rem;
}

.mkt-chip {
    background: rgba(15, 23, 42, 0.8);
    border: 1px dashed rgba(255, 255, 255, 0.18);
    color: #94a3b8;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.mkt-chip:hover {
    border-color: #38bdf8;
    color: #e0f2fe;
    background: rgba(56, 189, 248, 0.12);
    border-style: solid;
}

/* Search Bar & Auto-suggest Dropdown */
.mkt-search-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.mkt-input {
    width: 100%;
    background: rgba(6, 8, 14, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    padding: 0.7rem 1rem;
    color: #f8fafc;
    font-size: 0.88rem;
    outline: none;
    transition: all 0.2s ease;
}

.mkt-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.mkt-suggest-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    max-height: 260px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
    display: none;
}

.mkt-suggest-dropdown.active {
    display: block;
}

.mkt-suggest-item {
    padding: 0.65rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s ease;
}

.mkt-suggest-item:hover {
    background: rgba(59, 130, 246, 0.15);
}

.mkt-suggest-name {
    font-size: 0.88rem;
    color: #f1f5f9;
    font-weight: 600;
}

.mkt-suggest-sub {
    font-size: 0.74rem;
    color: #64748b;
}

.mkt-suggest-size {
    font-size: 0.75rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
}

/* Tag Pills */
.mkt-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    min-height: 38px;
}

.mkt-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.mkt-tag-remove {
    cursor: pointer;
    color: #94a3b8;
    font-weight: bold;
    margin-left: 0.25rem;
    transition: color 0.15s ease;
}

.mkt-tag-remove:hover {
    color: #ef4444;
}

/* Reach Gauge Widget */
.reach-gauge-box {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.85));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    position: sticky;
    top: 5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.reach-number {
    font-size: 2.1rem;
    font-weight: 800;
    color: #38bdf8;
    font-family: 'Outfit', sans-serif;
    margin: 0.4rem 0;
    letter-spacing: -0.02em;
}

.reach-meter-bar {
    height: 12px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    overflow: hidden;
    margin: 1rem 0 0.4rem 0;
    position: relative;
}

.reach-meter-fill {
    height: 100%;
    width: 65%;
    background: linear-gradient(90deg, #f59e0b 0%, #22c55e 50%, #3b82f6 100%);
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reach-segments {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #64748b;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.reach-indicator-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.reach-indicator-badge.optimal {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.reach-indicator-badge.specific {
    background: rgba(245, 158, 11, 0.15);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.reach-indicator-badge.broad {
    background: rgba(59, 130, 246, 0.15);
    color: #bfdbfe;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.reach-sentence-box {
    background: rgba(6, 8, 14, 0.65);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    padding: 0.85rem;
    text-align: left;
    font-size: 0.82rem;
    color: #cbd5e1;
    margin-top: 1rem;
    line-height: 1.5;
}

/* Advantage+ Toggle */
.mkt-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(37, 244, 238, 0.05);
    border: 1px solid rgba(37, 244, 238, 0.2);
    border-radius: 0.85rem;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.25rem;
}

.mkt-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.mkt-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mkt-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 24px;
}

.mkt-slider:before {
    position: absolute;
    content: ;
 height: 18px;
 width: 18px;
 left: 3px;
 bottom: 3px;
 background-color: white;
 transition: 0.3s;
 border-radius: 50%;
}

input:checked + .mkt-slider {
 background-color: #25f4ee;
}

input:checked + .mkt-slider:before {
 transform: translateX(20px);
}

/* Pipeline Steps */
.mkt-pipeline-steps {
 display: flex;
 align-items: center;
 gap: 0.75rem;
 margin-bottom: 1.5rem;
 padding: 0.65rem 1.15rem;
 background: rgba(6, 8, 14, 0.6);
 border: 1px solid rgba(255, 255, 255, 0.08);
 border-radius: 0.75rem;
 overflow-x: auto;
}

.mkt-step {
 display: flex;
 align-items: center;
 gap: 0.45rem;
 font-size: 0.78rem;
 font-weight: 600;
 color: #64748b;
 white-space: nowrap;
}

.mkt-step.active {
 color: #38bdf8;
}

.mkt-step-num {
 width: 22px;
 height: 22px;
 border-radius: 50%;
 background: rgba(255, 255, 255, 0.1);
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 0.7rem;
 font-weight: 700;
}

.mkt-step.active .mkt-step-num {
 background: #0284c7;
 color: #fff;
 box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.mkt-step-divider {
 color: #334155;
 font-size: 0.85rem;
}

/* Objective Selection Cards */
.mkt-objectives-grid {
 display: grid;
 grid-template-columns: repeat(3, 1fr);
 gap: 0.75rem;
 margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
 .mkt-objectives-grid {
 grid-template-columns: 1fr;
 }
}

.mkt-objective-card {
 background: rgba(15, 23, 42, 0.65);
 border: 1px solid rgba(255, 255, 255, 0.1);
 border-radius: 0.75rem;
 padding: 0.85rem;
 cursor: pointer;
 transition: all 0.2s ease;
 text-align: left;
}

.mkt-objective-card:hover {
 border-color: rgba(59, 130, 246, 0.4);
 background: rgba(30, 41, 59, 0.6);
}

.mkt-objective-card.selected {
 border-color: #3b82f6;
 background: rgba(59, 130, 246, 0.15);
 box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}

.mkt-objective-title {
 font-size: 0.88rem;
 font-weight: 700;
 color: #f1f5f9;
 display: flex;
 align-items: center;
 gap: 0.4rem;
}

.mkt-objective-sub {
 font-size: 0.74rem;
 color: #94a3b8;
 margin-top: 0.35rem;
 line-height: 1.35;
}

/* Live Meta Feed Ad Simulator Mockup (Facebook / Instagram) */
.meta-feed-mockup {
 background: #18191a;
 border: 1px solid #3a3b3c;
 border-radius: 0.85rem;
 overflow: hidden;
 box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.65);
 color: #e4e6eb;
 font-family: -apple-system, BlinkMacSystemFont,  Segoe UI, Roboto, Helvetica, Arial, sans-serif;
 position: sticky;
 top: 5rem;
}

.meta-feed-badge-top {
 background: rgba(59, 130, 246, 0.15);
 border-bottom: 1px solid rgba(59, 130, 246, 0.25);
 padding: 0.45rem 1rem;
 display: flex;
 justify-content: space-between;
 align-items: center;
 font-size: 0.72rem;
 font-weight: 700;
 color: #60a5fa;
 text-transform: uppercase;
 letter-spacing: 0.05em;
}

.meta-feed-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 padding: 0.75rem 1rem;
}

.meta-feed-profile {
 display: flex;
 align-items: center;
 gap: 0.65rem;
}

.meta-avatar {
 width: 40px;
 height: 40px;
 border-radius: 50%;
 background: linear-gradient(135deg, #0064e0, #25f4ee);
 display: flex;
 align-items: center;
 justify-content: center;
 font-weight: 800;
 color: #fff;
 font-size: 1rem;
 flex-shrink: 0;
}

.meta-name-box {
 line-height: 1.25;
}

.meta-page-name {
 font-size: 0.88rem;
 font-weight: 700;
 color: #e4e6eb;
 display: flex;
 align-items: center;
 gap: 0.35rem;
}

.meta-sponsored-tag {
 font-size: 0.72rem;
 color: #b0b3b8;
 display: flex;
 align-items: center;
 gap: 0.25rem;
 margin-top: 0.15rem;
}

.meta-dots {
 color: #b0b3b8;
 cursor: pointer;
 font-size: 1.1rem;
}

.meta-feed-copy {
 padding: 0 1rem 0.75rem 1rem;
 font-size: 0.88rem;
 line-height: 1.45;
 color: #e4e6eb;
 word-break: break-word;
 white-space: pre-line;
}

.meta-feed-media {
 width: 100%;
 height: 220px;
 background: #242526;
 overflow: hidden;
 position: relative;
 display: flex;
 align-items: center;
 justify-content: center;
}

.meta-feed-media img {
 width: 100%;
 height: 100%;
 object-fit: cover;
}

.meta-feed-linkbar {
 background: #242526;
 padding: 0.75rem 1rem;
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 0.75rem;
 border-top: 1px solid #3a3b3c;
}

.meta-link-info {
 flex: 1;
 min-width: 0;
}

.meta-link-domain {
 font-size: 0.7rem;
 text-transform: uppercase;
 color: #b0b3b8;
 letter-spacing: 0.03em;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}

.meta-link-headline {
 font-size: 0.95rem;
 font-weight: 700;
 color: #e4e6eb;
 line-height: 1.3;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}

.meta-link-desc {
 font-size: 0.75rem;
 color: #b0b3b8;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
 margin-top: 0.15rem;
}

.meta-feed-cta-btn {
 background: #3a3b3c;
 color: #e4e6eb;
 border: none;
 border-radius: 0.35rem;
 padding: 0.45rem 0.9rem;
 font-size: 0.8rem;
 font-weight: 700;
 cursor: pointer;
 flex-shrink: 0;
 transition: background 0.15s ease;
}

.meta-feed-cta-btn:hover {
 background: #4e4f50;
}

.meta-feed-reactions {
 padding: 0.6rem 1rem;
 display: flex;
 justify-content: space-between;
 align-items: center;
 border-top: 1px solid #3a3b3c;
 font-size: 0.78rem;
 color: #b0b3b8;
}

.meta-feed-actions {
 display: flex;
 justify-content: space-around;
 padding: 0.45rem 0;
 border-top: 1px solid #3a3b3c;
 font-size: 0.82rem;
 color: #b0b3b8;
 font-weight: 600;
}

.meta-feed-action-btn {
 display: flex;
 align-items: center;
 gap: 0.4rem;
 cursor: pointer;
 padding: 0.35rem 0.65rem;
 border-radius: 0.35rem;
}

.meta-feed-action-btn:hover {
 background: #3a3b3c;
}

/* Boost Post Cards Grid & Studio */
.boost-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    max-height: 440px;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.boost-posts-grid::-webkit-scrollbar {
    width: 6px;
}

.boost-posts-grid::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 9999px;
}

.boost-posts-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
}

.boost-posts-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.boost-post-card {
    background: rgba(11, 15, 25, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.85rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.boost-post-card:hover {
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.boost-post-card.selected {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.08);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.35), 0 8px 25px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.boost-post-thumb {
    height: 125px;
    width: 100%;
    object-fit: cover;
    background: #1e293b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: block;
}

.boost-post-text-banner {
    height: 95px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.boost-post-info {
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.boost-platform-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
}

.boost-platform-fb {
    background: rgba(24, 119, 242, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(24, 119, 242, 0.35);
}

.boost-platform-ig {
    background: rgba(225, 48, 108, 0.15);
    color: #f472b6;
    border: 1px solid rgba(225, 48, 108, 0.35);
}

.boost-platform-li {
    background: rgba(10, 102, 194, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(10, 102, 194, 0.35);
}

.boost-platform-tt {
    background: rgba(0, 242, 254, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(0, 242, 254, 0.35);
}

.boost-status-pill {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
}

.boost-status-published {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.boost-status-other {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.btn-boost-select {
    width: 100%;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.boost-post-card:not(.selected) .btn-boost-select {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #c084fc;
}

.boost-post-card:not(.selected) .btn-boost-select:hover {
    background: rgba(168, 85, 247, 0.3);
    border-color: #a855f7;
    color: #fff;
}

.boost-post-card.selected .btn-boost-select {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    border: 1px solid transparent;
    color: #fff;
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.3);
}


/* Conversions API (CAPI) Components */
.capi-presets-container {
 display: flex;
 gap: 0.5rem;
 flex-wrap: wrap;
 margin-bottom: 1.25rem;
}

.capi-preset-btn {
 background: rgba(30, 41, 59, 0.7);
 border: 1px solid rgba(255, 255, 255, 0.12);
 color: #f1f5f9;
 padding: 0.45rem 0.8rem;
 border-radius: 0.5rem;
 font-size: 0.8rem;
 cursor: pointer;
 transition: all 0.2s ease;
 display: inline-flex;
 align-items: center;
 gap: 0.35rem;
 user-select: none;
}

.capi-preset-btn:hover {
 background: rgba(245, 158, 11, 0.18);
 border-color: #f59e0b;
 color: #fef3c7;
 transform: translateY(-1px);
}

.capi-crypto-card {
 background: rgba(6, 8, 14, 0.7);
 border: 1px solid rgba(16, 185, 129, 0.25);
 border-radius: 0.75rem;
 padding: 1rem;
 margin-bottom: 1.25rem;
}

.capi-crypto-title {
 font-size: 0.8rem;
 font-weight: 700;
 color: #34d399;
 display: flex;
 align-items: center;
 gap: 0.4rem;
 margin-bottom: 0.75rem;
}

.capi-crypto-row {
 display: grid;
 grid-template-columns: 1fr auto 1.4fr;
 gap: 0.75rem;
 align-items: center;
 margin-bottom: 0.6rem;
 font-size: 0.78rem;
}

@media (max-width: 640px) {
 .capi-crypto-row {
 grid-template-columns: 1fr;
 }
}

.capi-raw-box {
 background: rgba(239, 68, 68, 0.1);
 border: 1px dashed rgba(239, 68, 68, 0.3);
 color: #fca5a5;
 padding: 0.4rem 0.6rem;
 border-radius: 0.4rem;
 font-family: monospace;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}

.capi-hashed-box {
 background: rgba(16, 185, 129, 0.1);
 border: 1px solid rgba(16, 185, 129, 0.3);
 color: #6ee7b7;
 padding: 0.4rem 0.6rem;
 border-radius: 0.4rem;
 font-family: monospace;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}

.capi-arrow {
 color: #64748b;
 font-weight: bold;
 text-align: center;
}

.capi-json-viewer {
 background: #06080e;
 border: 1px solid rgba(255, 255, 255, 0.1);
 border-radius: 0.75rem;
 padding: 1rem;
 font-family: monospace;
 font-size: 0.82rem;
 color: #4ade80;
 max-height: 280px;
 overflow-y: auto;
 white-space: pre-wrap;
 word-break: break-all;
}
