/* =========================================================
   ADD STORY — THE PURPLE LIBRARY
========================================================= */


:root {
    --add-bg: #160b31;
    --add-panel: rgba(37, 19, 66, 0.78);
    --add-panel-soft: rgba(255, 255, 255, 0.06);

    --add-accent: #ff4fa0;
    --add-purple: #9c55ed;
    --add-lavender: #cfa9ff;

    --add-border: rgba(255, 255, 255, 0.12);

    --add-muted: #d8c8ef;
    --add-muted-soft: #ad98cc;

    --add-shadow:
        0 28px 90px rgba(0, 0, 0, 0.28);
}


/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    color-scheme: dark;
}


body {
    min-height: 100vh;

    font-family: Inter, sans-serif;
    color: white;

    background:
        radial-gradient(
            circle at top,
            #6c3aa0 0%,
            #241246 46%,
            #12091f 100%
        );
}


button,
input,
select,
textarea {
    font: inherit;
}


button {
    cursor: pointer;
}


a {
    color: inherit;
}


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

.add-header-nav {
    position: sticky;

    top: 0;
    z-index: 100;

    min-height: 76px;

    display: grid;

    grid-template-columns:
        auto
        1fr
        auto;

    align-items: center;

    gap: 28px;

    padding:
        0
        42px;

    background: #2d1658;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.08);

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, 0.16);
}


.add-brand {
    display: flex;
    align-items: center;

    gap: 14px;

    color: white;
    text-decoration: none;
}


.add-brand-dot {
    width: 18px;
    height: 18px;

    flex: 0 0 auto;

    border-radius: 50%;

    background:
        var(--add-accent);

    box-shadow:
        0 0 18px
        rgba(255, 79, 160, 0.45);
}


.add-brand > span:last-child {
    display: grid;

    gap: 2px;
}


.add-brand strong {
    color: white;

    font-size: 27px;
    font-weight: 900;

    line-height: 1;

    letter-spacing: -0.04em;
}


.add-brand small {
    color:
        var(--add-muted);

    font-size: 11px;
    font-weight: 800;
}


.add-main-nav {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 28px;
}


.add-main-nav a {
    color: white;

    text-decoration: none;

    font-size: 15px;
    font-weight: 900;
}


.add-main-nav a:hover,
.add-main-nav a.active {
    color:
        var(--add-accent);
}


.add-nav-highlight {
    min-height: 44px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding:
        0
        22px;

    border:
        1px solid
        rgba(207, 169, 255, 0.42);

    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.06);

    color:
        var(--add-accent) !important;
}


.add-auth {
    display: flex;

    align-items: center;
    justify-content: flex-end;

    gap: 18px;
}


.add-auth > a {
    color: white;

    text-decoration: none;

    font-size: 15px;
    font-weight: 900;
}


.add-signup {
    min-height: 48px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding:
        0
        26px;

    border-radius: 999px;

    background:
        var(--add-accent);
}


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

.add-story-shell {
    width:
        min(
            1320px,
            100%
        );

    margin:
        0
        auto;

    padding:
        54px
        32px
        120px;
}


/* =========================================================
   HERO
========================================================= */

.add-story-hero {
    margin-bottom:
        32px;

    padding:
        44px;

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

    border-radius:
        34px;

    background:
        var(--add-panel);

    box-shadow:
        var(--add-shadow);
}


.add-story-kicker {
    min-height: 29px;

    display: inline-flex;

    align-items: center;

    padding:
        0
        11px;

    border-radius:
        999px;

    background:
        #ffe4f1;

    color:
        #9f2f68;

    font-size:
        11px;

    font-weight:
        900;

    letter-spacing:
        0.06em;

    text-transform:
        uppercase;
}


.add-story-hero h1 {
    max-width:
        900px;

    margin-top:
        20px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size:
        clamp(
            52px,
            5vw,
            74px
        );

    line-height:
        0.96;

    letter-spacing:
        -0.055em;
}


