/* ============================================================
   QR Generator — Main Stylesheet
   ============================================================ */

:root {
    --color-primary:      #1A56DB;
    --color-primary-dark: #1347BF;
    --color-primary-light:#EBF0FD;
    --color-accent:       #d48d11;
    --color-bg:           #F3F4F6;
    --color-input-bg:     #fffde3;
    --color-surface:      #FFFFFF; 
    --color-border:       #E5E7EB;
    --color-text:         #111827;
    --color-text-muted:   #6B7280;
    --color-success:      #10B981;
    --radius-sm:  5px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:  0 4px 12px rgba(0,0,0,.10);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --max-w: 1060px;
    --transition: .18s ease; 
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.hero-banner a,
.hero-banner a:hover,
.hero-banner a h1,
.hero-banner a p {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* ---- Utility ---- */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   HEADER 
   ============================================================ */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-text);
    margin-right: 10px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -.7px;
    color: var(--color-text);
}
.logo-text strong {
    font-weight: 800;
    color: var(--color-primary);
}

/* ============================================================
   HERO BANNER
   ============================================================ */
.hero-banner {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: #fff;
    padding: 10px 20px;
}

.hero-banner .header-inner {
    gap: 10px;
    justify-content: center;
}

@media (min-width: 760px) {
    .hero-banner .header-inner {
        justify-content: flex-start;
        padding-left: 24px;
    }
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 0px;
    text-align: left;
}

.hero-banner h1 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .01em;
    margin-bottom: 1px;
}

.hero-sub {
    font-size: .72rem;
    font-weight: 400;
    opacity: .8;
    margin-top: -2px;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ============================================================
   MAIN CONTAINER
   ============================================================ */
.main-container {
    flex: 1;
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 20px 16px 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card { 
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

/* ============================================================
   AD-BLOCK NOTICE
   ============================================================ */
.support-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 12px 20px;
    font-size: .9rem;
    color: #664d03;
    line-height: 1.4;
    max-width: var(--max-w);
    margin: 0 auto;
}

.support-notice.is-hidden { display: none; }

.support-notice svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--color-accent);
}

/* Hide everything except hero banner when ad blocker is active */
body.adblock-active .main-container,
body.adblock-active .site-footer {
    display: none;
}

/* ============================================================
   ADS
   ============================================================ */
.ad-slot {
    width: 100%;
}

.ad-label {
    display: block;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ad-placeholder {
    background: var(--color-surface);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 13px;
}

/* ============================================================
   GENERATOR CARD
   ============================================================ */
.generator-card {
    padding: 20px;
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 18px;
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 10px;
    border: none;
    border-radius: calc(var(--radius-sm) - 2px);
    background: transparent;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}

.tab svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.tab:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.tab.active {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}
  
/* ---- Tab panels ---- */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Inputs ---- */
.input-group {
    margin-bottom: 6px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1px;
    margin-top: 4px;
}

.text-input,
.select-input {
    width: 100%;
    padding: 0 14px;
    height: 40px;
    font-family: var(--font);
    font-size: 15px;
    color: var(--color-text);
    background: var(--color-input-bg);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm) !important;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.text-input::placeholder { color: #9CA3AF; }

.text-input:focus,
.select-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.15);
    background: #fff;
}

.select-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 38px;
    cursor: pointer;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ---- Generate button ---- */
.btn-generate {
    width: 100%;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 2px 8px rgba(26,86,219,.35);
}

.btn-generate svg {
    width: 20px;
    height: 20px;
}

.btn-generate:hover {
    background: var(--color-primary-dark);
    box-shadow: 0 4px 16px rgba(26,86,219,.4);
    transform: translateY(-1px);
}

.btn-generate:active {
    transform: translateY(0);
}

/* ============================================================
   INLINE COLLAPSABLE SETTINGS (inside generator-card)
   ============================================================ */
.settings-inline {
    margin-top: 16px;
    margin-bottom: 10px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.settings-inline-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background var(--transition), color var(--transition);
}

.settings-inline-toggle::-webkit-details-marker { display: none; }

.settings-inline-toggle svg:first-child {
    width: 16px; height: 16px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.settings-inline-toggle .chevron {
    margin-left: auto;
    width: 16px; height: 16px;
    transition: transform var(--transition);
}

details[open] .settings-inline-toggle .chevron {
    transform: rotate(180deg);
}

.settings-inline-toggle:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.settings-inline-body {
    border-top: 1.5px solid var(--color-border);
    padding: 12px 14px 4px;
    background: var(--color-bg);
}

.settings-inline-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: end;
}

@media (min-width: 480px) {
    .settings-inline-row {
        grid-template-columns: 1fr auto 1fr;
    }
}

.settings-inline-row .color-input {
    height: 40px;
}

/* ============================================================
   SETTINGS CARD
   ============================================================ */
.settings-card {
    padding: 20px;
}

.settings-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--color-text);
}

.color-input {
    width: 100%;
    height: 40px;
    padding: 3px 4px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm) !important;
    background: var(--color-surface);
    cursor: pointer;
}

/* ============================================================
   RESULT CARD
   ============================================================ */
