/* Core Styles & Variables */
:root {
    --primary-blue: #007bff;
    --primary-green: #28a745;
    --accent-color: #6f42c1;
    --text-dark: #343a40;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --border-light: #e9ecef;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --border-radius-small: 8px;
    --border-radius-medium: 12px;
    --border-radius-large: 25px;
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Noto Sans Bengali', sans-serif;
}

/* Universal Box-Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    overflow-x: hidden;
}

/* Base HTML & Body Styles */
html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: var(--font-primary);
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    width: 100%;
}

/* Header */
.main-header {
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-color));
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-medium);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 1.8em;
    font-weight: 700;
    transition: transform 0.3s ease;
}

.logo a:hover {
    transform: scale(1.05);
}

.main-nav a {
    color: white;
    text-decoration: none;
    margin-left: 25px;
    font-weight: 500;
    font-size: 1.05em;
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s ease;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    display: block;
    margin-top: 5px;
    right: 0;
    background: white;
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
    left: 0;
    background: white;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8em;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1a75ff, #00c6ff);
    color: white;
    padding: 80px 0;
    text-align: center;
    box-shadow: inset 0 -5px 15px rgba(0,0,0,0.1);
}

.hero-section h1 {
    font-size: 3.2em;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-section p {
    font-size: 1.3em;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

/* Generator Container */
.generator-container {
    background-color: white;
    border-radius: var(--border-radius-medium);
    box-shadow: 0 10px 30px var(--shadow-light);
    margin: 40px auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Step Indicators */
.generator-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    padding: 0 20px;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.step-indicator span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--border-light);
    color: var(--text-light);
    font-weight: 600;
    font-size: 1.2em;
    transition: all 0.3s ease;
    border: 2px solid var(--border-light);
}

.step-indicator p {
    margin-top: 8px;
    font-size: 0.9em;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.3s ease;
}

.step-indicator.active span {
    background: linear-gradient(45deg, var(--primary-blue), var(--accent-color));
    color: white;
    border-color: var(--primary-blue);
    box-shadow: 0 4px 10px var(--shadow-medium);
}

.step-indicator.active p {
    color: var(--primary-blue);
    font-weight: 600;
}

.step-indicator.completed span {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.step-indicator.completed p {
    color: var(--primary-green);
}

.step-line {
    position: absolute;
    height: 4px;
    background-color: var(--border-light);
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 0;
    margin: 0 40px;
}

/* Generator Panels */
.generator-panels {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.left-panel {
    flex: 3;
    min-width: 300px;
    background-color: var(--bg-light);
    padding: 25px;
    border-radius: var(--border-radius-medium);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.right-panel {
    flex: 2;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px;
    background-color: #ffffff;
    border-radius: var(--border-radius-medium);
    box-shadow: 0 5px 20px var(--shadow-light);
    position: sticky;
    top: 100px;
    align-self: flex-start;
    height: fit-content;
}

/* Step Panels */
.step-panel {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.step-panel.active {
    display: block;
}

.step-panel h2 {
    font-size: 1.8em;
    color: var(--primary-blue);
    margin-bottom: 25px;
    text-align: center;
}

/* QR Type Grid (Step 1) */
.qr-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.qr-type-card {
    background-color: white;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-small);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.qr-type-card:hover {
    border-color: var(--primary-blue);
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.qr-type-card.active {
    border-color: var(--primary-blue);
    background-color: #e6f2ff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.qr-type-card i {
    font-size: 2.5em;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.qr-type-card h3 {
    font-size: 1.1em;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.qr-type-card p {
    font-size: 0.85em;
    color: var(--text-light);
}

/* Input Form (Step 2) */
.input-form h3 {
    font-size: 1.4em;
    color: var(--primary-blue);
    margin-bottom: 20px;
    text-align: center;
}

.input-form h3 i {
    margin-right: 10px;
}

.data-input-tab {
    display: none;
    padding: 10px 0;
}

.data-input-tab.active {
    display: block;
}

.input-form input[type="text"],
.input-form input[type="email"],
.input-form input[type="tel"],
.input-form input[type="password"],
.input-form input[type="number"],
.input-form input[type="datetime-local"],
.input-form textarea,
.input-form select {
    width: 100%;
    padding: 12px 18px;
    margin-bottom: 15px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-large);
    font-size: 1em;
    color: var(--text-dark);
    background-color: white;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.input-form input:focus,
.input-form textarea:focus,
.input-form select:focus {
    border-color: var(--primary-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.input-form textarea {
    min-height: 80px;
    resize: vertical;
}

.input-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

/* Checkbox specific styling */
.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer;
    font-weight: normal;
    font-size: 0.95em;
    color: var(--text-dark);
}

.checkbox-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-blue);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-container input[type="checkbox"]:checked {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.checkbox-container input[type="checkbox"]:checked::after {
    content: '\2713';
    font-size: 14px;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Design Options (Step 3) */
.design-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.design-group {
    background-color: white;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-small);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.design-group.hidden {
    display: none;
}

.design-group h4 {
    color: var(--primary-blue);
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

.design-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.95em;
}

.design-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-small);
    padding: 3px;
    margin-bottom: 15px;
    cursor: pointer;
}

.design-group select {
    width: 100%;
    padding: 10px 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-small);
    font-size: 1em;
    color: var(--text-dark);
    background-color: white;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.design-group select:focus {
    border-color: var(--primary-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.design-group input[type="range"] {
    width: 100%;
    appearance: none;
    height: 8px;
    background: var(--border-light);
    border-radius: 5px;
    outline: none;
    margin-top: 10px;
    margin-bottom: 10px;
}

.design-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-blue), var(--accent-color));
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.design-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-blue), var(--accent-color));
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#resolution-display {
    display: block;
    text-align: center;
    font-size: 0.9em;
    color: var(--text-light);
    margin-top: 5px;
}

.upload-btn, .remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--border-radius-large);
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.upload-btn {
    background: linear-gradient(45deg, var(--primary-green), #66bb6a);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.2);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(40, 167, 69, 0.3);
}

.remove-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.2);
}

.remove-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.3);
}

/* Barcode specific design options */
.barcode-design-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-small);
}

