:root {
    --font-family: 'Hind Siliguri', 'Outfit', system-ui, -apple-system, sans-serif;
    
    /* Dark theme tokens (default) */
    --bg-main: #090d16;
    --bg-card: rgba(22, 30, 46, 0.7);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --bg-input: #121929;
    --bg-input-border: rgba(255, 255, 255, 0.12);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    --accent-color: #38bdf8;
    
    --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --glow-color-1: rgba(99, 102, 241, 0.25);
    --glow-color-2: rgba(56, 189, 248, 0.2);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-border: rgba(0, 0, 0, 0.06);
    --bg-input: #ffffff;
    --bg-input-border: #cbd5e1;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.1);
    --accent-color: #0284c7;
    
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    --glow-color-1: rgba(99, 102, 241, 0.12);
    --glow-color-2: rgba(56, 189, 248, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background Background Glow Effects */
.background-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: var(--glow-color-1);
    top: -100px;
    left: -100px;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: var(--glow-color-2);
    bottom: -150px;
    right: -150px;
}

/* Header */
.app-header {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2.2rem;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-container h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.accent-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Layout */
.main-layout {
    position: relative;
    z-index: 10;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem 3rem 2rem;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    flex: 1;
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

/* Cards Base (Glassmorphism) */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.card:last-child {
    margin-bottom: 0;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-primary);
}

.card-title i {
    color: var(--primary-color);
}

/* Tab Navigation */
.tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.6rem;
}

.tab-btn {
    background: var(--bg-input);
    border: 1px solid var(--bg-input-border);
    color: var(--text-secondary);
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.tab-btn.active {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

/* Form Controls */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

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

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

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--bg-input-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
}

.input-with-icon input {
    padding-left: 2.75rem;
}

/* Accordion Cards */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.accordion-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.accordion-header h3 i {
    color: var(--primary-color);
}

.accordion-arrow {
    color: var(--text-muted);
    transition: var(--transition-normal);
}

.accordion-card.collapsed .accordion-arrow {
    transform: rotate(-90deg);
}

.accordion-card.collapsed .accordion-body {
    display: none;
}

.accordion-body {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--bg-card-border);
}

/* Logo Presets */
.logo-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.preset-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--bg-input-border);
    color: var(--text-primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.preset-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.preset-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px var(--primary-light);
}

/* File Upload Zone */
.file-upload-zone {
    position: relative;
    border: 2px dashed var(--bg-input-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-input);
    cursor: pointer;
    transition: var(--transition-fast);
}

.file-upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.file-upload-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.upload-placeholder i {
    font-size: 2rem;
    color: var(--primary-color);
}

.upload-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.upload-preview img {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
    border-radius: 6px;
}

.hidden {
    display: none !important;
}

/* Color Picker Custom Styling */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--bg-input-border);
    border-radius: var(--radius-md);
    padding: 0.4rem;
}

.color-picker-wrapper input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.color-picker-wrapper input.color-text {
    border: none;
    padding: 0.2rem 0.4rem;
    background: transparent;
    font-family: monospace;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* Range Inputs */
input[type="range"] {
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Preview Section */
.preview-panel {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.preview-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-container {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    min-width: 260px;
}

#qr-code-canvas canvas, #qr-code-canvas svg {
    display: block;
    max-width: 100%;
    height: auto !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 4px 15px var(--primary-light);
}

.btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-input);
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

.download-section {
    width: 100%;
    margin-top: 1rem;
}

.download-section label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    width: 100%;
}

.download-buttons .btn-primary {
    flex: 2;
    min-width: 140px;
}

.download-buttons .btn-secondary {
    flex: 1;
}

.secondary-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.25rem;
}

/* Tip Card */
.tip-card {
    background: var(--primary-light);
    border-color: rgba(99, 102, 241, 0.3);
}

.tip-card h4 {
    color: var(--primary-color);
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tip-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Footer */
.app-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--bg-card-border);
}
