:root {
    --bg-color: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --text-color: #e0e0e0;
    --title-color: #00ffff;
    --border-color: rgba(0, 255, 255, 0.3);
    --input-bg: rgba(30, 41, 59, 0.8);
    --button-bg: #00ffff;
    --button-hover-bg: #00cccc;
    --button-copy-bg: #50fa7b;
    --button-copy-hover-bg: #8affab;
    --button-clear-bg: #ff4b4b;
    --button-clear-hover-bg: #ff7878;
    --button-paste-bg: #4facfe;
    --button-paste-hover-bg: #00f2fe;
    --footer-text-color: #a0a0a0;
    --json-key-color: #ff79c6;
    --json-string-color: #50fa7b;
    --json-number-color: #bd93f9;
    --json-boolean-color: #ffb86c;
    --json-null-color: #ff5555;
    --shadow-color: rgba(0, 255, 255, 0.2);
    --line-number-bg: rgba(20, 31, 49, 0.9);
    --line-number-color: #666;
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-y: auto;
    position: relative;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
    backdrop-filter: blur(15px);
    animation: fadeIn 1s ease-in-out;
    margin-top: 20px;
    margin-bottom: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    color: var(--title-color);
    text-align: center;
    margin-top: 0;
    font-size: 2.5em;
    text-shadow: 0 0 10px var(--title-color);
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 5px var(--title-color); }
    to { text-shadow: 0 0 15px var(--title-color); }
}

.version-tag {
    font-size: 0.6em;
    color: #00ffff;
    vertical-align: super;
    margin-left: 10px;
}

p {
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 30px;
}

.input-header-buttons,
.output-footer-buttons {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.output-footer-buttons {
    margin-top: 10px;
    margin-bottom: 0;
}

.input-header-buttons button,
.output-footer-buttons button {
    padding: 8px 15px;
    font-size: 14px;
    border-radius: 8px;
    box-shadow: none;
}

.input-header-buttons button:hover,
.output-footer-buttons button:hover {
    transform: translateY(-2px);
}

#pasteButton {
    background: var(--button-paste-bg);
    color: #000;
}

#pasteButton:hover {
    background: var(--button-paste-hover-bg);
}

.textarea-container {
    display: flex;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    max-height: 250px;
}

.textarea-container:focus-within {
    border-color: var(--title-color);
    box-shadow: inset 0 2px 10px rgba(0, 255, 255, 0.2), 0 0 10px var(--title-color);
}

.line-numbers {
    background: var(--line-number-bg);
    color: var(--line-number-color);
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    padding: 15px 10px;
    text-align: right;
    border-right: 1px solid var(--border-color);
    user-select: none;
    white-space: pre;
    line-height: 1.5;
    min-width: 40px;
    flex-shrink: 0;
    overflow: hidden;
    max-height: 250px;
}

textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    resize: none;
    min-height: 150px;
    max-height: 250px;
    outline: none;
    line-height: 1.5;
    overflow-y: auto;
}

textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track {
    background: transparent;
}

textarea::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: var(--title-color);
}

.pre-container {
    display: flex;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    position: relative;
    max-height: 500px;
}

.output-container {
    max-height: 500px;
}

.output-content {
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    max-height: 500px;
    outline: none;
    line-height: 1.5;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-content::-webkit-scrollbar {
    width: 8px;
}

.output-content::-webkit-scrollbar-track {
    background: transparent;
}

.output-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.output-content::-webkit-scrollbar-thumb:hover {
    background: var(--title-color);
}

#outputJson {
    max-height: 500px;
}

.textarea-container {
    position: relative;
}

.pre-container .line-numbers {
    max-height: none;
    overflow: visible;
    position: sticky;
    top: 0;
}

.pre-container .line-numbers::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

pre {
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
    border: none;
    background: transparent;
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: none;
    overflow: visible;
    line-height: 1.5;
    margin: 0;
}

.pre-container::-webkit-scrollbar {
    width: 8px;
}

.pre-container::-webkit-scrollbar-track {
    background: var(--input-bg);
}

.pre-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.pre-container::-webkit-scrollbar-thumb:hover {
    background: var(--title-color);
}

#configCounter {
    font-size: 0.7em;
    color: var(--text-color);
    font-weight: normal;
    vertical-align: middle;
    margin-left: 10px;
}

.button-container {
    display: flex;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

button {
    color: #000;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 10px var(--shadow-color);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px var(--shadow-color);
}

#generateButton {
    background: var(--button-bg);
    color: #000;
}

#generateButton:hover {
    background: var(--button-hover-bg);
}

#copyButton {
    background: var(--button-copy-bg);
    color: #000;
}

#copyButton:hover {
    background: var(--button-copy-hover-bg);
}

#clearButton {
    background: var(--button-clear-bg);
    color: #fff;
}

#clearButton:hover {
    background: var(--button-clear-hover-bg);
}

footer {
    text-align: center;
    margin-top: 40px;
    color: var(--footer-text-color);
    font-size: 14px;
}

footer a {
    color: var(--title-color);
    text-decoration: none;
    transition: text-decoration 0.3s;
}

footer a:hover {
    text-decoration: underline;
}

.json-key { color: var(--json-key-color); }
.json-string { color: var(--json-string-color); }
.json-number { color: var(--json-number-color); }
.json-boolean { color: var(--json-boolean-color); }
.json-null { color: var(--json-null-color); }

.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 25px;
    gap: 15px;
}

.checkbox-container input {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background: var(--input-bg);
    cursor: pointer;
    position: relative;
    transition: background 0.3s, border-color 0.3s;
}

.checkbox-container input:checked {
    background: var(--title-color);
    border-color: var(--title-color);
}

.checkbox-container input:checked::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #000;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
}

.checkbox-container label {
    cursor: pointer;
    font-size: 16px;
}

.loader-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

@keyframes spinny {
  0% {
    transform-origin:50%;
    transform:translate3d(-50%, -50%, 0) rotateZ(0deg);
  }
  100% {
    transform:translate3d(-50%, -50%, 0) rotateZ(360deg);
  }
}

.spinny-loader {
    display:inline-block;
    position:relative;
    width:140px;
    height:140px;
    margin:0 10px;
}

.spinny-loader > div {
    position:absolute;
    top:50%;
    left:50%;
    display:block;
    width:60px;
    height:60px;
    transform: translate3d(-50%, -50%, 0);
    border-radius:200px;
    background-color:var(--input-bg);
}

.spinny-loader::before, .spinny-loader::after {
    content:"";
    position:absolute;
    top:50%;
    left:50%;
    display:block;
    border-radius:200px;
    border-style:solid;
    border-width:15px;
    border-color:var(--border-color) transparent var(--border-color) transparent;
    animation-name:spinny;
    animation-duration: 1s;
    animation-iteration-count:infinite;
    animation-timing-function: ease-in-out;
}

.spinny-loader::after {
    width:140px;
    height:140px;
    animation-direction: alternate-reverse;
}

.spinny-loader::before {
    width:100px;
    height:100px;
}

body.loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 41, 59, 0.9);
    z-index: 999;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .line-numbers {
        padding: 15px 5px;
        min-width: 35px;
    }
}