/* =========================================
   Global Variables & Reset
========================================= */
:root {
    --primary-color: #4361EE; 
    --secondary-color: #F72585; 
    --bg-color: #F4F7FE; 
    --card-bg: #FFFFFF;
    --text-main: #2B2D42;
    --text-muted: #8D99AE;
    --error-text: #ef476f;
    --success-text: #2ecc71;
    --border-radius: 20px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

body.dark-mode {
    --bg-color: #0F172A; 
    --card-bg: #1E293B; 
    --text-main: #F8FAFC; 
    --text-muted: #94A3B8; 
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================================
   Navbar (Header)
========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
    transition: background-color 0.3s ease;
}

.logo {
    font-size: 20px;
    font-weight: 800;
}

.highlight {
    color: var(--primary-color);
}

.theme-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.theme-btn:hover {
    transform: scale(1.2) rotate(15deg);
}

/* =========================================
   Main Tool Layout
========================================= */
.tool-container {
    display: flex;
    justify-content: center;
    padding: 40px 5%;
}

.tool-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 900px;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: background-color 0.3s ease;
}

.card-header {
    margin-bottom: 10px;
}

.tool-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

/* =========================================
   Inputs & Controls
========================================= */
.generator-controls {
    background: var(--bg-color);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(141, 153, 174, 0.2);
    margin-bottom: 25px;
}

.control-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(141, 153, 174, 0.2);
    padding-top: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 150px;
}

.input-group label {
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-group input, 
.input-group select {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid rgba(141, 153, 174, 0.3);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus, 
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.code-font {
    font-family: 'Fira Code', monospace;
}

/* Sliders & Checkbox */
.checkbox-label {
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.sliders-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.slider-group input[type="range"] {
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* =========================================
   Barcode Preview Area
========================================= */
.workspace-area {
    text-align: left;
}

.section-label {
    font-weight: 800; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    font-size: 0.85rem;
    display: block;
    margin-bottom: 15px;
}

.barcode-display-box {
    background-color: #FFFFFF !important; 
    padding: 40px 20px;
    border-radius: 12px;
    border: 2px dashed rgba(141, 153, 174, 0.4);
    text-align: center;
    overflow-x: auto; 
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.05);
}

#barcode-svg {
    height: auto;
    display: block;
    margin: 0 auto;
}

/* =========================================
   Global Action Buttons & Status
========================================= */
.action-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 800;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(247, 37, 133, 0.2);
    transition: transform 0.2s, background 0.3s;
}

.action-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.status-message {
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 18px;
    font-weight: bold;
}
.error-text { color: var(--error-text); }
.success-text { color: var(--success-text); margin-top: 15px; text-align: center; }

/* =========================================
   SEO Content & FAQ
========================================= */
.content-section {
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 30px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: background-color 0.3s ease;
}

.content-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.content-section p, .content-section ol, .content-section ul {
    margin-bottom: 15px;
    color: var(--text-muted);
}

.content-section ol, .content-section ul {
    padding-left: 20px;
}

.content-section li {
    margin-bottom: 8px;
}

.faq-item {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(141, 153, 174, 0.2);
    padding-bottom: 15px;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

footer {
    text-align: center;
    padding: 30px 5%;
    margin-top: 20px;
    color: var(--text-muted);
}

/* =========================================
   Mobile Responsiveness
========================================= */
@media (max-width: 768px) {
    .tool-card {
        padding: 25px 15px;
    }
    
    .control-row {
        flex-direction: column;
    }
    
    .settings-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .sliders-container {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .slider-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .slider-group input[type="range"] {
        flex-grow: 1;
        margin-left: 15px;
    }
    
    .barcode-display-box {
        padding: 20px 10px;
        justify-content: flex-start; /* Allows proper side-scrolling for wide barcodes */
    }
}

/* =========================================
   Cookie Consent Banner (Original PC, Compact Mobile)
========================================= */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px; /* Restored to original PC size */
    background: var(--card-bg);
    border-radius: var(--border-radius, 20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 20px 30px; /* Restored to original PC padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    border: 2px solid var(--primary-color);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
}

/* Hidden state for smooth animation */
.cookie-banner.hidden {
    transform: translate(-50%, 150px);
    opacity: 0;
    pointer-events: none;
}

.cookie-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cookie-icon {
    font-size: 35px; /* Restored to original PC size */
}

.cookie-content p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.5;
}

.cookie-content a {
    color: var(--primary-color);
    font-weight: 800;
    text-decoration: underline;
}

.cookie-btn {
    background-color: var(--primary-color);
    padding: 12px 25px; /* Restored to original PC size */
    font-size: 1.05rem;
    width: auto;
    white-space: nowrap;
    margin-left: 20px;
}

/* =========================================
   Mobile Responsiveness (Micro Version)
========================================= */
@media (max-width: 600px) {
    .cookie-banner {
        flex-direction: column;
        gap: 6px;
        padding: 8px 12px; /* Bare minimum top and bottom padding */
        bottom: 0; /* Flushes the banner to the absolute bottom of the screen */
        border-radius: 15px 15px 0 0; /* Rounded top, flat bottom to save space */
        border-bottom: none;
        width: 100%; /* Stretches edge-to-edge on mobile */
    }
   
    .cookie-content {
        flex-direction: row; /* Puts the emoji NEXT to the text to save a whole line of height! */
        align-items: flex-start;
        text-align: left;
        gap: 8px;
    }

    .cookie-icon {
        font-size: 18px; /* Micro emoji */
        margin-top: 2px;
    }

    .cookie-content p {
        font-size: 0.75rem; /* Smallest comfortable reading size */
        line-height: 1.2; /* Tightly packs the text lines together */
    }
   
    .cookie-btn {
        width: 100%;
        margin-left: 0;
        padding: 6px; /* Extremely thin button vertically */
        font-size: 0.85rem;
        border-radius: 8px;
    }
}