/* QR Code Generator - style.css */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
    --primary:#6c5ce7;--primary-dark:#5a4bd1;--accent:#00cec9;
    --bg:#f0f2f5;--card:#fff;--text:#2d3436;--text-light:#636e72;
    --border:#dfe6e9;--radius:12px;--shadow:0 2px 16px rgba(0,0,0,0.07);
    --input-bg:#fff;
}
[data-theme="dark"]{
    --bg:#1a1a2e;--card:#16213e;--text:#e0e0e0;--text-light:#a0a0b0;
    --border:#2a2a4a;--shadow:0 2px 16px rgba(0,0,0,0.3);
    --input-bg:#1a1a2e;
}
body{
    font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Noto Sans JP',sans-serif;
    background:var(--bg);color:var(--text);line-height:1.6;
    transition:background 0.3s,color 0.3s;
}

/* Header */
header{
    background:linear-gradient(135deg,var(--primary) 0%,#a29bfe 50%,var(--accent) 100%);
    color:#fff;padding:2.5rem 1rem 2rem;
}
.header-inner{
    max-width:1100px;margin:0 auto;display:flex;
    justify-content:space-between;align-items:center;
}
header h1{font-size:2.2rem;font-weight:800;letter-spacing:-0.02em}
header p{opacity:0.9;margin-top:0.4rem;font-size:1.05rem}
#theme-toggle{
    background:rgba(255,255,255,0.2);border:none;color:#fff;
    width:44px;height:44px;border-radius:50%;cursor:pointer;
    font-size:1.3rem;transition:all 0.3s;display:flex;
    align-items:center;justify-content:center;flex-shrink:0;
}
#theme-toggle:hover{background:rgba(255,255,255,0.35);transform:rotate(20deg)}

/* Main Layout */
main{
    max-width:1100px;margin:2rem auto;padding:0 1rem;
    display:grid;grid-template-columns:1fr 1fr;gap:2rem;
}
.panel{
    background:var(--card);border-radius:var(--radius);
    padding:1.5rem;box-shadow:var(--shadow);
}
.panel h2{
    font-size:1.15rem;margin-bottom:1rem;padding-bottom:0.5rem;
    border-bottom:2px solid var(--primary);color:var(--primary);
}
.panel h3{font-size:0.95rem;margin:1.2rem 0 0.6rem;color:var(--text-light)}

