/*
Theme Name: QR Code Scanner
Theme URI: https://qrcodescanner.online
Author: Your Name
Author URI: https://yourwebsite.com
Description: AdSense-friendly theme with QR Scanner + Generator, Blog, and essential pages.
Version: 2.0
License: GPL v2 or later
Text Domain: qr-scanner
*/

/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    padding: 25px;
    border-radius: 32px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

/* ===== NAVBAR ===== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 10px 20px;
    border-radius: 60px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
}
.nav-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}
.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.nav-links a {
    color: #475569;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 30px;
    transition: all 0.3s ease;
}
.nav-links a:hover,
.nav-links a.active {
    color: #ffffff;
    background: #2563eb;
}

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 5px; }
.hamburger span { display: block; width: 25px; height: 3px; background: #1e293b; border-radius: 4px; }

@media (max-width: 640px) {
    .hamburger { display: flex; }
    .nav-links { display: none; width: 100%; flex-direction: column; align-items: center; padding-top: 15px; gap: 6px; }
    .nav-links.open { display: flex; }
    .nav-links a { width: 100%; text-align: center; padding: 10px; font-size: 1rem; }
}
@media (min-width: 641px) {
    .hamburger { display: none !important; }
    .nav-links { display: flex !important; }
}

/* ===== SCANNER BOX ===== */
.scanner-box {
    position: relative;
    background: #f8fafc;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 15px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #cbd5e1;
}
#video { width: 100%; height: 100%; object-fit: cover; display: none; }
#video.active { display: block; }
.scanner-box.scanning { border: 2px solid #2563eb; }

.scan-frame {
    position: absolute;
    top: 15%; left: 15%; width: 70%; height: 70%;
    pointer-events: none;
    border: 3px solid rgba(37,99,235,0.4);
    border-radius: 16px;
    display: none; z-index: 10;
}
.scan-frame.active { display: block; }
.scan-frame::before, .scan-frame::after {
    content: ''; position: absolute; width: 30px; height: 30px;
    border-color: #2563eb; border-style: solid; border-width: 0;
}
.scan-frame::before { top: -3px; left: -3px; border-top-width: 5px; border-left-width: 5px; border-radius: 8px 0 0 0; }
.scan-frame::after { bottom: -3px; right: -3px; border-bottom-width: 5px; border-right-width: 5px; border-radius: 0 0 8px 0; }

#placeholder-icon { font-size: 5rem; opacity: 0.3; color: #94a3b8; user-select: none; }

/* ===== BUTTONS ===== */
.controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 10px 0 15px 0; }
.btn {
    background: #e2e8f0; border: none; color: #1e293b;
    padding: 10px 18px; border-radius: 60px; font-weight: 600; font-size: 0.9rem;
    cursor: pointer; transition: all 0.2s ease;
}
.btn:hover { background: #cbd5e1; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #3b82f6; box-shadow: 0 4px 15px rgba(37,99,235,0.4); }
.btn-success { background: #059669; color: white; }
.btn-success:hover { background: #10b981; box-shadow: 0 4px 15px rgba(5,150,105,0.4); }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #ef4444; box-shadow: 0 4px 15px rgba(220,38,38,0.4); }
.btn-warning { background: #d97706; color: white; }
.btn-warning:hover { background: #f59e0b; box-shadow: 0 4px 15px rgba(217,119,6,0.4); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ===== RESULT AREA ===== */
.result-area {
    background: #f8fafc; border-radius: 16px; padding: 16px 20px;
    margin-top: 10px; border-left: 4px solid #2563eb;
    display: none;
}
.result-area.show { display: block; }
.result-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: #64748b; }
.result-text { font-size: 1.1rem; font-weight: 500; color: #1e293b; padding: 8px 0; }
.result-text a { color: #2563eb; text-decoration: underline; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.result-actions .btn { flex: 1; padding: 8px 12px; font-size: 0.85rem; min-width: 70px; }
#openLinkBtn { display: none; }
#openLinkBtn.show { display: inline-flex; }

#statusMsg { text-align: center; font-size: 0.9rem; color: #2563eb; min-height: 24px; font-weight: 500; }
#fileInput { display: none; }

/* ===== PAGE CONTENT ===== */
.page-content { padding: 10px 0; }
.page-content h2 { font-size: 1.6rem; color: #1e293b; margin-bottom: 15px; border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; }
.page-content h3 { font-size: 1.2rem; color: #2563eb; margin: 20px 0 10px 0; }
.page-content p { color: #334155; line-height: 1.8; font-size: 0.98rem; margin-bottom: 14px; }
.page-content ul { color: #334155; padding-left: 20px; margin-bottom: 14px; line-height: 1.8; }
.page-content .highlight-box { background: #f8fafc; padding: 15px 20px; border-radius: 12px; border-left: 4px solid #2563eb; margin-bottom: 15px; }
.contact-email { font-size: 1.2rem; color: #2563eb; font-weight: 600; text-decoration: none; }
.contact-email:hover { text-decoration: underline; }

/* ===== AD CONTAINERS ===== */
.ad-container {
    background: #f8fafc; border-radius: 16px; padding: 10px; margin: 15px 0;
    text-align: center; border: 1px dashed #cbd5e1; min-height: 90px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ad-label { font-size: 0.65rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }

/* ===== FOOTER ===== */
.footer-credit { text-align: center; margin-top: 25px; padding-top: 15px; border-top: 1px solid #e2e8f0; color: #94a3b8; font-size: 0.75rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .container { padding: 15px 10px; }
    .scanner-box { max-width: 100%; }
    h1 { font-size: 1.6rem; }
    .btn { padding: 8px 10px; font-size: 0.8rem; min-width: 70px; }
}