* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Courier New', monospace;
    background: #0a0a0f;
    background-image:
        radial-gradient(ellipse at top, #0d1117 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(0, 255, 200, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(0, 200, 255, 0.03) 0%, transparent 40%);
    min-height: 100vh;
    padding: 2rem;
    color: #e0e0e0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

h1 {
    color: #00ffc8;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(0, 255, 200, 0.5), 0 0 40px rgba(0, 255, 200, 0.2);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: linear-gradient(145deg, #12141a 0%, #0d0f14 100%);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #1e2430;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #8892a0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

input[type="text"],
input[type="url"] {
    padding: 0.75rem 1rem;
    border: 1px solid #2a3040;
    border-radius: 6px;
    font-size: 1rem;
    background: #0d0f14;
    color: #e0e0e0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="url"]:focus {
    outline: none;
    border-color: #00ffc8;
    box-shadow: 0 0 0 3px rgba(0, 255, 200, 0.1), 0 0 20px rgba(0, 255, 200, 0.1);
}

.color-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-input input[type="color"] {
    width: 50px;
    height: 40px;
    border: 1px solid #2a3040;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
    background: #0d0f14;
}

.color-input input[type="text"] {
    flex: 1;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.style-options {
    display: flex;
    gap: 0.75rem;
}

.style-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 1px solid #2a3040;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    background: #0d0f14;
    color: #8892a0;
    font-size: 0.85rem;
}

.style-option:hover {
    border-color: #00ffc8;
    box-shadow: 0 0 15px rgba(0, 255, 200, 0.1);
}

.style-option:has(input:checked) {
    border-color: #00ffc8;
    background: rgba(0, 255, 200, 0.05);
    color: #00ffc8;
    box-shadow: 0 0 20px rgba(0, 255, 200, 0.15);
}

.style-option input {
    display: none;
}

.style-preview {
    width: 24px;
    height: 24px;
    background: #00ffc8;
    box-shadow: 0 0 10px rgba(0, 255, 200, 0.4);
}

.style-square {
    border-radius: 0;
}

.style-rounded {
    border-radius: 5px;
}

.style-dots {
    border-radius: 50%;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #1e2430;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00ffc8;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 255, 200, 0.5);
    border: 2px solid #0a0a0f;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00ffc8;
    cursor: pointer;
    border: 2px solid #0a0a0f;
    box-shadow: 0 0 15px rgba(0, 255, 200, 0.5);
}

.logo-upload {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

input[type="file"] {
    padding: 0.5rem;
    border: 1px dashed #2a3040;
    border-radius: 6px;
    cursor: pointer;
    flex: 1;
    background: #0d0f14;
    color: #8892a0;
    font-size: 0.9rem;
}

input[type="file"]:hover {
    border-color: #00ffc8;
}

input[type="file"]::file-selector-button {
    background: #1e2430;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    color: #e0e0e0;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: background 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background: #2a3040;
}

.logo-preview {
    margin-top: 0.5rem;
}

.logo-preview img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 6px;
    border: 1px solid #2a3040;
}

.preview-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.qr-preview {
    position: relative;
    background: #0d0f14;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    width: 100%;
    border: 1px solid #1e2430;
}

#qrImage {
    max-width: 100%;
    max-height: 350px;
    border-radius: 4px;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #1e2430;
    border-top-color: #00ffc8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 20px rgba(0, 255, 200, 0.2);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-primary {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #00ffc8 0%, #00c8a0 100%);
    color: #0a0a0f;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 30px rgba(0, 255, 200, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(0, 255, 200, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: #1e2430;
    color: #e0e0e0;
    border: 1px solid #2a3040;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #2a3040;
    border-color: #00ffc8;
    color: #00ffc8;
}

.logo-color-options {
    flex-wrap: wrap;
}

.logo-color-options .style-option {
    padding: 0.75rem;
    font-size: 0.8rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: #0d0f14;
    border: 1px solid #2a3040;
    border-radius: 8px;
    transition: all 0.2s;
}

.checkbox-label:hover {
    border-color: #00ffc8;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #00ffc8;
    cursor: pointer;
}

.checkbox-label span {
    color: #8892a0;
    font-size: 0.9rem;
}

.checkbox-label:has(input:checked) {
    border-color: #00ffc8;
    background: rgba(0, 255, 200, 0.05);
}

.checkbox-label:has(input:checked) span {
    color: #00ffc8;
}

.checkbox-label.compact {
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.checkbox-label.compact span {
    font-size: 0.8rem;
}

/* Disabled background color when transparent */
#bgColorGroup.transparent-active .color-input {
    opacity: 0.4;
    pointer-events: none;
}

#bgColorGroup.transparent-active label[for="bgColor"] {
    opacity: 0.4;
}

.download-buttons {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.download-buttons .btn-primary {
    flex: 1;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
}

.png-size-group {
    width: 100%;
    margin-top: 0.5rem;
}

.png-size-group label {
    font-size: 0.8rem;
    color: #8892a0;
}

input[type="number"] {
    padding: 0.75rem 1rem;
    border: 1px solid #2a3040;
    border-radius: 6px;
    font-size: 1rem;
    background: #0d0f14;
    color: #e0e0e0;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="number"]:focus {
    outline: none;
    border-color: #00ffc8;
    box-shadow: 0 0 0 3px rgba(0, 255, 200, 0.1);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

/* Warning text for potentially unreadable QR codes */
.warning-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #ffaa00;
    font-style: italic;
}

/* Test QR button */
.btn-test {
    width: 100%;
    margin-top: 0.5rem;
}

/* Test result display */
.test-result {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
}

.test-result.success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid #00ff88;
    color: #00ff88;
}

.test-result.warning {
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid #ffaa00;
    color: #ffaa00;
}

.test-result.error {
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid #ff6464;
    color: #ff6464;
}