/* Type Tabs */
.type-tabs{display:flex;gap:0.4rem;flex-wrap:wrap}
.tab{
    padding:0.45rem 0.9rem;border:2px solid var(--border);border-radius:8px;
    background:var(--input-bg);color:var(--text);cursor:pointer;
    font-size:0.88rem;font-weight:600;transition:all 0.2s ease;
}
.tab:hover{border-color:var(--primary);color:var(--primary)}
.tab.active{background:var(--primary);color:#fff;border-color:var(--primary)}

/* Input Groups */
.inputs{margin-top:1rem}
.input-group{display:none}
.input-group.active{display:block}
.input-group label{
    display:block;font-size:0.82rem;font-weight:600;
    margin-bottom:0.7rem;color:var(--text-light);
}
.input-group input,.input-group textarea,.input-group select{
    width:100%;padding:0.55rem 0.75rem;border:2px solid var(--border);
    border-radius:8px;font-size:0.92rem;margin-top:0.25rem;
    transition:border-color 0.2s;font-family:inherit;
    background:var(--input-bg);color:var(--text);
}
.input-group input:focus,.input-group textarea:focus,.input-group select:focus{
    outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(108,92,231,0.12);
}
.input-hint{
    font-size:0.75rem;color:var(--text-light);margin-top:0.3rem;
    font-style:italic;opacity:0.8;
}
.checkbox-inline{
    display:inline-flex !important;align-items:center;gap:0.4rem;
    font-size:0.82rem;cursor:pointer;margin-top:0.2rem;
}
.checkbox-inline input[type="checkbox"]{
    width:16px;height:16px;accent-color:var(--primary);margin:0;
}

/* Customize Grid */
.customize{display:grid;grid-template-columns:1fr 1fr;gap:0.7rem}
.customize label{
    display:flex;flex-direction:column;font-size:0.82rem;
    font-weight:600;color:var(--text-light);
}
.customize input[type="color"]{
    width:100%;height:36px;border:2px solid var(--border);border-radius:8px;
    cursor:pointer;margin-top:0.25rem;padding:2px;
}
.customize select{
    padding:0.45rem;border:2px solid var(--border);border-radius:8px;
    margin-top:0.25rem;font-family:inherit;
}

/* Dot Styles */
.dot-styles{display:flex;gap:0.4rem;flex-wrap:wrap}
.dot-btn{
    padding:0.4rem 0.8rem;border:2px solid var(--border);border-radius:8px;
    background:var(--input-bg);color:var(--text);cursor:pointer;
    font-size:0.82rem;font-weight:600;transition:all 0.2s;
}
.dot-btn:hover{border-color:var(--primary);color:var(--primary)}
.dot-btn.active{background:var(--primary);color:#fff;border-color:var(--primary)}

/* Logo Upload */
.logo-upload{position:relative}
#logo-input{display:none}
.logo-drop-area{
    display:flex;align-items:center;justify-content:center;
    min-height:70px;border:2px dashed var(--border);border-radius:8px;
    cursor:pointer;font-size:0.85rem;color:var(--text-light);
    transition:all 0.2s;text-align:center;padding:0.8rem;
}
.logo-drop-area:hover,.logo-drop-area.dragover{
    border-color:var(--primary);background:rgba(108,92,231,0.05);
}
#logo-preview-wrap{display:flex;align-items:center;gap:0.8rem;margin-top:0.5rem}
#logo-preview{width:48px;height:48px;object-fit:contain;border-radius:6px;border:1px solid var(--border)}
.btn-sm{
    padding:0.3rem 0.8rem;border:1px solid #d63031;border-radius:6px;
    background:#fff;color:#d63031;font-size:0.78rem;cursor:pointer;
}
.btn-sm:hover{background:#d63031;color:#fff}

/* Free Badge */
.free-badge{
    background:#00b894;color:#fff;padding:0.1rem 0.45rem;
    border-radius:4px;font-size:0.68rem;vertical-align:middle;font-weight:700;
}

/* Generate Button */
.btn-primary{
    width:100%;padding:0.85rem;background:var(--primary);color:#fff;
    border:none;border-radius:8px;font-size:1rem;font-weight:700;
    cursor:pointer;margin-top:1.5rem;transition:all 0.25s;
    box-shadow:0 4px 12px rgba(108,92,231,0.3);
}
.btn-primary:hover{background:var(--primary-dark);transform:translateY(-1px)}
.btn-primary:active{transform:translateY(0)}

/* QR Preview */
.qr-container{
    display:flex;justify-content:center;align-items:center;
    min-height:320px;background:var(--input-bg);border-radius:10px;
    border:2px dashed var(--border);margin-bottom:1rem;overflow:hidden;
    transition:background 0.3s;
}
#qr-canvas{max-width:100%;height:auto;display:none;border-radius:6px}
.placeholder{color:var(--text-light);font-size:0.9rem;text-align:center;padding:2rem;line-height:1.8}

/* Download Buttons */
.actions{display:none;gap:0.7rem;margin-bottom:1rem}
.actions.visible{display:flex}
.btn-dl{
    flex:1;padding:0.65rem;border:2px solid var(--primary);border-radius:8px;
    background:var(--card);color:var(--primary);font-weight:600;font-size:0.9rem;
    cursor:pointer;transition:all 0.2s;font-family:inherit;
}
.btn-dl:hover{background:var(--primary);color:#fff}

/* Usage */
.usage{text-align:center;font-size:0.84rem;color:var(--text-light);padding-top:0.5rem}

/* Premium Banner */
.premium-banner{
    max-width:1100px;margin:2rem auto;padding:2rem 1.5rem;
    background:linear-gradient(135deg,#6c5ce7 0%,#a29bfe 100%);
    color:#fff;border-radius:var(--radius);text-align:center;
    box-shadow:0 4px 20px rgba(108,92,231,0.25);
}
.premium-banner h2{font-size:1.4rem;margin-bottom:1rem}
.pro-features{
    display:flex;justify-content:center;flex-wrap:wrap;gap:0.6rem;margin-bottom:1.5rem;
}
.pro-features span{
    background:rgba(255,255,255,0.2);padding:0.35rem 0.8rem;
    border-radius:20px;font-size:0.85rem;
}
.pro-features span::before{content:"\2713 "}
.btn-premium{
    padding:0.8rem 2.5rem;background:#fff;color:var(--primary);
    border:none;border-radius:8px;font-size:1rem;font-weight:700;
    cursor:pointer;transition:transform 0.2s;
}
.btn-premium:hover{transform:scale(1.03)}

/* Why Section */
.why-section{
    max-width:1100px;margin:2.5rem auto;padding:0 1rem;
}
.why-section h2{
    text-align:center;font-size:1.5rem;margin-bottom:2rem;color:var(--text);
}
.why-grid{
    display:grid;grid-template-columns:repeat(3,1fr);gap:1.5rem;
}
.why-card{
    background:var(--card);border-radius:var(--radius);padding:1.5rem;
    box-shadow:var(--shadow);text-align:center;transition:transform 0.2s;
}
.why-card:hover{transform:translateY(-4px)}
.why-icon{font-size:2rem;margin-bottom:0.8rem}
.why-card h3{font-size:1rem;margin-bottom:0.5rem;color:var(--primary)}
.why-card p{font-size:0.85rem;color:var(--text-light);line-height:1.7}

/* Feedback */
.feedback-section{max-width:600px;margin:2rem auto;text-align:center;padding:0 1rem}
.feedback-section h2{font-size:1.2rem;margin-bottom:0.5rem}
.feedback-section p{font-size:0.9rem;color:var(--text-light);margin-bottom:1rem}
.btn-feedback{display:inline-block;padding:0.6rem 2rem;background:var(--card);color:var(--primary);border:2px solid var(--primary);border-radius:8px;text-decoration:none;font-weight:600;font-size:0.9rem;transition:all 0.2s}
.btn-feedback:hover{background:var(--primary);color:#fff}

/* Ad Space */
.ad-space{
    max-width:1100px;margin:1rem auto;padding:0.8rem;
    background:#e9ecef;text-align:center;border-radius:8px;
    color:#adb5bd;font-size:0.78rem;min-height:60px;
    display:flex;align-items:center;justify-content:center;
}
.ad-space::after{content:"Ad Space (Google AdSense)"}

/* Footer */
footer{text-align:center;padding:2rem 1rem;color:var(--text-light);font-size:0.83rem}
footer a{color:var(--primary);text-decoration:none}
footer a:hover{text-decoration:underline}

/* Customize select dark mode */
.customize select{
    background:var(--input-bg);color:var(--text);
}

/* QR Generation Animation */
@keyframes qrPulse{
    0%{transform:scale(0.9);opacity:0}
    50%{transform:scale(1.02)}
    100%{transform:scale(1);opacity:1}
}
#qr-canvas.animate{animation:qrPulse 0.4s ease-out}

/* Mode Toggle */
.mode-toggle-wrap{
    max-width:1100px;margin:1.5rem auto 0;padding:0 1rem;
    display:flex;gap:0.5rem;
}
.mode-btn{
    flex:1;padding:0.7rem 1rem;border:2px solid var(--border);border-radius:10px;
    background:var(--card);color:var(--text);cursor:pointer;
    font-size:0.95rem;font-weight:700;transition:all 0.2s;
    text-align:center;font-family:inherit;
}
.mode-btn:hover{border-color:var(--primary);color:var(--primary)}
.mode-btn.active{
    background:var(--primary);color:#fff;border-color:var(--primary);
    box-shadow:0 3px 10px rgba(108,92,231,0.25);
}

/* QR Reader */
.reader-desc{font-size:0.88rem;color:var(--text-light);margin-bottom:1rem;line-height:1.6}
.reader-upload{position:relative}
#reader-input{display:none}
.reader-drop-area{
    display:flex;flex-direction:column;align-items:center;justify-content:center;
    gap:0.5rem;min-height:180px;border:2px dashed var(--border);border-radius:10px;
    cursor:pointer;transition:all 0.2s;padding:2rem;text-align:center;
}
.reader-drop-area:hover,.reader-drop-area.dragover{
    border-color:var(--primary);background:rgba(108,92,231,0.05);
}
.reader-drop-icon{font-size:2.5rem}
.reader-drop-hint{font-size:0.75rem;color:var(--text-light);opacity:0.7}
#reader-image-wrap{text-align:center;margin-top:1rem}
#reader-canvas{max-width:100%;border-radius:8px;border:1px solid var(--border)}
.reader-result{
    min-height:200px;display:flex;align-items:center;justify-content:center;
    flex-direction:column;padding:1.5rem;
}
.decoded-label{font-size:0.82rem;color:var(--text-light);font-weight:600;margin-bottom:0.5rem}
.decoded-text{
    width:100%;padding:1rem;background:var(--input-bg);border:2px solid var(--border);
    border-radius:8px;font-size:0.95rem;word-break:break-all;line-height:1.6;
    max-height:200px;overflow-y:auto;margin-bottom:1rem;
}
.decoded-actions{display:flex;gap:0.5rem;width:100%}
.decoded-actions .btn-dl{flex:1}

/* History */
.history-section{
    max-width:1100px;margin:2rem auto;padding:0 1rem;
}
.history-section h2{
    font-size:1.15rem;margin-bottom:1rem;color:var(--text);
}
.history-section h2 span{font-size:0.82rem;color:var(--text-light);font-weight:400}
.history-grid{
    display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:0.8rem;
}
.history-item{
    background:var(--card);border-radius:8px;padding:0.5rem;
    box-shadow:var(--shadow);cursor:pointer;transition:all 0.2s;
    text-align:center;overflow:hidden;
}
.history-item:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,0.12)}
.history-item img{width:100%;border-radius:4px;aspect-ratio:1/1;object-fit:contain}
.history-item .hist-label{
    font-size:0.7rem;color:var(--text-light);margin-top:0.3rem;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.history-empty{
    text-align:center;color:var(--text-light);font-size:0.88rem;
    padding:1.5rem;grid-column:1/-1;
}

/* Responsive */
@media(max-width:768px){
    main{grid-template-columns:1fr;gap:1.2rem}
    header{padding:1.8rem 1rem 1.5rem}
    header h1{font-size:1.6rem}
    .customize{grid-template-columns:1fr}
    .pro-features{flex-direction:column;align-items:center}
    .qr-container{min-height:250px}
    .why-grid{grid-template-columns:1fr 1fr}
    .history-grid{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}
}
@media(max-width:480px){
    .type-tabs{gap:0.3rem}
    .tab{padding:0.35rem 0.65rem;font-size:0.8rem}
    .panel{padding:1rem}
    .why-grid{grid-template-columns:1fr}
    .header-inner{flex-direction:column;gap:1rem;text-align:center}
    .mode-toggle-wrap{flex-direction:column}
    .history-grid{grid-template-columns:repeat(3,1fr)}
}
.skip-to-content{position:absolute;top:-100%;left:0;background:var(--accent,#4a6cf7);color:#fff;padding:8px 16px;z-index:10000;font-size:.9rem;border-radius:0 0 4px 0;transition:top .2s}.skip-to-content:focus{top:0}
