/* =========================================================
   PHISHGUARD — ADMIN / CAMPAIGNS
   PROFESSIONAL DARK UI
   ========================================================= */

:root {
    --bg: #07090f;
    --bg-soft: #0b0e16;
    --panel: #0d1018;
    --panel-soft: #111520;

    --accent: #3370ff;
    --accent-light: #69b7ff;

    --text: #ffffff;
    --text-soft: #a9afbd;
    --text-muted: #666d7c;

    --border: rgba(255, 255, 255, 0.09);
    --border-soft: rgba(255, 255, 255, 0.055);

    --success: #48e38b;
    --danger: #ff6262;

    --radius: 14px;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 75% 0%,
            rgba(51, 112, 255, 0.075),
            transparent 34%
        ),
        var(--bg);

    color: var(--text);

    font-family: "Poppins", sans-serif;

    overflow-x: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}


/* =========================================================
   BACKGROUND
   ========================================================= */

body::before {
    content: "";

    position: fixed;

    inset: 0;

    pointer-events: none;

    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px
        );

    background-size: 44px 44px;

    mask-image:
        linear-gradient(
            to bottom,
            black 0%,
            rgba(0, 0, 0, 0.65) 55%,
            transparent 100%
        );

    z-index: -2;
}

body::after {
    content: "";

    position: fixed;

    width: 520px;
    height: 520px;

    top: -280px;
    right: 12%;

    border-radius: 50%;

    background: rgba(51, 112, 255, 0.12);

    filter: blur(150px);

    pointer-events: none;

    z-index: -1;
}


/* =========================================================
   MAIN ADMIN AREA
   ========================================================= */

.dashboard-main {
    min-width: 0;
    width: 100%;
}

.dashboard-content {
    width: min(1180px, calc(100% - 64px));

    margin: 0 auto;

    padding-bottom: 70px;

    min-width: 0;
}


/* =========================================================
   PAGE HEADING
   ========================================================= */

.page-heading {
    width: 100%;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 32px;

    margin-bottom: 28px;
}

.page-heading > div:first-child {
    min-width: 0;
}

.section-label {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    color: var(--accent-light);

    font-family: "JetBrains Mono", monospace;

    font-size: 8px;

    font-weight: 500;

    letter-spacing: 0.14em;

    text-transform: uppercase;
}

.section-label span {
    width: 5px;
    height: 5px;

    flex: 0 0 5px;

    border-radius: 50%;

    background: var(--accent);

    box-shadow:
        0 0 10px rgba(51, 112, 255, 0.65);
}

.page-heading h2 {
    margin-top: 9px;

    color: var(--text);

    font-size: clamp(26px, 3vw, 34px);

    font-weight: 600;

    line-height: 1.15;

    letter-spacing: -0.045em;
}

.page-heading p {
    max-width: 650px;

    margin-top: 9px;

    color: var(--text-muted);

    font-size: 11px;

    line-height: 1.7;
}


/* =========================================================
   CREATE BUTTON
   ========================================================= */

.create-button {
    min-width: 150px;
    height: 43px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 0 18px;

    border: 1px solid rgba(51, 112, 255, 0.55);

    border-radius: 9px;

    background: var(--accent);

    color: #ffffff;

    font-size: 10px;

    font-weight: 600;

    cursor: pointer;

    white-space: nowrap;

    box-shadow:
        0 12px 30px rgba(51, 112, 255, 0.20);

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.create-button:hover:not(:disabled) {
    transform: translateY(-2px);

    background: #2864ed;

    box-shadow:
        0 16px 36px rgba(51, 112, 255, 0.30);
}

.create-button:active:not(:disabled) {
    transform: translateY(0);
}

.create-button:disabled {
    opacity: 0.6;

    cursor: wait;
}


/* =========================================================
   PANELS
   ========================================================= */

.panel {
    width: 100%;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.035),
            rgba(255, 255, 255, 0.012)
        );

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.012),
        0 25px 70px rgba(0, 0, 0, 0.20);

    overflow: hidden;
}

