@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #a3e635; /* Neon green from screenshot */
    --accent-hover: #bbf7d0;
    --border: #333333;
    --input-bg: #2a2a2a;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--accent);
    font-size: 1.8rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
}

/* Main Layout */
main {
    flex: 1;
    display: flex;
    max-width: 1200px;
    margin: 40px auto;
    width: 100%;
    gap: 40px;
    padding: 0 20px;
}

/* Left Panel - Configurations */
.config-panel {
    flex: 1;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Type Selectors */
.type-selectors {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.type-selectors::-webkit-scrollbar {
    height: 6px;
}
.type-selectors::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 10px;
}

.type-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 80px;
}

.type-btn i {
    font-size: 1.5rem;
    transition: transform 0.3s, color 0.3s;
}

.type-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.type-btn.active {
    color: var(--accent);
    background: rgba(255,255,255,0.08); /* slight highlight for active tab matching the screenshot */
}

.type-btn.active i {
    color: var(--accent);
    transform: translateY(-2px);
}

.type-btn span {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Forms */
.form-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.form-section.active {
    display: block;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.1);
}

.form-control::placeholder {
    color: #666;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.multi-url-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.multi-url-item {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 14px 24px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: #000;
    width: 100%;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(163, 230, 53, 0.3);
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

/* Right Panel - Preview */
.preview-panel {
    width: 380px;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: sticky;
    top: 100px;
    height: fit-content;
}

.preview-panel h3 {
    width: 100%;
    margin-bottom: 25px;
    text-align: left;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.qr-placeholder {
    width: 250px;
    height: 250px;
    background: var(--input-bg);
    border: 2px dashed var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

#qrcode {
    background: white !important; /* Force white background for QR code padding to be visible in dark mode */
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: inline-block;
    max-width: 100%; /* Constrain outer box to fit within sidebar */
    box-sizing: border-box;
}

#qrcode img, #qrcode canvas, #qrcode svg {
    border-radius: 0;
    padding: 0;
    margin: 0;
    display: block;
    max-width: 100%; /* Constrain generated canvas to fit horizontally */
    max-height: 250px; /* Constrain vertically to match the preview box size */
    width: auto !important;
    height: auto !important;
}

.actions {
    width: 100%;
    display: flex;
    gap: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.actions.visible {
    opacity: 1;
    pointer-events: all;
}

.actions .btn {
    flex: 1;
}

/* Responsive */
@media (max-width: 900px) {
    main {
        flex-direction: column;
    }
    .preview-panel {
        width: 100%;
        position: static;
    }
}
