/* ==========================================
   PRIMEFORGE SMART CAMPAIGN
   ENTERPRISE / HIGH-CONTRAST SYSTEM
========================================== */


/* ==========================================
   PAGE
========================================== */

.campaign-page {

    width: auto;
    min-width: 0;
    min-height: 100vh;

    margin-left: 260px;

    padding: 30px 32px 44px;

    overflow-x: hidden;
    overflow-y: auto;
}


/* ==========================================
   HEADER
========================================== */

.campaign-header {

    position: relative;

    max-width: 1500px;

    margin: 0 auto 24px;

    padding-bottom: 18px;

    border-bottom: 1px solid var(--border);
}

.campaign-header h1 {

    margin: 0;

    color: var(--text);

    font-size: 29px;

    line-height: 1.2;

    font-weight: 700;

    letter-spacing: -.025em;
}

.campaign-header p {

    margin-top: 8px;

    color: var(--muted);

    font-size: 12px;

    line-height: 1.6;
}


/* ==========================================
   PRO BILLING ACTION
========================================== */

.campaign-header-actions {

    position: absolute;

    top: 0;

    right: 0;

    display: flex;

    align-items: center;

    justify-content: flex-end;
}

.campaign-billing-button {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 34px;

    padding: 0 13px;

    background: var(--surface-2);

    color: var(--text);

    border: 1px solid var(--border);

    border-radius: 3px;

    text-decoration: none;

    font-size: 11px;

    font-weight: 700;

    letter-spacing: .03em;

    transition: background-color .16s ease, border-color .16s ease;
}

.campaign-billing-button:hover {

    background: var(--surface-hover);

    border-color: var(--border-strong);

}

/* ==========================================
   MAIN GRID
========================================== */

.campaign-grid {

    width: 100%;

    max-width: 1500px;

    height: calc(100vh - 140px);

    min-height: 0;

    margin: 0 auto;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr) minmax(0, 1fr);

    gap: 18px;

    align-items: stretch;
}


/* ==========================================
   PRIMARY PANELS
========================================== */

.campaign-builder,
.campaign-preview {

    min-width: 0;
    min-height: 0;
    height: 100%;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 4px;

    box-shadow: none;
}


/* ==========================================
   LEFT PANEL
========================================== */

.campaign-builder {

    padding: 24px;

    display: flex;

    flex-direction: column;

    overflow: hidden;
}

.campaign-builder>h2,
.campaign-preview>h2 {

    margin: 0 0 20px;

    color: var(--text);

    font-size: 12px;

    line-height: 1;

    font-weight: 750;

    letter-spacing: .14em;

    text-transform: uppercase;
}


/* ==========================================
   WIZARD
========================================== */

#wizard {

    min-height: 0;

    flex: 1 1 auto;

    display: flex;

    flex-direction: column;

    gap: 18px;

    overflow: hidden;
}


/* ==========================================
   PROGRESS
========================================== */

#wizardProgress {

    margin: 0 0 2px;
}

.progress-bar {

    width: 100%;

    height: 4px;

    background: var(--surface-3);

    border-radius: 0;

    overflow: hidden;
}

#progressFill {

    width: 10%;

    height: 100%;

    background: var(--text);

    transition: width .3s ease;
}

#stepText {

    display: block;

    margin-top: 8px;

    color: var(--muted);

    font-size: 10px;

    line-height: 1;

    font-weight: 650;

    letter-spacing: .1em;

    text-transform: uppercase;
}


/* ==========================================
   WIZARD CONTENT
========================================== */

#wizardContent {

    min-height: 0;

    flex: 1 1 auto;

    padding: 24px;

    background: var(--surface-2);

    border: 1px solid var(--border);

    border-radius: 3px;

    display: flex;

    flex-direction: column;

    gap: 16px;

    overflow-y: auto;

    overflow-x: hidden;

    scrollbar-width: none;

    -ms-overflow-style: none;

    overscroll-behavior: contain;
}

#wizardContent::-webkit-scrollbar {

    width: 0;

    height: 0;

    display: none;
}


#wizardContent h2 {

    margin: 0;

    color: var(--text);

    font-size: 24px;

    line-height: 1.2;

    font-weight: 700;
}

#wizardContent h3 {

    margin: 0;

    color: var(--text);

    font-size: 22px;

    line-height: 1.25;

    font-weight: 700;
}