.panel + .panel {
    margin-top: 22px;
}


/* =========================================================
   PANEL HEADER
   ========================================================= */

.panel-header {
    width: 100%;

    min-height: 76px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 24px;

    padding: 20px 26px;

    border-bottom: 1px solid var(--border-soft);
}

.panel-header h3 {
    margin-top: 6px;

    color: var(--text);

    font-size: 17px;

    font-weight: 600;

    line-height: 1.3;

    letter-spacing: -0.03em;
}


/* =========================================================
   CAMPAIGN BUILDER
   ========================================================= */

.campaign-builder {
    width: 100%;

    padding-bottom: 26px;
}

.campaign-builder form {
    width: 100%;

    padding: 28px;
}


/* =========================================================
   FORM GRID
   ========================================================= */

.form-grid {
    display: grid;

    width: 100%;

    gap: 20px;
}

.form-grid.two-columns {
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);
}


/* =========================================================
   FORM GROUP
   ========================================================= */

.form-group {
    width: 100%;

    min-width: 0;

    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    color: #bfc3cf;

    font-family: "JetBrains Mono", monospace;

    font-size: 8px;

    font-weight: 500;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}


/* =========================================================
   INPUTS
   ========================================================= */

.form-group input,
.form-group select,
.form-group textarea {
    display: block;

    width: 100%;

    min-width: 0;

    outline: none;

    border: 1px solid rgba(255, 255, 255, 0.09);

    border-radius: 9px;

    background:
        rgba(0, 0, 0, 0.22);

    color: #ffffff;

    font-family: "Poppins", sans-serif;

    font-size: 10px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.form-group input,
.form-group select {
    height: 44px;

    padding: 0 13px;
}

.form-group textarea {
    min-height: 112px;

    padding: 12px 13px;

    resize: vertical;

    line-height: 1.65;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #505663;

    opacity: 1;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(51, 112, 255, 0.60);

    background:
        rgba(0, 0, 0, 0.28);

    box-shadow:
        0 0 0 3px rgba(51, 112, 255, 0.08);
}


/* =========================================================
   SELECT
   ========================================================= */

.form-group select {
    appearance: none;
    -webkit-appearance: none;

    padding-right: 42px;

    cursor: pointer;

    background-image:
        linear-gradient(
            45deg,
            transparent 50%,
            #7c8290 50%
        ),
        linear-gradient(
            135deg,
            #7c8290 50%,
            transparent 50%
        );

    background-position:
        calc(100% - 17px) 18px,
        calc(100% - 12px) 18px;

    background-size:
        5px 5px,
        5px 5px;

    background-repeat: no-repeat;
}

.form-group select option {
    background: #11141c;

    color: #ffffff;
}


/* =========================================================
   GENERATOR SECTION
   ========================================================= */

.generator-section {
    width: 100%;

    margin: 4px 0 24px;

    padding: 22px;

    border: 1px solid rgba(51, 112, 255, 0.18);

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            rgba(51, 112, 255, 0.055),
            rgba(255, 255, 255, 0.012)
        );

    box-shadow:
        inset 0 0 30px rgba(51, 112, 255, 0.018);
}

.generator-heading {
    width: 100%;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.generator-heading h4 {
    margin-top: 6px;

    color: #ffffff;

    font-size: 14px;

    font-weight: 600;

    letter-spacing: -0.025em;
}

.generator-status {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 25px;

    padding: 0 11px;

    border: 1px solid rgba(72, 227, 139, 0.20);

    border-radius: 999px;

    background: rgba(72, 227, 139, 0.05);

    color: var(--success);

    font-family: "JetBrains Mono", monospace;

    font-size: 7px;

    letter-spacing: 0.08em;

    text-transform: uppercase;

    white-space: nowrap;
}


/* =========================================================
   GENERATE CONTENT BUTTON
   ========================================================= */

#generateContentButton {
    width: 100%;

    min-height: 42px;

    margin-top: 2px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    border: 1px solid rgba(51, 112, 255, 0.35);

    border-radius: 9px;

    background:
        rgba(51, 112, 255, 0.09);

    color: var(--accent-light);

    font-family: "Poppins", sans-serif;

    font-size: 10px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

#generateContentButton:hover:not(:disabled) {
    background:
        rgba(51, 112, 255, 0.16);

    border-color:
        rgba(51, 112, 255, 0.55);

    transform: translateY(-1px);
}

