/* =========================
   Global
   ========================= */

* {
    box-sizing: border-box;
}

html {
    scrollbar-width: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(
            circle at top left,
            rgba(70, 110, 255, 0.08),
            transparent 35%
        ),
        radial-gradient(
            circle at top right,
            rgba(170, 90, 255, 0.06),
            transparent 30%
        ),
        #111318;

    color: #f1f3f4;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-weight: 500;
}


/* =========================
   Header
   ========================= */

header {
    max-width: 1050px;

    margin: 0 auto;

    padding: 42px 28px 10px;
}

header h1 {
    margin: 0;

    font-size: 32px;
    font-weight: 700;

    letter-spacing: -0.5px;

    background: linear-gradient(
        90deg,
        #8ab4f8,
        #c58af9
    );

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


/* =========================
   Main Layout
   ========================= */

main {
    max-width: 1050px;

    margin: 0 auto;

    padding: 22px 28px 50px;
}

section {
    background-color: #1b1d23;

    border: 1px solid #2a2d35;
    border-radius: 22px;

    padding: 32px;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.25);
}


/* =========================
   Form Layout
   ========================= */

form > div {
    margin-bottom: 24px;
}

label {
    display: block;

    margin-bottom: 9px;

    color: #e1e3e7;

    font-size: 14px;
    font-weight: 700;
}


/* =========================
   Inputs
   ========================= */

input,
textarea {
    width: 100%;

    padding: 13px 15px;

    background-color: #202329;
    color: #f1f3f4;

    border: 1px solid #34373f;
    border-radius: 12px;

    font-size: 14px;
    font-weight: 500;

    outline: none;

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

input:hover,
textarea:hover {
    background-color: #24272e;
}

input:focus,
textarea:focus {
    border-color: #8ab4f8;

    box-shadow:
        0 0 0 3px rgba(138, 180, 248, 0.12);
}


/* =========================
   Status Code
   ========================= */

#statusCode {
    width: 140px;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}


/* =========================
   Text Areas
   ========================= */

textarea {
    resize: vertical;

    font-family:
        "Cascadia Code",
        Consolas,
        "Courier New",
        monospace;

    line-height: 1.55;

    scrollbar-width: none;
}

textarea::-webkit-scrollbar {
    display: none;
}

#headers {
    min-height: 120px;
}

#exploitBody {
    min-height: 360px;
}


/* =========================
   Buttons
   ========================= */

button {
    padding: 11px 18px;

    background-color: #292c33;
    color: #f1f3f4;

    border: 1px solid #3a3d45;
    border-radius: 999px;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

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

button:hover {
    background-color: #343740;
    border-color: #4a4e58;
}

button:active {
    transform: scale(0.98);
}


/* Primary Action */

#storeExploitButton {
    border: none;

    background: linear-gradient(
        90deg,
        #7da9f8,
        #9f8df8
    );

    color: #101217;
}

#storeExploitButton:hover {
    background: linear-gradient(
        90deg,
        #91b7ff,
        #b29cff
    );
}


/* =========================
   Button Row
   ========================= */

.button-row {
    display: flex;

    gap: 10px;

    align-items: center;

    flex-wrap: wrap;

    margin-bottom: 0;
}


/* =========================
   Messages
   ========================= */

#message {
    min-height: 20px;

    margin-top: 18px;

    color: #c0c3c8;

    font-size: 14px;
    font-weight: 600;

    overflow-wrap: anywhere;
    word-break: break-word;
}

#templateMessage {
    min-height: 20px;

    margin: 10px 0 0;

    color: #f28b82;

    font-size: 14px;
    font-weight: 700;
}


/* =========================
   Dialogs
   ========================= */

dialog {
    width: min(520px, 90vw);

    padding: 28px;

    background-color: #1d2026;
    color: #f1f3f4;

    border: 1px solid #353841;
    border-radius: 22px;

    box-shadow:
        0 20px 70px rgba(0, 0, 0, 0.55);
}

dialog::backdrop {
    background-color: rgba(8, 10, 14, 0.7);

    backdrop-filter: blur(4px);
}

dialog h2 {
    margin-top: 0;
    margin-bottom: 24px;

    font-size: 21px;
    font-weight: 700;
}

dialog .button-row {
    margin-top: 18px;
}


/* =========================
   Template List
   ========================= */

#loadTemplateDialog {
    max-height: 85vh;
    overflow: hidden;
}

#templateList {
    display: flex;
    flex-direction: column;

    gap: 8px;

    max-height: 60vh;
    overflow-y: auto;

    margin-bottom: 22px;

    scrollbar-width: none;
}

#templateList::-webkit-scrollbar {
    display: none;
}

.template-row {
    display: flex;

    gap: 8px;

    align-items: stretch;
}

.template-load-button {
    flex: 1;

    width: auto;

    border-radius: 12px;

    text-align: left;

    background-color: #24272d;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.template-load-button:hover {
    background-color: #30343c;
}

.template-delete-button {
    flex-shrink: 0;

    border-radius: 12px;

    color: #f28b82;

    border-color: rgba(242, 139, 130, 0.35);

    background-color: rgba(242, 139, 130, 0.04);
}

.template-delete-button:hover {
    color: #ffaaa2;

    background-color: rgba(242, 139, 130, 0.12);

    border-color: #f28b82;
}


/* =========================
   Logs
   ========================= */

#logsContainer {
    margin-top: 26px;

    overflow: hidden;

    border: 1px solid #2f3239;
    border-radius: 16px;

    background-color: #17191e;
}

.log-entry {
    padding: 16px 18px;

    background-color: #1b1e24;

    border-bottom: 1px solid #2a2d34;

    cursor: pointer;

    font-family:
        "Cascadia Code",
        Consolas,
        monospace;

    font-size: 13px;
    font-weight: 600;

    transition: background-color 0.15s ease;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry:hover {
    background-color: #25282f;
}


/* =========================
   Log Details
   ========================= */

#logDetailsDialog {
    width: min(850px, 92vw);
}

#logDetailsDialog > div {
    margin-bottom: 16px;
}

#logDetailsDialog strong {
    font-weight: 700;
}

pre {
    padding: 16px;

    background-color: #15171c;

    border: 1px solid #30333a;
    border-radius: 14px;

    color: #e1e3e7;

    overflow-x: auto;

    white-space: pre-wrap;
    word-break: break-word;

    font-family:
        "Cascadia Code",
        Consolas,
        monospace;

    font-weight: 500;

    line-height: 1.5;

    scrollbar-width: none;
}

pre::-webkit-scrollbar {
    display: none;
}


/* =========================
   Mobile
   ========================= */

@media (max-width: 700px) {

    header {
        padding: 30px 18px 8px;
    }

    main {
        padding: 18px;
    }

    section {
        padding: 22px;

        border-radius: 18px;
    }

    .button-row {
        flex-direction: column;

        align-items: stretch;
    }

    .button-row button {
        width: 100%;
    }

    #statusCode {
        width: 100%;
    }

    #exploitBody {
        min-height: 280px;
    }

    .template-delete-button {
        padding-left: 14px;
        padding-right: 14px;
    }
}