#wizardContent p {

    color: var(--muted);

    font-size: 12px;

    line-height: 1.7;
}

.wizard-subtitle {

    margin-top: -4px;

    color: var(--muted);

    font-size: 12px;
}


/* ==========================================
   WIZARD INPUTS
========================================== */

#wizardContent input,
#wizardContent textarea,
#wizardContent select {

    width: 100%;

    padding: 12px 13px;

    background: var(--input-bg);

    color: var(--text);

    border: 1px solid var(--input-border);

    border-radius: 3px;

    outline: none;

    font-size: 13px;

    line-height: 1.5;

    transition:
        border-color .16s ease,
        background-color .16s ease;
}

#wizardContent textarea {

    min-height: 130px;

    resize: vertical;
}

#wizardContent input::placeholder,
#wizardContent textarea::placeholder {

    color: var(--subtle);
}

#wizardContent input:hover,
#wizardContent textarea:hover,
#wizardContent select:hover {

    border-color: var(--border-strong);
}

#wizardContent input:focus,
#wizardContent textarea:focus,
#wizardContent select:focus {

    border-color: var(--text);

    background: var(--surface-3);

    box-shadow: 0 0 0 2px var(--focus-ring);
}


/* ==========================================
   OPTION CARDS
========================================== */

.option-grid {

    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(140px, 1fr));

    gap: 8px;

    margin-top: 8px;
}

.option-card {

    min-height: 52px;

    padding: 12px;

    background: var(--surface-3);

    color: var(--text);

    border: 1px solid var(--border);

    border-radius: 3px;

    cursor: pointer;

    text-align: left;

    font-size: 12px;

    font-weight: 650;

    transition:
        background-color .16s ease,
        border-color .16s ease,
        color .16s ease;
}

.option-card:hover {

    background: var(--surface-hover);

    border-color: var(--border-strong);

    transform: none;
}

.option-card.selected {

    background: var(--text);

    color: var(--bg);

    border-color: var(--text);

    box-shadow: none;
}


/* ==========================================
   CAMPAIGN CHOOSER
========================================== */

.campaign-card-grid {

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 8px;

    margin-top: 20px;
}

.campaign-card {

    min-width: 0;

    min-height: 210px;

    padding: 14px 12px;

    background: var(--surface-3);

    border: 1px solid var(--border);

    border-radius: 3px;

    cursor: pointer;

    display: flex;

    flex-direction: column;

    justify-content: flex-start;

    transition:
        background-color .16s ease,
        border-color .16s ease;
}

.campaign-card:hover {

    background: var(--surface-hover);

    border-color: var(--border-strong);

    transform: none;
}

.campaign-card.active {

    background: var(--text);

    color: var(--bg);

    border-color: var(--text);

    box-shadow: none;
}

.campaign-icon {

    margin-bottom: 18px;

    font-size: 30px;

    line-height: 1;
}

.campaign-card h3 {

    margin-bottom: 8px;

    color: inherit;

    font-size: 19px;

    line-height: 1.15;

    font-weight: 700;
}

.campaign-card p {

    color: var(--muted);

    font-size: 11px;

    line-height: 1.5;
}

.campaign-card.active p {

    color: #666;
}


/* ==========================================
   WIZARD BUTTONS
========================================== */

.wizardButtons {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;
}

.wizardButtons button {

    min-width: 110px;

    padding: 11px 14px;

    background: transparent;

    color: var(--text);

    border: 1px solid var(--border-strong);

    border-radius: 3px;

    cursor: pointer;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: .08em;

    text-transform: uppercase;

    transition:
        background-color .16s ease,
        color .16s ease,
        border-color .16s ease;
}

.wizardButtons button:hover {

    background: var(--text);

    color: var(--bg);

    border-color: var(--text);

    transform: none;
}


/* ==========================================
   FORGE BUTTON
========================================== */

#forgeCampaign {

    width: 100%;

    margin-top: 16px;

    padding: 13px 14px;

    background: var(--button-bg);

    color: var(--button-text);

    border: 1px solid var(--border-strong);

    border-radius: 3px;

    cursor: pointer;

    font-size: 11px;

    font-weight: 750;

    letter-spacing: .08em;

    text-transform: uppercase;

    transition:
        background-color .16s ease,
        color .16s ease;
}

#forgeCampaign:hover {

    background: var(--button-hover);

    transform: none;

    box-shadow: none;
}