#generateContentButton:active:not(:disabled) {
    transform: translateY(0);
}

#generateContentButton:disabled {
    opacity: 0.55;

    cursor: wait;
}


/* =========================================================
   CHECKBOX
   ========================================================= */

.checkbox-row {
    width: fit-content;

    display: flex;

    align-items: center;

    gap: 9px;

    margin-top: 3px;
    margin-bottom: 20px;

    color: var(--text-soft);

    font-size: 10px;

    cursor: pointer;
}

.checkbox-row input {
    width: 14px;
    height: 14px;

    flex: 0 0 14px;

    margin: 0;

    accent-color: var(--accent);

    cursor: pointer;
}

.checkbox-row span {
    user-select: none;
}


/* =========================================================
   CREATE ACTION
   ========================================================= */

#createButton {
    min-width: 155px;

    min-height: 43px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 9px;

    padding: 0 18px;

    border: 1px solid rgba(51, 112, 255, 0.55);

    border-radius: 9px;

    background: var(--accent);

    color: #ffffff;

    font-size: 10px;

    font-weight: 600;

    cursor: pointer;

    box-shadow:
        0 10px 28px rgba(51, 112, 255, 0.20);

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

#createButton:hover:not(:disabled) {
    transform: translateY(-2px);

    background: #2864ed;

    box-shadow:
        0 15px 34px rgba(51, 112, 255, 0.30);
}

#createButton:disabled {
    opacity: 0.62;

    cursor: wait;
}

#createText {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;
}

#createLoader {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;
}

#createLoader[hidden] {
    display: none;
}


/* =========================================================
   BUTTON SPINNER
   ========================================================= */

#createLoader i {
    animation: campaignSpin 0.8s linear infinite;
}

@keyframes campaignSpin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   GENERATED LINK
   ========================================================= */

#linkResult {
    width: 100%;

    margin-top: 22px;

    padding: 18px;

    border: 1px solid rgba(72, 227, 139, 0.16);

    border-radius: 10px;

    background:
        rgba(72, 227, 139, 0.035);
}

#linkResult[hidden] {
    display: none;
}

#linkResult strong {
    display: block;

    margin-bottom: 8px;

    color: var(--success);

    font-family: "JetBrains Mono", monospace;

    font-size: 8px;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}

#generatedLink {
    display: block;

    width: 100%;

    padding: 11px 12px;

    border: 1px solid var(--border);

    border-radius: 7px;

    background:
        rgba(0, 0, 0, 0.22);

    color: var(--accent-light);

    font-family: "JetBrains Mono", monospace;

    font-size: 9px;

    line-height: 1.6;

    word-break: break-all;
}


/* =========================================================
   EXISTING CAMPAIGNS
   ========================================================= */

.campaign-list {
    width: 100%;

    margin-top: 22px;
}

.campaign-list-header {
    width: 100%;

    min-height: 76px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 20px 26px;

    border-bottom: 1px solid var(--border-soft);
}

.campaign-list-header h3 {
    color: #ffffff;

    font-size: 17px;

    font-weight: 600;

    letter-spacing: -0.03em;
}

.campaign-count {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 27px;

    padding: 0 11px;

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.025);

    color: var(--text-soft);

    font-family: "JetBrains Mono", monospace;

    font-size: 8px;

    letter-spacing: 0.05em;

    white-space: nowrap;
}


