:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --bg-page: #f9fafb;
    --bg-card: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --font-main: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.nav-content {
    display: flex;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 48px;
    width: auto;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* Hero Section */
.hero {
    background-color: var(--primary);
    color: white;
    padding: 4rem 0 5rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Main Content */
.main-container {
    flex: 1;
    margin-top: -3rem;
    padding-bottom: 3rem;
    position: relative;
    z-index: 10;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1.5rem 1.5rem 0;
    border-bottom: 1px solid var(--border);
    background: #f9fafb;
}

.tab-btn {
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: white;
    border-radius: 6px 6px 0 0;
    border: 1px solid var(--border);
    border-bottom: 1px solid white;
    margin-bottom: -1px;
}

/* Form Content */
.form-content {
    padding: 2rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.input-field {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.help-text {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* NEW SECTIONS */

.section-group {
    margin-bottom: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* Frame Grid */
.frame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
}

.frame-btn {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.frame-btn:hover {
    border-color: var(--primary);
    background: #f5f3ff;
}

.frame-btn.active {
    border: 2px solid var(--primary);
    background: #eef2ff;
}

.frame-preview {
    width: 32px;
    height: 32px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    opacity: 0.5;
}

.frame-btn.active .frame-preview {
    border-color: var(--primary);
    opacity: 1;
}

.frame-none {
    border-style: dashed;
}

.frame-bottom {
    border-bottom-width: 8px;
}

.frame-top {
    border-top-width: 8px;
}

.frame-outline {
    border-width: 4px;
}

.frame-btn span {
    font-size: 0.75rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Color Customization */
.color-settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.color-col label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.color-picker-ui {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

.color-preview {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.color-preview input[type="color"] {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    cursor: pointer;
    opacity: 0;
}

.hex-value {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.color-dot:hover {
    transform: scale(1.1);
}

.color-dot.active {
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary);
}

/* Upload Box */
.upload-box {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.upload-btn {
    background: white;
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    color: var(--text-main);
}

.upload-btn:hover {
    border-color: var(--text-muted);
    background: #f9fafb;
}

.remove-btn {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.remove-btn:hover {
    background: #fecaca;
}


/* Preview Card */
.preview-card {
    padding: 2rem;
    text-align: center;
    position: sticky;
    top: 6rem;
}

.preview-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.preview-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.qr-display {
    background: #f3f4f6;
    padding: 2rem;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 2rem;
    border: 1px dashed var(--border);
}

canvas#qr-code {
    display: block;
    max-width: 100%;
}

.btn-download {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-download:hover {
    background: var(--primary-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 3rem 0 4rem;
    }

    .navbar .logo {
        height: 40px;
    }

    .color-settings-row {
        grid-template-columns: 1fr;
    }
}