/* ============================================================
   Neon QR Code Generator PRO — Style Sheet
   Design System: Neon Dark
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --bg-color: #0a0a0a;
    --surface-color: #141414;
    --surface-light: #222;
    --primary-color: #a3ff00; /* Neon green */
    --primary-glow: rgba(163, 255, 0, 0.4);
    --danger-color: #ff4444;
    --text-color: #ffffff;
    --text-muted: #888899;
    --border-color: #333;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 2rem;
    min-height: 100vh;
    background-image: radial-gradient(
        circle at 50% 0%,
        rgba(163, 255, 0, 0.08) 0%,
        transparent 70%
    );
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- App Container --- */
.app-container {
    width: 100%;
    max-width: 1400px;
    padding: 2.5rem;
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 32px;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.8),
        inset 0 0 0 1px rgba(163, 255, 0, 0.1);
    margin: 2rem;
}

/* --- Header --- */
header {
    text-align: center;
    margin-bottom: 2.5rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    font-size: 1rem;
    background: var(--primary-color);
    color: var(--bg-color);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 800;
    box-shadow: 0 0 15px var(--primary-glow);
    line-height: 1.4;
}

.highlight {
    color: var(--primary-color);
    text-shadow: 0 0 20px var(--primary-glow);
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
    margin-top: 0.4rem;
}

/* --- Utility Classes --- */
.hidden { display: none !important; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.w-100 { width: 100%; }

/* --- Editor Layout --- */
.editor {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--surface-color);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.export-sidebar {
    width: 320px;
}

.main-editor {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

/* --- Sidebar Types Grid --- */
.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
    margin-bottom: 1rem;
}

.qr-types-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.qr-types-grid::-webkit-scrollbar { width: 4px; }
.qr-types-grid::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

.btn-type {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
}

.btn-type:hover {
    background: var(--surface-light);
    color: var(--text-color);
}

.btn-type.active {
    background: rgba(163, 255, 0, 0.1);
    border-color: rgba(163, 255, 0, 0.3);
    color: var(--primary-color);
    box-shadow: 0 0 15px rgba(163, 255, 0, 0.05);
}

.btn-type svg {
    flex-shrink: 0;
}

/* --- Configuration Panels --- */
.panel-section {
    background: var(--surface-color);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.m-0 { margin: 0; }

/* --- Inputs Container --- */
.inputs-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pro-input, .pro-textarea {
    width: 100%;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.pro-input:focus, .pro-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(163, 255, 0, 0.15);
}

.pro-textarea {
    resize: vertical;
    min-height: 80px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-color);
    background: var(--surface-light);
}

.tab-btn.active {
    color: var(--primary-color);
    background: rgba(163, 255, 0, 0.1);
}

/* --- Forms & Controls (reused from image-converter) --- */
.pro-col {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pro-col > label, .radio-label, .checkbox-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

/* --- Custom Dropdown --- */
.custom-dropdown {
    position: relative;
    width: 100%;
    user-select: none;
}

.dropdown-selected {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}
.dropdown-selected:hover {
    border-color: rgba(163, 255, 0, 0.3);
}
.custom-dropdown.open .dropdown-selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(163, 255, 0, 0.15);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.dropdown-selected svg, .dropdown-option svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color 0.2s;
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-light);
    border: 1px solid var(--primary-color);
    border-top: none;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}
.dropdown-options.hidden {
    display: none;
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.dropdown-option:hover {
    background: rgba(163, 255, 0, 0.1);
    color: var(--text-color);
}
.dropdown-option:hover svg {
    color: var(--primary-color);
}
.dropdown-option.active {
    background: rgba(163, 255, 0, 0.15);
    color: var(--primary-color);
}
.dropdown-option.active svg {
    color: var(--primary-color);
}
.dropdown-selected svg {
    color: var(--primary-color);
}

.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.pro-select {
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888899' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.pro-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(163, 255, 0, 0.15);
}

/* Color Pickers */
.color-picker-wrap {
    display: flex;
    gap: 0.5rem;
}

.color-input {
    -webkit-appearance: none;
    border: 1px solid var(--border-color);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    background: transparent;
}
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: none; border-radius: 8px; }

.hex-input {
    flex-grow: 1;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0 1rem;
    border-radius: 10px;
    font-family: monospace;
    font-size: 0.95rem;
    outline: none;
}

.color-mode-selector {
    display: flex;
    gap: 1.5rem;
}

.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: none;
}

/* Sliders */
.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}
.slider-header span { color: var(--primary-color); }

.pro-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    outline: none;
}
.pro-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
    margin-top: -6px;
}

/* --- Logo Upload --- */
.logo-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(0, 0, 0, 0.2);
}
.logo-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(163, 255, 0, 0.05);
}
.logo-upload-area svg { color: var(--primary-color); margin-bottom: 1rem; }

.selected-logo-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-light);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}
#uploaded-logo-preview {
    height: 40px;
    max-width: 100px;
    object-fit: contain;
}

.hint-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* --- Presets Grid --- */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.preset-btn {
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.preset-btn:hover { border-color: rgba(163, 255, 0, 0.3); }
.preset-btn.active { border-color: var(--primary-color); box-shadow: 0 0 10px var(--primary-glow); }

.preset-colors {
    display: flex;
    width: 100%;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}
.preset-colors span { flex-grow: 1; }
.preset-name { font-size: 0.75rem; color: var(--text-color); font-family: 'Outfit', sans-serif; }

/* --- Preview Area --- */
.preview-container {
    background: var(--surface-light);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-wrapper {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff; /* QR codes need white bg by default for contrast */
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

#qr-code-target {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem; /* Ensures safe spacing inside the canvas */
}
#qr-code-target canvas, #qr-code-target svg {
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-bar {
    display: flex;
    justify-content: center;
}
.info-text {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Buttons --- */
.btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    transition: var(--transition);
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 25px var(--primary-glow); }

.btn-secondary {
    background: var(--surface-light);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--border-color); }

.btn-small { padding: 0.4rem 0.8rem; font-size: 0.85rem; border-radius: 6px; }

.btn-danger-subtle { color: var(--danger-color); }
.btn-danger-subtle:hover { background: rgba(255, 68, 68, 0.1); color: var(--danger-color); border-color: var(--danger-color); }

.export-actions {
    display: flex;
    gap: 1rem;
}
.export-actions .btn { flex: 1; }

/* --- Accordion --- */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.accordion-header .chevron { transition: transform 0.3s ease; }
.accordion-header.active .chevron { transform: rotate(180deg); }

/* --- Modal --- */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.btn-close {
    background: transparent; border: none;
    color: var(--text-muted); font-size: 1.5rem; cursor: pointer;
}
.btn-close:hover { color: var(--text-color); }
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px; padding: 3rem 1rem;
    text-align: center; cursor: pointer; transition: var(--transition);
}
.drop-zone:hover { border-color: var(--primary-color); background: rgba(163,255,0,0.05); }

/* Responsive */
@media (max-width: 1024px) {
    .editor { flex-direction: column; }
    .sidebar, .export-sidebar { width: 100%; }
    .qr-types-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