/* =========================================================
   CAMPAIGN ITEM
   ========================================================= */

.campaign-item {
    width: 100%;

    min-height: 92px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 28px;

    padding: 20px 26px;

    border-bottom: 1px solid var(--border-soft);

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.campaign-item:last-child {
    border-bottom: none;
}

.campaign-item:hover {
    background:
        rgba(51, 112, 255, 0.025);
}

.campaign-item-main {
    flex: 1 1 auto;

    min-width: 0;
}

.campaign-item-title {
    display: block;

    max-width: 100%;

    overflow: hidden;

    color: #ffffff;

    font-size: 12px;

    font-weight: 600;

    line-height: 1.45;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.campaign-item-meta {
    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 8px;

    margin-top: 7px;

    color: var(--text-muted);

    font-family: "JetBrains Mono", monospace;

    font-size: 8px;

    line-height: 1.5;
}

.campaign-item-meta span {
    display: inline-flex;

    align-items: center;

    gap: 5px;
}

.campaign-item-meta .platform {
    color: var(--text-soft);
}

.campaign-item-meta .date {
    color: var(--text-muted);
}


/* =========================================================
   CAMPAIGN ACTIONS
   ========================================================= */

.campaign-item-actions {
    flex: 0 0 auto;

    display: flex;

    align-items: center;
    justify-content: flex-end;

    gap: 9px;

    min-width: 170px;
}


/* =========================================================
   STATUS BADGE
   ========================================================= */

.status-badge {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 25px;

    padding: 0 10px;

    border-radius: 999px;

    font-family: "JetBrains Mono", monospace;

    font-size: 7px;

    font-weight: 500;

    letter-spacing: 0.06em;

    text-transform: uppercase;

    white-space: nowrap;
}

.status-badge.active {
    border: 1px solid rgba(72, 227, 139, 0.18);

    background:
        rgba(72, 227, 139, 0.06);

    color: var(--success);
}

.status-badge.inactive {
    border: 1px solid rgba(255, 255, 255, 0.10);

    background:
        rgba(255, 255, 255, 0.035);

    color: var(--text-muted);
}


/* =========================================================
   CAMPAIGN LINK BUTTON
   ========================================================= */

.campaign-link {
    min-width: 108px;

    height: 34px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 0 12px;

    border: 1px solid rgba(51, 112, 255, 0.25);

    border-radius: 8px;

    background:
        rgba(51, 112, 255, 0.05);

    color: var(--accent-light);

    font-size: 8px;

    font-weight: 500;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.campaign-link:hover {
    background:
        rgba(51, 112, 255, 0.12);

    border-color:
        rgba(51, 112, 255, 0.45);

    transform: translateY(-1px);
}

.campaign-link.disabled {
    color: var(--text-muted);

    border-color:
        rgba(255, 255, 255, 0.07);

    background:
        rgba(255, 255, 255, 0.018);

    cursor: default;
}

.campaign-link.disabled:hover {
    transform: none;

    background:
        rgba(255, 255, 255, 0.018);
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    width: 100%;

    min-height: 220px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 12px;

    padding: 50px 20px;

    text-align: center;

    color: var(--text-muted);

    font-family: "JetBrains Mono", monospace;

    font-size: 8px;

    letter-spacing: 0.04em;
}

.empty-state i {
    width: 42px;
    height: 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);

    border-radius: 11px;

    background:
        rgba(255, 255, 255, 0.025);

    color: var(--text-muted);

    font-size: 15px;
}


/* =========================================================
   LOADING STATE
   ========================================================= */

.campaign-loading {
    width: 100%;

    min-height: 180px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: var(--text-muted);

    font-family: "JetBrains Mono", monospace;

    font-size: 8px;
}

.campaign-loading i {
    margin-right: 8px;

    color: var(--accent-light);

    animation: campaignSpin 0.8s linear infinite;
}


/* =========================================================
   ERROR STATE
   ========================================================= */

.campaign-error {
    width: 100%;

    min-height: 180px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 9px;

    padding: 40px 20px;

    text-align: center;
}

.campaign-error i {
    width: 42px;
    height: 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 98, 98, 0.16);

    border-radius: 11px;

    background: rgba(255, 98, 98, 0.035);

    color: var(--danger);
}

.campaign-error strong {
    color: #ffffff;

    font-size: 10px;
}

.campaign-error span {
    color: var(--text-muted);

    font-family: "JetBrains Mono", monospace;

    font-size: 7px;
}


/* =========================================================
   FOOTER / EDUCATIONAL NOTE
   ========================================================= */

.educational-note {
    width: 100%;

    margin-top: 20px;

    padding: 18px 20px;

    display: flex;

    align-items: center;

    gap: 12px;

    border: 1px solid rgba(51, 112, 255, 0.15);

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            rgba(51, 112, 255, 0.035),
            rgba(255, 255, 255, 0.012)
        );
}