.add-story-hero > p {
    max-width:
        780px;

    margin-top:
        18px;

    color:
        var(--add-muted);

    font-size:
        17px;

    line-height:
        1.65;
}


/* =========================================================
   HERO NOTE
========================================================= */

.add-story-hero-note {
    margin-top:
        30px;

    display: grid;

    grid-template-columns:
        auto
        1fr
        auto;

    align-items:
        center;

    gap:
        14px;

    padding:
        16px;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius:
        20px;

    background:
        rgba(255, 255, 255, 0.07);
}


.add-story-hero-note > svg {
    width:
        23px;

    height:
        23px;

    color:
        var(--add-accent);
}


.add-story-hero-note div {
    display:
        grid;

    gap:
        4px;
}


.add-story-hero-note strong {
    font-size:
        14px;
}


.add-story-hero-note span {
    color:
        var(--add-muted);

    font-size:
        12px;

    line-height:
        1.45;
}


.add-story-hero-note a {
    min-height:
        40px;

    display:
        inline-flex;

    align-items:
        center;
    justify-content:
        center;

    padding:
        0
        17px;

    border-radius:
        999px;

    background:
        rgba(255, 255, 255, 0.1);

    color:
        white;

    text-decoration:
        none;

    font-size:
        12px;

    font-weight:
        900;
}


/* =========================================================
   LAYOUT
========================================================= */

.add-story-layout {
    display:
        grid;

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

    align-items:
        start;

    gap:
        24px;
}


.add-story-form {
    display:
        grid;

    gap:
        18px;
}


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

.add-story-card,
.add-sidebar-card {
    border:
        1px solid
        var(--add-border);

    background:
        var(--add-panel);

    box-shadow:
        0 20px 65px
        rgba(0, 0, 0, 0.2);
}


.add-story-card {
    padding:
        30px;

    border-radius:
        28px;
}


.add-sidebar-card {
    padding:
        24px;

    border-radius:
        24px;
}


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

.add-card-heading {
    display:
        flex;

    align-items:
        flex-start;

    gap:
        14px;

    margin-bottom:
        25px;
}


.add-card-icon {
    width:
        44px;

    height:
        44px;

    display:
        flex;

    flex:
        0 0
        auto;

    align-items:
        center;
    justify-content:
        center;

    border-radius:
        15px;

    background:
        var(--add-accent);

    color:
        white;
}


.add-card-icon svg {
    width:
        20px;

    height:
        20px;
}


.add-card-heading > div {
    min-width:
        0;
}


.add-card-kicker,
.add-sidebar-kicker {
    color:
        var(--add-lavender);

    font-size:
        10px;

    font-weight:
        900;

    letter-spacing:
        0.08em;

    text-transform:
        uppercase;
}


.add-card-heading h2 {
    margin-top:
        4px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size:
        29px;

    letter-spacing:
        -0.035em;
}


.add-card-heading p {
    max-width:
        680px;

    margin-top:
        5px;

    color:
        var(--add-muted);

    font-size:
        13px;

    line-height:
        1.5;
}


/* =========================================================
   SOURCE CARDS
========================================================= */

.add-source-options {
    display:
        grid;

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

    gap:
        10px;

    margin-bottom:
        22px;

    border:
        0;
}


.add-source-options legend {
    position:
        absolute;

    width:
        1px;

    height:
        1px;

    overflow:
        hidden;

    clip:
        rect(
            0 0 0 0
        );
}


.add-source-card {
    position:
        relative;

    min-height:
        118px;

    display:
        flex;

    flex-direction:
        column;

    align-items:
        flex-start;
    justify-content:
        center;

    gap:
        5px;

    padding:
        15px;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius:
        18px;

    background:
        rgba(255, 255, 255, 0.055);

    cursor:
        pointer;

    transition:
        transform
        0.16s ease,
        border-color
        0.16s ease,
        background
        0.16s ease;
}