.result-card {
    padding: 20px;
    animation: fadeIn .3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* QR + button stacked */
.result-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qr-preview {
    display: flex;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.qr-preview canvas,
.qr-preview svg {
    display: block;
    width: 100% !important;
    height: 100% !important;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

/* ---- Download buttons ---- */
.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 16px;
    height: 48px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: not-allowed;
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    white-space: nowrap;
    opacity: .5;
}

.btn-download svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.btn-download:not(:disabled) {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
    cursor: pointer;
    opacity: 1;
    box-shadow: 0 2px 8px rgba(16,185,129,.35);
}

.btn-download:not(:disabled):hover {
    background: #0da271;
    border-color: #0da271;
    box-shadow: 0 4px 16px rgba(16,185,129,.4);
    transform: translateY(-1px);
}

.btn-download:not(:disabled):active { transform: translateY(0); }

/* ============================================================
   ACCORDION
   ============================================================ */
.accordion-card {}

.accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: none;
    border: none;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
    transition: background var(--transition);
}

.accordion-toggle:hover { background: var(--color-bg); }

.accordion-toggle svg:first-child {
    width: 20px; height: 20px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.badge-soon {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: var(--color-accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
    float: right;
}

.chevron {
    width: 18px; height: 18px;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.accordion-toggle[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

.accordion-body {
    display: none;
    padding: 0 20px 20px;
    border-top: 1px solid var(--color-border);
}

.accordion-body.open { display: block; }

.coming-soon-text {
    padding-top: 16px;
    color: var(--color-text-muted);
    font-size: 14px;
}

/* ============================================================
   INFO CARD
   ============================================================ */
.info-card {
    padding: 24px 20px;
    padding-bottom: 0;
}

.info-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-text);
}

.info-card h3 {
    font-size: .95rem;
    font-weight: 700;
    margin: 18px 0 8px;
    color: var(--color-text);
}

.info-card p,
.info-card li {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.7;
}

.info-card ol {
    padding-left: 20px;
}

.info-card li { margin-bottom: 4px; }

/* ---- FAQ ---- */
.faq-card { padding-bottom: 20px; }

.faq-list { margin-top: 4px; }

.faq-list dt {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    margin-top: 16px;
}

.faq-list dd {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 16px 20px;
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    color: var(--color-text-muted);
    flex-wrap: wrap;
}

.footer-inner a { color: var(--color-text-muted); }
.footer-inner a:hover { color: var(--color-primary); }

/* ============================================================
   ANIMATIONS & STATES
   ============================================================ */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.shake { animation: shake .35s ease; } 

.text-input.input-error { 
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,.15);
    background: #FFF5F5;
}
 
.field-error {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #EF4444;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 400px) {
    .input-row { grid-template-columns: 1fr; }
    .tab { font-size: 13px; gap: 4px; padding: 8px 6px; }
    .tab svg { width: 14px; height: 14px; }
    .hero-banner h1 { font-size: 1rem; }
}

@media (min-width: 600px) {
    .hero-banner h1 { font-size: 1.3rem; }
    .main-container { padding: 28px 24px 60px; }
} 

/* Hide result card by default (mobile) */
.result-card.is-hidden { display: none; }

@media (min-width: 760px) {
    /* 7-column grid: generator=3, settings=2, result=2 */
    .main-container {
        display: grid;
        grid-template-columns: repeat(9, 1fr);
        align-items: start;
        gap: 16px;
    }

    .generator-card { grid-column: span 6; }
    .result-card    { grid-column: span 3; }

    /* Full-width elements */
    .support-notice,
    .ad-slot,
    .accordion-card,
    .info-card {
        grid-column: 1 / -1;
    }

    /* Always show result card on desktop */
    .result-card.is-hidden { display: block; }

}

/* ---- QR Frame ---- */
.qr-frame-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.qr-frame-wrapper.frame-simple {
    border: 2px solid #000;
    padding: 6px;
    background: #fff;
}

.qr-frame-wrapper.frame-rounded {
    border: 2px solid #000;
    border-radius: 14px;
    padding: 6px;
    background: #fff;
}

.qr-frame-wrapper.frame-banner {
    border: 2px solid #000;
    border-radius: 10px;
    padding: 6px 6px 0;
    overflow: hidden;
    background: #fff;
}

.qr-frame-wrapper.frame-ticket {
    border: 2px dashed #555;
    padding: 6px;
    background: #fff;
}

.frame-label {
    display: none;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    letter-spacing: .05em;
    padding: 3px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.frame-banner .frame-label {
    display: block;
    background: #000;
    color: #fff;
}

.frame-simple .frame-label,
.frame-rounded .frame-label,
.frame-ticket .frame-label {
    display: block;
    color: #000;
    padding-top: 4px;
}

/* ---- QR Placeholder ---- */
.qr-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    border: 2px dashed #D1D5DB;
    border-radius: var(--radius-sm);
    text-align: center;
    padding: 8px;
    box-sizing: border-box;
}

.qr-placeholder p {
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 0;
    max-width: 160px;
    word-wrap: break-word;
}
