* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 40px 20px;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #1a0b2e 0%, #2d1245 50%, #4a1942 100%);
    background-attachment: fixed;
    color: #fdf2f8;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: var(--bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.5;
}

.container {
    max-width: 600px;
    margin: auto;
    padding: 32px;
    background: rgba(45, 18, 69, 0.85);
    border: 1px solid #a855f7;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.25);
}

h1 {
    margin-top: 0;
    background: linear-gradient(90deg, #f472b6, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #f472b6; /* fallback */
}

form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

label {
    font-weight: bold;
    font-size: 14px;
    color: #f9a8d4;
}

input {
    padding: 12px;
    border: 1px solid #7e22ce;
    border-radius: 8px;
    background: #1a0b2e;
    color: #fdf2f8;
}

input::placeholder {
    color: #a78bba;
}

input:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.3);
}

button {
    margin-top: 12px;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #ec4899, #a855f7);
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

button:hover {
    background: linear-gradient(90deg, #db2777, #9333ea);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.4);
}

.output,
.error {
    margin-top: 28px;
    padding: 20px;
    border-radius: 10px;
}

.output {
    background: #1a0b2e;
    border: 1px solid #ec4899;
}

.output pre {
    white-space: pre-wrap;
    line-height: 1.8;
    color: #fbcfe8;
}

.error {
    background: #4c0d3a;
    border: 1px solid #f472b6;
    color: #fbcfe8;
}

@media (max-width: 500px) {
    body {
        padding: 20px 12px;
    }

    .container {
        padding: 22px;
    }
}

.nav-link {
    display: inline-block;
    margin-bottom: 16px;
    color: #f9a8d4;
    text-decoration: none;
    font-size: 14px;
}

.nav-link:hover {
    color: #c084fc;
    text-decoration: underline;
}

.nav-button {
    display: inline-block;
    margin-bottom: 16px;
    padding: 10px 16px;
    border-radius: 8px;
    background: linear-gradient(90deg, #ec4899, #a855f7);
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
}

.nav-button:hover {
    background: linear-gradient(90deg, #db2777, #9333ea);
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.nav-bar .nav-button {
    margin-bottom: 0;
}

.container-wide {
    max-width: 96vw;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid #7e22ce;
    border-radius: 10px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 10px 8px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid rgba(168, 85, 247, 0.35);
}

.data-table th {
    background: #1a0b2e;
    color: #f9a8d4;
}

.data-table tbody tr:hover {
    background: rgba(236, 72, 153, 0.12);
}