.add-source-card:hover {
    transform:
        translateY(-2px);

    border-color:
        rgba(255, 79, 160, 0.45);
}


.add-source-card:has(input:checked) {
    border-color:
        var(--add-accent);

    background:
        rgba(255, 79, 160, 0.1);
}


.add-source-card input {
    position:
        absolute;

    opacity:
        0;

    pointer-events:
        none;
}


.add-source-icon {
    min-width:
        34px;

    height:
        34px;

    display:
        inline-flex;

    align-items:
        center;
    justify-content:
        center;

    margin-bottom:
        5px;

    padding:
        0
        8px;

    border-radius:
        11px;

    background:
        rgba(255, 79, 160, 0.16);

    color:
        var(--add-accent);

    font-size:
        12px;

    font-weight:
        900;
}


.add-source-icon svg {
    width:
        18px;

    height:
        18px;
}


.add-source-card strong {
    font-size:
        12px;

    line-height:
        1.3;
}


.add-source-card small {
    color:
        var(--add-muted-soft);

    font-size:
        10px;
}


/* =========================================================
   FORM FIELDS
========================================================= */

.add-form-grid {
    display:
        grid;

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

    gap:
        18px;
}


.add-field {
    display:
        grid;

    gap:
        8px;
}


.add-field-wide {
    grid-column:
        1 / -1;
}


.add-field > span {
    color:
        white;

    font-size:
        12px;

    font-weight:
        900;
}


.add-field input,
.add-field select,
.add-field textarea {
    width:
        100%;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius:
        15px;

    outline:
        0;

    background:
        rgba(255, 255, 255, 0.065);

    color:
        white;
}


.add-field input,
.add-field select {
    min-height:
        52px;

    padding:
        0
        14px;
}


.add-field textarea {
    min-height:
        130px;

    padding:
        14px;

    resize:
        vertical;

    line-height:
        1.5;
}


.add-field input:focus,
.add-field select:focus,
.add-field textarea:focus {
    border-color:
        rgba(255, 79, 160, 0.68);

    box-shadow:
        0 0 0 4px
        rgba(255, 79, 160, 0.1);
}


.add-field input::placeholder,
.add-field textarea::placeholder {
    color:
        #9f8abf;
}


.add-field small {
    color:
        var(--add-muted-soft);

    font-size:
        11px;
}


/* =========================================================
   URL ACTION
========================================================= */

.add-url-actions {
    display:
        flex;

    align-items:
        center;

    gap:
        14px;

    margin-top:
        12px;
}


.add-field-help {
    color:
        var(--add-muted-soft);

    font-size:
        11px;

    line-height:
        1.45;
}


/* =========================================================
   OWNERSHIP
========================================================= */

.add-ownership-card p {
    color:
        var(--add-muted);

    font-size:
        13px;

    line-height:
        1.65;
}


.add-ownership-card p + p {
    margin-top:
        13px;
}


.add-ownership-card strong {
    color:
        white;
}


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

.add-primary-button,
.add-secondary-button,
.add-cancel-button {
    min-height:
        48px;

    display:
        inline-flex;

    align-items:
        center;
    justify-content:
        center;

    gap:
        8px;

    padding:
        0
        20px;

    border-radius:
        999px;

    font-size:
        12px;

    font-weight:
        900;

    text-decoration:
        none;
}


.add-primary-button {
    border:
        0;

    background:
        linear-gradient(
            135deg,
            #ff4fa0,
            #a04eff
        );

    color:
        white;

    box-shadow:
        0 12px 28px
        rgba(255, 79, 160, 0.22);
}


.add-secondary-button {
    border:
        1px solid
        rgba(255, 255, 255, 0.14);

    background:
        rgba(255, 255, 255, 0.08);

    color:
        white;
}


.add-cancel-button {
    color:
        var(--add-muted);

    background:
        rgba(255, 255, 255, 0.06);
}


