
/* ==========================================
   INSOMNIA WEBHOOK GENERATOR
   Theme: #A75ED6
========================================== */

:root {
    --bg: #0b0910;
    --panel: #131019;
    --panel-light: #191521;
    --border: rgba(255, 255, 255, 0.085);
    --purple: #A75ED6;
    --purple-light: #c58bea;
    --text: #f5f1fa;
    --muted: #a49aae;
    --green: #54d69a;
    --red: #ff727d;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--purple-light);
    outline-offset: 3px;
}

.background-glow {
    position: fixed;
    z-index: -1;
    top: -280px;
    left: 50%;
    width: 850px;
    height: 600px;
    transform: translateX(-50%);
    pointer-events: none;
    background: radial-gradient(
        ellipse,
        rgba(167, 94, 214, 0.14) 0%,
        rgba(167, 94, 214, 0.045) 40%,
        transparent 72%
    );
}

/* Navigation */

.navbar {
    width: min(1180px, calc(100% - 48px));
    min-height: 92px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    color: inherit;
    text-decoration: none;
}

.logo {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 50px;
    height: 50px;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(167, 94, 214, 0.45);
    border-radius: 15px;
    background: rgba(167, 94, 214, 0.15);
    box-shadow: 0 0 25px rgba(167, 94, 214, 0.08);
}

.logo img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 4px;
    object-fit: contain;
    object-position: center;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-name {
    font-size: 15px;
    font-weight: 850;
    letter-spacing: 2.3px;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.7px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
}

.online-indicator,
.hero-badge-dot,
.footer-dot {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px rgba(84, 214, 154, 0.5);
}

/* Main layout */

.workspace {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.hero {
    max-width: 720px;
    margin: 0 auto;
    padding: 76px 0 56px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 13px;
    border: 1px solid rgba(167, 94, 214, 0.23);
    border-radius: 999px;
    background: rgba(167, 94, 214, 0.075);
    color: #d4b0ed;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--purple);
    box-shadow: 0 0 10px rgba(167, 94, 214, 0.65);
}

.hero h1 {
    margin: 23px 0 18px;
    font-size: clamp(38px, 6vw, 66px);
    font-weight: 850;
    line-height: 1.08;
    letter-spacing: -2.8px;
}

.gradient-text {
    color: var(--purple-light);
    background: linear-gradient(100deg, #d5a9f2, #A75ED6 58%, #9251c3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero > p {
    max-width: 570px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
}

/* Main panels */

.generator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: start;
    gap: 22px;
    padding-bottom: 65px;
}

.panel {
    min-width: 0;
    padding: 27px;
    border: 1px solid var(--border);
    border-radius: 19px;
    background: rgba(19, 16, 25, 0.94);
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.12);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 26px;
}

.panel-heading h2 {
    margin: 7px 0 0;
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -0.5px;
}

