:root {
    --primary: #04b56c;
    --primary-hover: #039e5e;
    --nav-bg: #252c36;
    --hero-bg-1: #2a5298;
    --hero-bg-2: #1e3c72;
    --bg-color: #f0f2f5;
    --surface: #ffffff;
    --text-main: #333333;
    --text-muted: #777777;
    --border: #e0e0e0;
    --input-bg: #ffffff;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 4px;
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --surface: #2d2d2d;
    --text-main: #f0f0f0;
    --text-muted: #aaaaaa;
    --border: #444444;
    --input-bg: #3d3d3d;
    --nav-bg: #111111;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

/* Navbar */
.navbar {
    background-color: var(--nav-bg);
    color: white;
    padding: 15px 20px;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-logo strong {
    font-size: 1.4rem;
    font-weight: 700;
}
.nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}
.theme-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}
#lang-select {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 5px 10px;
    border-radius: var(--radius);
    outline: none;
}
#lang-select option { color: black; }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--hero-bg-2) 0%, var(--hero-bg-1) 100%);
    color: white;
    text-align: center;
    padding: 60px 20px 100px 20px;
}
.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.hero p {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Main Generator */
.generator-container {
    max-width: 1100px;
    margin: -60px auto 40px auto;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Top Tabs */
.generator-tabs {
    display: flex;
    flex-wrap: wrap;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}
body.dark-mode .generator-tabs {
    background: #252525;
}
.tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 15px 10px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.tab-btn:last-child {
    border-right: none;
}
.tab-btn i.icon {
    font-size: 1.2rem;
    font-style: normal;
}
.tab-btn:hover {
    background: rgba(0,0,0,0.02);
    color: var(--text-main);
}
.tab-btn.active {
    background: var(--surface);
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

/* Generator Body Layout */
.generator-body {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
    gap: 30px;
}
.controls-panel {
    flex: 1 1 600px;
}
.preview-panel {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    top: 20px;
}

/* Accordion */
.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 15px;
    background: var(--surface);
}
.accordion-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    border-radius: var(--radius);
}
body.dark-mode .accordion-header {
    background: #333333;
}
.accordion-item.active .accordion-header {
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}
.acc-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-main);
}
.step-num {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
}
.acc-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
    line-height: 1;
}

.accordion-body {
    padding: 20px;
}

/* Tab Panes */
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}

/* Forms */
.input-group {
    margin-bottom: 15px;
}
.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}
.input-group input[type="text"],
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}
.input-group input[type="text"]:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--primary);
}

.name-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Colors Panel */
.color-options {
    display: flex;
    gap: 15px;
}
.color-options .input-group {
    flex: 1;
}
.color-picker-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--input-bg);
}
.color-picker-wrap input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    padding: 0;
    cursor: pointer;
    background: transparent;
}
.color-picker-wrap input[type="text"] {
    border: none;
    padding: 10px;
    flex: 1;
    font-family: monospace;
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
}
.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}
body.dark-mode .btn-secondary {
    background-color: #555;
    color: white;
}
.btn-secondary:hover {
    background-color: #d0d0d0;
}

/* Preview */
.qr-preview-container {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
}
body.dark-mode .qr-preview-container {
    background: #fff;
    border-color: #fff;
}
.qr-preview-container canvas,
.qr-preview-container svg {
    max-width: 100%;
    max-height: 100%;
}

.quality-slider-container {
    width: 100%;
    margin-bottom: 20px;
}

.generate-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(4, 181, 108, 0.3);
}
.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(4, 181, 108, 0.4);
}

.download-options {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.btn-download {
    background-color: #019054;
    color: white;
    padding: 12px;
}
.btn-download:hover {
    background-color: #017a47;
}
/* Style SVG, PDF, EPS differently like original site */
.btn-download:not(:first-child) {
    background-color: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
}
body.dark-mode .btn-download:not(:first-child) {
    background-color: #444;
    color: white;
    border-color: #555;
}
.btn-download:not(:first-child):hover {
    background-color: #e2e2e2;
}
body.dark-mode .btn-download:not(:first-child):hover {
    background-color: #555;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

@media (max-width: 768px) {
    .generator-body {
        flex-direction: column-reverse; /* Preview panel on top for mobile */
        padding: 15px;
    }
    .preview-panel {
        position: static;
        width: 100%;
        margin-bottom: 20px;
    }
    .controls-panel {
        width: 100%;
    }
    .name-grid {
        grid-template-columns: 1fr;
    }
    .color-options {
        flex-direction: column;
        gap: 10px;
    }
    .hero {
        padding: 40px 15px 80px 15px;
    }
    .hero h1 {
        font-size: 1.6rem;
    }
    .hero p {
        font-size: 0.95rem;
    }
    .generator-container {
        margin: -40px 10px 40px 10px;
        width: auto;
    }
    .nav-actions {
        gap: 10px;
    }
    .theme-btn {
        padding: 5px;
    }
    .generator-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 5px; /* for scrollbar */
    }
    /* Hide scrollbar for cleaner look */
    .generator-tabs::-webkit-scrollbar {
        height: 4px;
    }
    .generator-tabs::-webkit-scrollbar-thumb {
        background-color: var(--border);
        border-radius: 4px;
    }
    .tab-btn {
        flex: 0 0 auto;
        min-width: 80px;
        padding: 10px 15px;
        font-size: 0.85rem;
    }
}


/* Frames */
#qr-frame-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    padding: 0;
    transition: all 0.3s;
}

.frame-text {
    font-weight: bold;
    font-size: 1.2rem;
    color: #fff;
    text-transform: uppercase;
    padding: 10px 20px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 1px;
}

#qr-frame-wrapper.frame-bottom-bubble {
    padding: 15px 15px 0 15px;
    border-radius: 15px 15px 0 0;
}
#qr-frame-wrapper.frame-bottom-bubble #frame-text-bottom {
    display: block !important;
    border-radius: 0 0 15px 15px;
    margin-top: 5px;
    margin-bottom: -15px;
    transform: translateY(15px);
    padding: 15px 20px;
}

#qr-frame-wrapper.frame-top-badge {
    padding: 0 15px 15px 15px;
    border-radius: 0 0 15px 15px;
}
#qr-frame-wrapper.frame-top-badge #frame-text-top {
    display: block !important;
    border-radius: 15px 15px 0 0;
    margin-top: -15px;
    transform: translateY(-15px);
    margin-bottom: 5px;
    padding: 15px 20px;
}

#qr-frame-wrapper.frame-simple-border {
    padding: 20px;
    border-radius: 15px;
    border: 6px solid var(--primary);
    background: #fff;
}
#qr-frame-wrapper.frame-simple-border #frame-text-bottom {
    display: block !important;
    color: var(--primary);
    margin-top: 10px;
    padding: 5px;
}
.dark-mode #qr-frame-wrapper.frame-simple-border {
    background: #1e293b;
}