.add-primary-button svg,
.add-secondary-button svg {
    width:
        17px;

    height:
        17px;
}


/* =========================================================
   ACTION BAR
========================================================= */

.add-story-actions {
    display:
        flex;

    justify-content:
        flex-end;

    gap:
        10px;

    padding:
        18px;

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

    border-radius:
        22px;

    background:
        rgba(37, 19, 66, 0.88);

    box-shadow:
        0 18px 50px
        rgba(0, 0, 0, 0.18);
}


/* =========================================================
   STATUS
========================================================= */

.add-story-status {
    padding:
        14px
        16px;

    border:
        1px solid
        rgba(255, 79, 160, 0.28);

    border-radius:
        15px;

    background:
        rgba(255, 79, 160, 0.1);

    color:
        white;

    font-size:
        12px;

    line-height:
        1.5;
}


/* =========================================================
   SIDEBAR
========================================================= */

.add-story-sidebar {
    position:
        sticky;

    top:
        100px;

    display:
        grid;

    gap:
        16px;
}


.add-sidebar-card h2 {
    margin-top:
        8px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size:
        27px;

    line-height:
        1;

    letter-spacing:
        -0.035em;
}


.add-sidebar-card > p {
    margin-top:
        12px;

    color:
        var(--add-muted);

    font-size:
        12px;

    line-height:
        1.6;
}


.add-sidebar-card ul {
    display:
        grid;

    gap:
        11px;

    margin-top:
        18px;

    padding-left:
        18px;

    color:
        var(--add-muted);

    font-size:
        12px;

    line-height:
        1.5;
}


/* =========================================================
   PROCESS
========================================================= */

.add-process-list {
    display:
        grid;

    gap:
        13px;

    margin-top:
        18px;
}


.add-process-list article {
    display:
        flex;

    align-items:
        flex-start;

    gap:
        11px;
}


.add-process-list article > span {
    width:
        28px;

    height:
        28px;

    display:
        flex;

    align-items:
        center;
    justify-content:
        center;

    flex:
        0 0 auto;

    border-radius:
        10px;

    background:
        rgba(255, 79, 160, 0.13);

    color:
        var(--add-accent);

    font-size:
        11px;

    font-weight:
        900;
}


.add-process-list strong {
    font-size:
        12px;
}


.add-process-list p {
    margin-top:
        3px;

    color:
        var(--add-muted-soft);

    font-size:
        10px;

    line-height:
        1.45;
}


/* =========================================================
   CREATOR SIDEBAR
========================================================= */

.add-creator-sidebar a {
    min-height:
        42px;

    display:
        inline-flex;

    align-items:
        center;
    justify-content:
        center;

    margin-top:
        18px;

    padding:
        0
        17px;

    border-radius:
        999px;

    background:
        rgba(255, 255, 255, 0.1);

    color:
        white;

    text-decoration:
        none;

    font-size:
        11px;

    font-weight:
        900;
}


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