.barcode-design-options .input-group {
    display: flex;
    flex-direction: column;
}

.barcode-design-options label {
    margin-bottom: 5px;
    font-size: 0.9em;
    color: var(--text-light);
}

.barcode-design-options input[type="number"],
.barcode-design-options input[type="color"] {
    width: 100%;
    padding: 8px;
    border-radius: var(--border-radius-small);
    border: 1px solid var(--border-light);
}

.barcode-design-options input[type="color"] {
    height: 40px;
    padding: 3px;
}

.input-group.full-width {
    grid-column: 1 / -1;
}

.input-group span {
    text-align: center;
    font-size: 0.9em;
    color: var(--text-light);
    margin-top: 5px;
}


/* Download Options (Step 4) */
.download-info-text {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1em;
    color: var(--text-dark);
}

.download-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.download-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 20px;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow-light);
    color: white;
    text-align: center;
}

.download-png {
    background: linear-gradient(45deg, #007bff, #00c6ff);
}
.download-svg {
    background: linear-gradient(45deg, #28a745, #2ed16f);
}
.download-jpg {
    background: linear-gradient(45deg, #ffc107, #ffde59);
    color: var(--text-dark);
}

.download-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-medium);
    opacity: 0.9;
}

/* Step Navigation Buttons */
.step-nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.primary-btn, .secondary-btn {
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius-large);
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.primary-btn {
    background: linear-gradient(45deg, var(--primary-blue), var(--accent-color));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    opacity: 0.95;
}

.secondary-btn {
    background-color: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.secondary-btn:hover {
    background-color: #5a6268;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.start-over-btn {
    background: linear-gradient(45deg, #ff8c00, #ffc107);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
}

.start-over-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
}


/* QR Preview Panel (Right Panel) */
.qr-preview-wrapper {
    width: 100%;
    background-color: white;
    border: 2px dashed var(--border-light);
    border-radius: var(--border-radius-medium);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.05);
    min-height: 200px;
    min-width: 200px;
    padding: 10px;
    aspect-ratio: 1 / 1;
    transition: all 0.3s ease;
}

/* New style for barcode preview */
.qr-preview-wrapper.barcode-mode {
    aspect-ratio: auto;
    height: auto;
    min-height: 150px; /* A smaller min-height for barcode */
    padding: 20px;
}

#barcode-display {
    max-width: 100%;
    height: auto;
}

