/* ============================================
   Barcode Generator - AmazeNepal Design System
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --text-dark: #2d3748;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --error-color: #e53e3e;
    --success-color: #48bb78;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.6;
}

/* ============================================
   HEADER
   ============================================ */

.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-dark);
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-tagline {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.nav-link:hover {
    background: var(--primary-gradient);
    color: white;
}

.nav-link i {
    font-size: 0.875rem;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    background: var(--primary-gradient);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.hero-title i {
    font-size: 3rem;
}

.hero-description {
    font-size: 1.125rem;
    opacity: 0.95;
    line-height: 1.8;
}

/* ============================================
   GENERATOR CONTAINER
   ============================================ */

.generator-container {
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* ============================================
   LEFT PANEL
   ============================================ */

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

/* Format Selector */
.format-selector {
    margin-bottom: 1rem;
}

.format-dropdown {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.format-dropdown optgroup {
    font-weight: 700;
    color: var(--text-dark);
    font-style: normal;
}

.format-dropdown option {
    padding: 0.5rem;
    font-weight: 400;
}

/* Format Info */
.format-info {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-color);
}

.info-badge {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.info-badge i {
    color: var(--primary-color);
    margin-top: 0.125rem;
}

/* Input Group */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-help {
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
}

/* Range Inputs */
.input-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.input-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.input-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-sm);
}

/* Checkbox */
.input-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab i {
    font-size: 0.875rem;
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Color Picker */
.color-picker-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.color-picker {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-picker label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.color-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 60px;
    height: 45px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--bg-white);
}

.color-input-wrapper input[type="text"] {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    background: var(--bg-light);
}

/* ============================================
   RIGHT PANEL - PREVIEW
   ============================================ */

.right-panel {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.preview-section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.barcode-preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    position: relative;
    overflow: auto;
}

#barcodeCanvas,
#barcodeSVG {
    max-width: 100%;
    height: auto;
    display: none;
}

#barcodeCanvas.active,
#barcodeSVG.active {
    display: block;
}

.error-message {
    display: none;
    color: var(--error-color);
    background: rgba(229, 62, 62, 0.1);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--error-color);
    font-size: 0.875rem;
    text-align: left;
}

.error-message.show {
    display: block;
}

/* Download Buttons */
.download-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.download-btn {
    padding: 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.download-btn.primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.download-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.download-btn.secondary {
    background: var(--bg-white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.download-btn.secondary:hover {
    background: var(--primary-color);
    color: white;
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.download-btn i {
    font-size: 1rem;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 3rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-column h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: white;
}

.footer-column a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
    font-size: 0.875rem;
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1200px) {
    .generator-container {
        grid-template-columns: 1fr 450px;
    }
}

@media (max-width: 1024px) {
    .generator-container {
        grid-template-columns: 1fr;
    }

    .right-panel {
        position: static;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .hero-title {
        font-size: 1.75rem;
        flex-direction: column;
    }

    .hero-title i {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .color-picker-group {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .download-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 1rem;
    }

    .section {
        padding: 1.5rem;
    }

    .hero-section {
        padding: 2rem 1rem;
    }

    .tabs {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .tab {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .site-header,
    .site-footer,
    .left-panel,
    .download-buttons {
        display: none !important;
    }

    .generator-container {
        grid-template-columns: 1fr;
    }

    .main-container {
        max-width: 100%;
    }

    .barcode-preview-container {
        background: white;
        border: 1px solid #000;
    }
}