.section-label {
    color: var(--purple-light);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.panel-icon {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border: 1px solid rgba(167, 94, 214, 0.25);
    border-radius: 12px;
    background: rgba(167, 94, 214, 0.1);
    color: var(--purple-light);
    font-size: 20px;
}

.import-icon {
    color: var(--purple-light);
    font-family: monospace;
    font-size: 20px;
    font-weight: 800;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 21px;
}

.form-group label {
    color: #e7e0ef;
    font-size: 12px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    background: #0e0c13;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input,
select {
    min-height: 46px;
    padding: 0 14px;
}

textarea {
    min-height: 120px;
    padding: 13px 14px;
    line-height: 1.65;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #665d70;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(167, 94, 214, 0.35);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--purple);
    outline: none;
    box-shadow: 0 0 0 3px rgba(167, 94, 214, 0.1);
}

select {
    cursor: pointer;
}

.field-hint,
.section-description {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
}

.field-hint {
    margin-top: -3px;
}

/* Buttons */

.button-row {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.button {
    display: inline-flex;
    min-height: 45px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        opacity 0.2s ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:active:not(:disabled) {
    transform: translateY(0);
}

.button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.button-primary {
    border-color: rgba(197, 139, 234, 0.3);
    background: linear-gradient(135deg, #b66de0, #8e48bd);
    color: white;
    box-shadow: 0 5px 20px rgba(167, 94, 214, 0.13);
}

.button-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #c27ae9, #9b55c8);
}

.button-secondary {
    border-color: rgba(255, 255, 255, 0.1);
    background: #201a29;
    color: #e9e1f0;
}

.button-secondary:hover:not(:disabled) {
    border-color: rgba(167, 94, 214, 0.45);
    background: #292033;
}

.button-danger {
    border-color: rgba(255, 114, 125, 0.22);
    background: rgba(255, 114, 125, 0.06);
    color: #ff9ca4;
}

.button-danger:hover:not(:disabled) {
    background: rgba(255, 114, 125, 0.12);
}

#generateButton,
#sendButton,
#importButton,
#clearImportButton {
    flex: 1;
}

.status-message {
    min-height: 20px;
    margin-top: 17px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.status-message.success {
    color: var(--green);
}

.status-message.error {
    color: var(--red);
}

.panel-divider {
    height: 1px;
    margin: 28px 0;
    background: var(--border);
}

.import-heading {
    margin-bottom: 12px;
}

.import-heading h2 {
    font-size: 19px;
}

.section-description {
    margin-bottom: 21px;
}

.code-textarea {
    min-height: 210px;
    background: #0c0a10;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    tab-size: 2;
}

/* JSON output */

.format-badge {
    flex-shrink: 0;
    padding: 7px 9px;
    border: 1px solid rgba(167, 94, 214, 0.24);
    border-radius: 7px;
    background: rgba(167, 94, 214, 0.09);
    color: #d6b0f0;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
}

.code-window {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: #0b0910;
}

.code-window-header {
    display: flex;
    min-height: 43px;
    align-items: center;
    gap: 12px;
    padding: 0 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: #141019;
    color: #9f94ad;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 10px;
}

.window-dots {
    display: flex;
    gap: 5px;
}

.window-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e66e76;
}

.window-dots span:nth-child(2) {
    background: #e8b65e;
}

.window-dots span:nth-child(3) {
    background: #62c78b;
}

.json-status {
    margin-left: auto;
    color: var(--green);
    font-family: inherit;
    font-size: 9px;
}

.json-preview {
    min-height: 280px;
    max-height: 470px;
    margin: 0;
    padding: 18px;
    overflow: auto;
    color: #d5c9e3;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    line-height: 1.85;
    tab-size: 2;
    white-space: pre;
}

.json-preview code {
    font-family: inherit;
}

.preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 13px;
    color: var(--muted);
    font-size: 10px;
}

.text-button {
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: var(--purple-light);
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
}

.text-button:hover {
    color: white;
}

.output-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 22px;
}

.button-full {
    width: 100%;
    padding: 0 10px;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 23px;
    padding: 13px;
    border: 1px solid rgba(167, 94, 214, 0.13);
    border-radius: 10px;
    background: rgba(167, 94, 214, 0.045);
}

.info-symbol {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(197, 139, 234, 0.5);
    border-radius: 50%;
    color: var(--purple-light);
    font-size: 11px;
    font-weight: 800;
}

.info-card p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.7;
}

/* Footer */

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 85px;
    border-top: 1px solid var(--border);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 2px;
}

.footer-dot {
    width: 6px;
    height: 6px;
    background: var(--purple);
    box-shadow: 0 0 10px rgba(167, 94, 214, 0.5);
}

.footer > p {
    color: var(--muted);
    font-size: 10px;
}

/* Startup loader */

.startup-loader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #0b0910;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.55s ease, visibility 0.55s ease;
}

.startup-loader.finished {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.startup-content {
    width: 100%;
    max-width: 360px;
    text-align: center;
    animation: startup-appear 0.65s ease both;
}

.startup-logo {
    display: grid;
    place-items: center;
    width: 90px;
    height: 90px;
    margin: 0 auto 24px;
    padding: 12px;
    border: 1px solid rgba(167, 94, 214, 0.5);
    border-radius: 25px;
    background: rgba(167, 94, 214, 0.1);
    box-shadow: 0 0 45px rgba(167, 94, 214, 0.2);
    animation: startup-glow 2s ease-in-out infinite;
}

.startup-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.startup-content h1 {
    margin: 0;
    color: #fff;
    font-size: 32px;
    font-weight: 850;
    letter-spacing: 7px;
}

.startup-subtitle {
    margin: 10px 0 32px;
    color: var(--purple-light);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 4px;
}

.startup-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 22px;
    border: 3px solid rgba(167, 94, 214, 0.15);
    border-top-color: var(--purple);
    border-right-color: var(--purple);
    border-radius: 50%;
    animation: startup-spin 0.75s linear infinite;
}