.educational-note i {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background:
        rgba(51, 112, 255, 0.08);

    color: var(--accent-light);

    font-size: 13px;
}

.educational-note strong {
    display: block;

    color: #ffffff;

    font-size: 10px;

    font-weight: 600;
}

.educational-note span {
    display: block;

    margin-top: 3px;

    color: var(--text-muted);

    font-size: 8px;

    line-height: 1.5;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.10);

    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.16);
}


/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 1100px) {

    .dashboard-content {
        width: min(100% - 42px, 1000px);
    }

    .campaign-item-actions {
        min-width: 150px;
    }

}


/* =========================================================
   RESPONSIVE — 900px
   ========================================================= */

@media (max-width: 900px) {

    .dashboard-content {
        width: calc(100% - 32px);
    }

    .page-heading {
        align-items: flex-start;

        flex-direction: column;

        gap: 18px;
    }

    .create-button {
        width: 100%;
    }

    .form-grid.two-columns {
        grid-template-columns: 1fr;
    }

    .campaign-item {
        align-items: flex-start;

        flex-direction: column;

        gap: 16px;
    }

    .campaign-item-actions {
        width: 100%;

        min-width: 0;

        justify-content: flex-start;
    }

}


/* =========================================================
   RESPONSIVE — 600px
   ========================================================= */

@media (max-width: 600px) {

    .dashboard-content {
        width: calc(100% - 24px);

        padding-bottom: 45px;
    }

    .page-heading {
        margin-bottom: 20px;
    }

    .page-heading h2 {
        font-size: 25px;
    }

    .page-heading p {
        font-size: 10px;
    }

    .panel-header,
    .campaign-list-header {
        min-height: 68px;

        padding: 18px;
    }

    .campaign-builder form {
        padding: 18px;
    }

    .generator-section {
        padding: 16px;
    }

    .generator-heading {
        align-items: flex-start;

        flex-direction: column;

        gap: 12px;
    }

    .generator-status {
        align-self: flex-start;
    }

    .campaign-item {
        padding: 18px;
    }

    .campaign-item-title {
        white-space: normal;
    }

    .campaign-item-actions {
        align-items: stretch;

        flex-direction: column;
    }

    .campaign-link {
        width: 100%;
    }

    .status-badge {
        width: fit-content;
    }

    #createButton {
        width: 100%;
    }

    .educational-note {
        align-items: flex-start;
    }

}


/* =========================================================
   RESPONSIVE — 420px
   ========================================================= */

@media (max-width: 420px) {

    .dashboard-content {
        width: calc(100% - 18px);
    }

    .panel-header,
    .campaign-list-header,
    .campaign-builder form {
        padding-left: 15px;
        padding-right: 15px;
    }

    .generator-section {
        padding: 14px;
    }

    .form-group input,
    .form-group select {
        height: 42px;
    }

}