#forgeCampaign:disabled {

    opacity: .5;

    cursor: not-allowed;
}


/* ==========================================
   RIGHT PREVIEW
========================================== */

.campaign-preview {

    padding: 24px;

    overflow: hidden;

    display: flex;

    flex-direction: column;
}

#campaignChecklist {

    min-width: 0;
    min-height: 0;

    flex: 1 1 auto;

    display: flex;

    flex-direction: column;

    gap: 8px;

    overflow-y: auto;

    overflow-x: hidden;

    max-height: none;

    padding: 0 4px 0 0;

    scrollbar-width: none;

    -ms-overflow-style: none;

    overscroll-behavior: contain;
}

#campaignChecklist::-webkit-scrollbar {

    width: 0;

    height: 0;

    display: none;
}

#campaignChecklist::-webkit-scrollbar-track,
#campaignChecklist::-webkit-scrollbar-thumb {

    background: transparent;

    width: 0;

}


/* ==========================================
   DELIVERABLE HEADER
========================================== */

.deliverable-header {

    padding: 14px;

    background: var(--surface-2);

    border: 1px solid var(--border);

    border-radius: 3px;
}

.deliverable-header h3 {

    margin: 0 0 5px;

    color: var(--text);

    font-size: 13px;
}

.deliverable-header p {

    margin: 0;

    color: var(--muted);

    font-size: 10px;

    letter-spacing: .06em;
}


/* ==========================================
   DELIVERABLE CARD
========================================== */

.deliverable-card {

    flex: 0 0 230px;

    height: 230px;

    min-height: 230px;
    max-height: 230px;

    display: flex;

    flex-direction: column;

    background: var(--surface-2);

    border: 1px solid var(--border);

    border-radius: 3px;

    overflow: hidden;

    transition:
        background-color .16s ease,
        border-color .16s ease;
}

.deliverable-card:hover {

    background: var(--surface-3);

    border-color: var(--border-strong);
}

.deliverable-top {

    display: flex;

    align-items: center;

    justify-content: space-between;

    min-width: 0;
    flex: 0 0 auto;

    gap: 10px;

    padding: 12px 13px;

    border-bottom: 1px solid var(--border);
}

.deliverable-top h3 {

    margin: 0;

    color: var(--text);

    font-size: 12px;

    line-height: 1.3;

    font-weight: 700;
}

.deliverable-actions {

    display: flex;

    align-items: center;

    gap: 4px;
}

.copyDeliverable,
.toggleDeliverable {

    padding: 6px 8px;

    background: transparent;

    color: var(--muted);

    border: 1px solid var(--border);

    border-radius: 2px;

    cursor: pointer;

    font-size: 9px;

    font-weight: 700;

    letter-spacing: .05em;

    text-transform: uppercase;
}

.copyDeliverable:hover,
.toggleDeliverable:hover {

    background: var(--text);

    color: var(--bg);

    border-color: var(--text);
}

.deliverable-body {

    min-height: 0;

    flex: 1 1 auto;

    padding: 13px;

    color: var(--text);

    font-size: 11px;

    line-height: 1.65;

    overflow-y: auto;

    overflow-x: hidden;

    scrollbar-width: none;

    -ms-overflow-style: none;

    overscroll-behavior: contain;
}

.waiting {

    color: var(--muted);

    font-size: 10px;

    letter-spacing: .06em;

    text-transform: uppercase;
}

.generated-text {

    white-space: pre-wrap;

    overflow-wrap: anywhere;
}

.deliverable-body::-webkit-scrollbar {

    width: 0;

    height: 0;

    display: none;
}


/* ==========================================
   DISABLED DELIVERABLE
========================================== */

.deliverable-card.disabled {

    opacity: .5;

    border-style: dashed;
}

.deliverable-card.disabled .deliverable-top {

    border-bottom: 0;
}


/* ==========================================
   REVIEW
========================================== */

.campaign-summary {

    padding: 20px;

    background: var(--surface-3);

    border: 1px solid var(--border);

    border-radius: 3px;
}

.summary-header h2 {

    margin: 0 0 7px;

    color: var(--text);

    font-size: 20px;
}

.summary-header p {

    color: var(--muted);

    font-size: 11px;
}

.summary-section {

    display: flex;

    flex-direction: column;

    gap: 6px;

    margin-top: 18px;
}