.startup-status {
    min-height: 20px;
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 12px;
}

.startup-progress {
    width: 100%;
    height: 4px;
    overflow: hidden;
    border-radius: 10px;
    background: #241c2d;
}

.startup-progress-bar {
    width: 35%;
    height: 100%;
    border-radius: 10px;
    background: var(--purple);
    box-shadow: 0 0 15px var(--purple);
    animation: startup-progress 1.3s ease-in-out infinite;
}

.startup-version {
    display: block;
    margin-top: 28px;
    color: #62596d;
    font-size: 9px;
    letter-spacing: 3px;
}

/* Sending loader */

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 7, 12, 0.82);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-card {
    width: 100%;
    max-width: 340px;
    padding: 35px 28px;
    border: 1px solid rgba(167, 94, 214, 0.4);
    border-radius: 20px;
    background: #15121b;
    text-align: center;
    box-shadow: 0 0 50px rgba(167, 94, 214, 0.15);
    animation: loading-pop 0.3s ease;
}

.loading-spinner {
    width: 55px;
    height: 55px;
    margin: 0 auto 24px;
    border: 4px solid rgba(167, 94, 214, 0.18);
    border-top-color: var(--purple);
    border-right-color: var(--purple);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(167, 94, 214, 0.15);
    animation: startup-spin 0.8s linear infinite;
}

.loading-card h2 {
    margin: 0 0 10px;
    color: #fff;
    font-size: 21px;
    font-weight: 750;
}

.loading-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.loading-progress {
    height: 4px;
    margin-top: 25px;
    overflow: hidden;
    border-radius: 10px;
    background: #292331;
}

.loading-progress-bar {
    width: 40%;
    height: 100%;
    border-radius: inherit;
    background: var(--purple);
    box-shadow: 0 0 12px var(--purple);
    animation: startup-progress 1.3s ease-in-out infinite;
}

/* Animations */

@keyframes startup-spin {
    to { transform: rotate(360deg); }
}

@keyframes startup-progress {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(400%); }
}

@keyframes startup-glow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(167, 94, 214, 0.12);
        transform: translateY(0);
    }
    50% {
        box-shadow: 0 0 60px rgba(167, 94, 214, 0.3);
        transform: translateY(-3px);
    }
}

@keyframes startup-appear {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loading-pop {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile layout */

@media (max-width: 850px) {
    .generator-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 60px;
    }

    .output-panel {
        min-width: 0;
    }
}

@media (max-width: 520px) {
    .navbar,
    .workspace {
        width: calc(100% - 28px);
    }

    .navbar {
        min-height: 76px;
    }

    .logo {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .logo img {
        padding: 3px;
    }

    .brand {
        gap: 9px;
    }

    .brand-name {
        font-size: 13px;
    }

    .brand-subtitle {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .navbar-right {
        gap: 6px;
        font-size: 8px;
        letter-spacing: 0.5px;
    }

    .hero {
        padding: 49px 0 38px;
    }

    .hero h1 {
        font-size: 43px;
        letter-spacing: -1.9px;
    }

    .hero > p {
        font-size: 13px;
    }

    .panel {
        padding: 19px;
        border-radius: 15px;
    }

    .panel-heading h2 {
        font-size: 19px;
    }

    .button-row {
        flex-direction: column;
    }

    .button-row .button {
        width: 100%;
    }

    .json-preview {
        min-height: 230px;
        padding: 13px;
        font-size: 10px;
    }

    .output-actions {
        grid-template-columns: 1fr;
    }

    .footer {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 7px;
        padding: 18px 0;
    }

    .footer > p {
        margin: 0;
    }

    .startup-content h1 {
        font-size: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