#qr-code-canvas {
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

#qr-code-canvas canvas,
#qr-code-canvas svg {
    max-width: 100%;
    max-height: 100%;
    width: auto !important;
    height: auto !important;
    display: block;
    object-fit: contain;
}


.preview-placeholder-text {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1em;
}

.preview-placeholder-text i {
    font-size: 3em;
    margin-bottom: 15px;
    color: var(--border-light);
}


/* FAQ Section */
.faq-toggle-btn {
    background: linear-gradient(45deg, #17a2b8, #20c997);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius-large);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.faq-toggle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

/* FAQ Modal */
.faq-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.faq-overlay.active {
    opacity: 1;
    visibility: visible;
}

.faq-modal {
    background-color: white;
    padding: 40px;
    border-radius: var(--border-radius-medium);
    box-shadow: 0 10px 30px var(--shadow-medium);
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.faq-overlay.active .faq-modal {
    transform: translateY(0);
    opacity: 1;
}

.faq-modal h2 {
    color: var(--primary-blue);
    margin-top: 0;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2em;
}

.faq-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2.5em;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease;
}

.faq-close-btn:hover {
    color: var(--text-dark);
}

.faq-item {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-light);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h3 {
    color: var(--text-dark);
    font-size: 1.2em;
    margin-bottom: 10px;
}

.faq-item p {
    color: var(--text-light);
    font-size: 0.95em;
    line-height: 1.8;
}

/* Footer */
.site-footer {
    background-color: var(--text-dark);
    color: white;
    padding: 30px 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.8;
}

.social-links a {
    color: white;
    font-size: 1.5em;
    margin-left: 20px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-blue);
    transform: scale(1.2);
}

/* Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 992px) {
    .generator-panels {
        flex-direction: column;
    }

    .right-panel {
        position: relative;
        top: 0;
        align-self: center;
        width: 100%;
    }

    .qr-preview-wrapper {
        max-width: 100%;
        height: auto;
    }
    
    .hero-section h1 {
        font-size: 2.5em;
    }
    .hero-section p {
        font-size: 1.1em;
    }

    .step-indicator span {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }
    .step-indicator p {
        font-size: 0.8em;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: linear-gradient(90deg, var(--primary-blue), var(--accent-color));
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        padding: 15px 0;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav a {
        margin: 10px 20px;
        text-align: center;
    }

    .menu-toggle {
        display: block;
    }

    .header-content {
        padding: 0 20px;
    }

    .hero-section {
        padding: 60px 0;
    }
    .hero-section h1 {
        font-size: 2em;
    }
    .hero-section p {
        font-size: 1em;
    }

    .generator-container {
        padding: 20px;
        margin: 20px auto;
    }

    .qr-type-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }

    .qr-type-card {
        padding: 15px;
    }
    .qr-type-card i {
        font-size: 2em;
    }
    .qr-type-card h3 {
        font-size: 1em;
    }
    .qr-type-card p {
        font-size: 0.75em;
    }

    .design-options-grid,
    .barcode-design-options {
        grid-template-columns: 1fr;
    }

    .download-options-grid {
        grid-template-columns: 1fr;
    }

    .step-nav-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .primary-btn, .secondary-btn, .start-over-btn {
        width: 100%;
        text-align: center;
    }

    .faq-modal {
        padding: 30px;
    }
    .faq-modal h2 {
        font-size: 1.8em;
    }
    .faq-close-btn {
        font-size: 2em;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    .social-links {
        margin-top: 15px;
    }
    .social-links a {
        margin: 0 10px;
    }
}

@media (max-width: 480px) {
    .logo a {
        font-size: 1.5em;
    }
    .hero-section h1 {
        font-size: 1.8em;
    }
    .hero-section p {
        font-size: 0.9em;
    }
    .generator-container {
        padding: 15px;
    }
    .step-indicator span {
        width: 35px;
        height: 35px;
        font-size: 0.9em;
    }
    .step-indicator p {
        font-size: 0.7em;
    }
    .step-panel h2 {
        font-size: 1.5em;
    }
    .input-form input,
    .input-form textarea,
    .input-form select {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    .download-btn {
        padding: 20px 15px;
        font-size: 1em;
    }
    .download-btn i {
        font-size: 2em;
    }
}