.summary-item {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding: 11px 12px;

    background: var(--surface-2);

    border: 1px solid var(--border);

    border-radius: 2px;
}

.summary-label {

    color: var(--muted);

    font-size: 10px;

    font-weight: 650;

    letter-spacing: .07em;

    text-transform: uppercase;
}

.summary-value {

    color: var(--text);

    font-size: 11px;

    font-weight: 650;

    text-align: right;
}

.summary-footer {

    display: flex;

    justify-content: space-between;

    gap: 15px;

    margin-top: 16px;

    padding-top: 14px;

    border-top: 1px solid var(--border);

    color: var(--muted);

    font-size: 11px;
}


/* ==========================================
   UPGRADE MODAL
========================================== */

.upgrade-modal {

    position: fixed;

    inset: 0;

    z-index: 99999;

    display: none;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, .82);

    backdrop-filter: blur(4px);
}

.upgrade-modal.active {

    display: flex;
}

.upgrade-box {

    width: 100%;

    max-width: 520px;

    padding: 26px;

    background: var(--surface);

    border: 1px solid var(--border-strong);

    border-radius: 4px;

    box-shadow: none;
}

.upgrade-header h2 {

    margin: 0 0 8px;

    color: var(--text);

    font-size: 20px;
}

.upgrade-header p {

    color: var(--muted);

    font-size: 12px;

    line-height: 1.6;
}

.upgrade-benefits {

    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 1px;

    margin: 20px 0;

    background: var(--border);

    border: 1px solid var(--border);
}

.upgrade-benefits div {

    padding: 11px;

    background: var(--surface-2);

    color: var(--text);

    font-size: 10px;
}

.upgrade-buttons {

    display: flex;

    gap: 6px;
}

#upgradeNow,
#closeUpgrade {

    flex: 1;

    padding: 11px;

    border-radius: 3px;

    cursor: pointer;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: .08em;

    text-transform: uppercase;
}

#upgradeNow {

    background: var(--button-bg);

    color: var(--button-text);

    border: 1px solid var(--button-bg);
}

#closeUpgrade {

    background: transparent;

    color: var(--text);

    border: 1px solid var(--border-strong);
}


/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 1100px) {

   .campaign-grid {

        grid-template-columns: 1fr;
    }

    .campaign-builder,
    .campaign-preview {

        height: auto;
        min-height: auto;
    }

    .campaign-builder {

        overflow: visible;
    }

    #wizard {

        overflow: visible;
    }

    #wizardContent {

        flex: none;
        min-height: 420px;
    }

    #campaignChecklist {

        flex: none;

        max-height: none;
    }

    .deliverable-card {

        flex: 0 0 230px;
        height: 230px;
        min-height: 230px;
        max-height: 230px;
    }
}

@media (max-width: 900px) {

    .campaign-page {

        margin-left: 0;

        padding: 24px 18px 32px;
    }
}

@media (max-width: 700px) {

    .campaign-header-actions {

        position: static;

        justify-content: flex-start;

        margin-bottom: 14px;
    }


    .campaign-card-grid {

        grid-template-columns: 1fr;
    }

    .campaign-builder,
    .campaign-preview {

        padding: 18px;
    }

    #wizardContent {

        padding: 18px;
    }

    .wizardButtons {

        flex-direction: column-reverse;

        align-items: stretch;
    }

    .wizardButtons button {

        width: 100%;
    }

    .upgrade-benefits {

        grid-template-columns: 1fr;
    }

    .upgrade-buttons {

        flex-direction: column;
    }
}
/* ==========================================
   GENERATED MEDIA DELIVERABLES
========================================== */

.campaign-generated-media {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: #000;
}

.campaign-generated-image {
    height: auto;
    object-fit: contain;
}

.campaign-generated-video {
    max-height: 360px;
    object-fit: contain;
}

.campaign-generated-audio {
    width: 100%;
}

.campaign-media-error {
    color: var(--muted);
}


/* Temporary video gate: keep the deliverable visible without offering generation. */
.coming-soon-deliverable {
    border-color: rgba(120, 150, 190, 0.35);
}

.coming-soon-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 5px 9px;
    border: 1px solid rgba(120, 150, 190, 0.45);
    border-radius: 999px;
    color: var(--text-secondary, #aebbd0);
    font-size: 11px;
    font-weight: 700;
}

.video-coming-soon-message {
    line-height: 1.5;
}