@media (max-width: 1100px) {

    .add-header-nav {
        grid-template-columns:
            1fr;

        gap:
            16px;

        padding:
            18px
            24px;
    }


    .add-main-nav {
        justify-content:
            flex-start;

        overflow-x:
            auto;

        padding-bottom:
            4px;
    }


    .add-auth {
        justify-content:
            flex-start;
    }


    .add-story-layout {
        grid-template-columns:
            1fr;
    }


    .add-story-sidebar {
        position:
            static;

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

}


@media (max-width: 760px) {

    .add-story-shell {
        padding:
            34px
            18px
            90px;
    }


    .add-story-hero {
        padding:
            30px
            24px;
    }


    .add-story-hero h1 {
        font-size:
            46px;
    }


    .add-story-hero-note {
        grid-template-columns:
            auto
            1fr;
    }


    .add-story-hero-note a {
        grid-column:
            1 / -1;
    }


    .add-source-options {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }


    .add-form-grid {
        grid-template-columns:
            1fr;
    }


    .add-field-wide {
        grid-column:
            auto;
    }


    .add-url-actions {
        align-items:
            stretch;

        flex-direction:
            column;
    }


    .add-story-sidebar {
        grid-template-columns:
            1fr;
    }


    .add-story-actions {
        flex-direction:
            column-reverse;
    }


    .add-primary-button,
    .add-cancel-button {
        width:
            100%;
    }

}

/* =========================================================
   ADD STORY STATUS STATES
========================================================= */

.add-story-status[data-type="success"] {
    border-color:
        rgba(98, 220, 153, 0.34);

    background:
        rgba(67, 190, 125, 0.11);
}


.add-story-status[data-type="warning"] {
    border-color:
        rgba(255, 197, 92, 0.35);

    background:
        rgba(255, 183, 72, 0.1);
}


.add-story-status[data-type="error"] {
    border-color:
        rgba(255, 90, 130, 0.38);

    background:
        rgba(220, 60, 100, 0.11);
}


.add-story-status[data-type="info"] {
    border-color:
        rgba(180, 140, 245, 0.3);

    background:
        rgba(150, 105, 225, 0.1);
}


.add-primary-button:disabled,
.add-secondary-button:disabled {
    opacity: 0.6;

    cursor: wait;
}


/* Hidden creator-only prompts */

.add-story-hero-note[hidden],
.add-creator-sidebar[hidden] {
    display: none !important;
}

/* =========================================================
   IMPORT CONFIRMATION MODAL
========================================================= */

body.add-confirm-open {
    overflow: hidden;
}

.add-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(14, 6, 31, 0.78);
    backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.add-confirm-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.add-confirm-modal {
    width: min(680px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    background: #fbfaff;
    color: #171224;
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.45);
}

.add-confirm-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 26px;
    background: linear-gradient(135deg, #32185b, #5e2a7e);
    color: white;
}

.add-confirm-header span {
    display: block;
    margin-bottom: 5px;
    color: #d8c8ef;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.add-confirm-header h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    line-height: 1.05;
}

.add-confirm-close {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.11);
    color: white;
    font-size: 25px;
    line-height: 1;
}

.add-confirm-body {
    overflow: auto;
    padding: 26px;
}

.add-confirm-intro {
    margin: 0 0 20px;
    color: #6f617f;
    font-size: 14px;
    line-height: 1.55;
}

.add-confirm-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.add-confirm-summary-item {
    min-width: 0;
    padding: 15px;
    border: 1px solid #eadcff;
    border-radius: 17px;
    background: white;
}

.add-confirm-summary-wide {
    grid-column: 1 / -1;
}

.add-confirm-summary-item > span {
    display: block;
    margin-bottom: 5px;
    color: #8f82a6;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.add-confirm-summary-item strong {
    display: block;
    color: #32185b;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.add-confirm-summary-item a {
    display: block;
    color: #7a4ca5;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.add-confirm-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding: 14px 15px;
    border-radius: 17px;
    background: #fff1d8;
    color: #7a4c08;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
}

.add-confirm-note svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin-top: 1px;
}

.add-confirm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 26px;
    border-top: 1px solid #eadcff;
    background: white;
}

.add-confirm-cancel,
.add-confirm-submit {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.add-confirm-cancel {
    background: #eee5f7;
    color: #5e2a7e;
}

.add-confirm-submit {
    background: linear-gradient(135deg, #ff4fa0, #a04eff);
    color: white;
    box-shadow: 0 10px 26px rgba(255, 79, 160, 0.24);
}

.add-confirm-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.add-confirm-submit svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 620px) {
    .add-confirm-overlay {
        padding: 16px;
    }

    .add-confirm-summary {
        grid-template-columns: 1fr;
    }

    .add-confirm-summary-wide {
        grid-column: auto;
    }

    .add-confirm-footer {
        flex-direction: column-reverse;
    }

    .add-confirm-cancel,
    .add-confirm-submit {
        width: 100%;
    }
}

