/* ==========================================================================
   QR-Font Steganography Engine - Dual UI Stylesheet (Vanilla CSS)
   ========================================================================== */

:root {
    --bg-dark: #07090e;
    --bg-card: rgba(18, 24, 38, 0.85);
    --bg-card-border: rgba(255, 255, 255, 0.1);
    --bg-input: #0f1522;
    
    --primary-cyan: #00f2fe;
    --primary-blue: #4facfe;
    --accent-green: #00e676;
    --accent-orange: #ff9100;
    
    --text-main: #f0f4f8;
    --text-muted: #8a99ad;
    --text-dim: #5c6b73;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --glow-cyan: 0 0 24px rgba(0, 242, 254, 0.3);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.5);
    --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.light-theme {
    --bg-dark: #f0f4f8;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-border: rgba(0, 0, 0, 0.1);
    --bg-input: #ffffff;
    
    --primary-cyan: #0088ff;
    --primary-blue: #0055ff;
    --text-main: #111827;
    --text-muted: #4b5563;
    --text-dim: #6b7280;
    
    --glow-cyan: 0 0 24px rgba(0, 136, 255, 0.2);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.background-glow {
    position: fixed;
    top: -15%;
    left: 20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.08) 0%, rgba(0, 230, 118, 0.04) 50%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Navbar & Mode Switcher */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 9, 14, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--bg-card-border);
    padding: 0.75rem 1.5rem;
}

body.light-theme .navbar {
    background: rgba(240, 244, 248, 0.9);
}

.nav-container {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
}

.logo-icon { font-size: 1.4rem; }
.logo-text .highlight { color: var(--primary-cyan); }

/* Mode Switcher Tabs */
.ui-mode-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border-radius: 50px;
    border: 1px solid var(--bg-card-border);
}
body.light-theme .ui-mode-tabs {
    background: rgba(0, 0, 0, 0.05);
}

.mode-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.mode-tab.active {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
    color: #040711;
    font-weight: 700;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.network-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.2);
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-family: var(--font-mono);
    color: var(--primary-cyan);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Main Content Views */
.main-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.view-panel {
    display: none;
}

.view-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
}

.view-header h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-cyan), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.view-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.2rem;
}

/* Phone QR Card */
.phone-connect-card {
    background: rgba(18, 24, 38, 0.9);
    border: 1px solid rgba(0, 242, 254, 0.3);
    border-radius: var(--radius-md);
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-soft);
}

#mobile-qr-box canvas, #mobile-qr-box img {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    background: #fff;
    padding: 4px;
}

.qr-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-width: 200px;
}

.qr-info strong {
    font-size: 0.88rem;
    color: var(--primary-cyan);
}

.qr-info span {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Generator Workspace Grid */
.generator-workspace {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2rem;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    box-shadow: var(--shadow-soft);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--text-main);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.label-badge {
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary-cyan);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.input-row {
    display: flex;
    gap: 0.5rem;
}

input[type="text"], select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 0.75rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

input[type="text"]:focus, select:focus {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

.style-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.control-box label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary-cyan);
}

/* Preview Card */
.preview-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.title-with-status {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.status-pill {
    background: rgba(0, 230, 118, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(0, 230, 118, 0.3);
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 0.6rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
    color: #040711;
    font-weight: 700;
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-cyan);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn-block { width: 100%; justify-content: center; }

.font-render-stage {
    background: #020408;
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    overflow-x: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    margin-bottom: 1.2rem;
}

#desktop-encoded-canvas {
    display: block;
    max-width: 100%;
}

.payload-summary-bar {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
}

.summary-item { display: flex; gap: 0.4rem; }
.sum-label { color: var(--text-muted); }
.code-font { font-family: var(--font-mono); }
.highlight-cyan { color: var(--primary-cyan); }

/* Streamlined Mobile Phone Scanner Layout */
.scanner-mobile-wrapper {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.mobile-header {
    text-align: center;
}

.mobile-header h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
}

/* Button ON TOP of Camera Area */
.top-camera-controls {
    margin-bottom: 0.5rem;
}

.btn-lg {
    padding: 1.05rem;
    font-size: 1.05rem;
}

.viewfinder-box {
    position: relative;
    width: 100%;
    height: 380px;
    background: #020408;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid rgba(0, 242, 254, 0.35);
    box-shadow: var(--glow-cyan);
}

#phone-camera-video, #phone-scanner-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reticle-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.corner {
    position: absolute;
    width: 28px;
    height: 28px;
    border-color: var(--primary-cyan);
    border-style: solid;
}

.tl { top: 20px; left: 20px; border-width: 4px 0 0 4px; }
.tr { top: 20px; right: 20px; border-width: 4px 4px 0 0; }
.bl { bottom: 20px; left: 20px; border-width: 0 0 4px 4px; }
.br { bottom: 20px; right: 20px; border-width: 0 4px 4px 0; }

.laser-scanner-line {
    position: absolute;
    top: 25%;
    left: 8%;
    width: 84%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-cyan), transparent);
    box-shadow: 0 0 18px var(--primary-cyan);
    animation: mobileScan 2s ease-in-out infinite alternate;
}

@keyframes mobileScan {
    0% { top: 20%; opacity: 0.3; }
    100% { top: 80%; opacity: 1; }
}

.scan-pill {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(0, 242, 254, 0.4);
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-cyan);
    white-space: nowrap;
}

/* DECODED RESULT DIRECTLY BELOW CAMERA AREA */
.decoded-card-result {
    background: var(--bg-card);
    border: 1px solid rgba(0, 230, 118, 0.35);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.decoded-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
}

.badge-waiting {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.badge-success {
    background: rgba(0, 230, 118, 0.2);
    color: var(--accent-green);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.decoded-text-box {
    background: #020408;
    border: 1px solid rgba(0, 230, 118, 0.4);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    font-family: var(--font-mono);
    font-size: 1.15rem;
    color: var(--accent-green);
    word-break: break-all;
    min-height: 64px;
    display: flex;
    align-items: center;
}

.dim-text { color: var(--text-dim); font-size: 0.9rem; font-family: var(--font-sans); }

.decoded-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.btn-accent {
    background: linear-gradient(135deg, #00e676, #00b0ff);
    color: #000;
    font-weight: 800;
    padding: 0.9rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.hidden { display: none !important; }

/* Fullscreen Modal */
.fullscreen-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.btn-close-modal {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.1rem;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
}

.modal-content {
    text-align: center;
    max-width: 95vw;
}

.modal-hint {
    color: var(--primary-cyan);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

#fullscreen-encoded-canvas {
    max-width: 90vw;
    background: #000;
    border: 2px solid var(--primary-cyan);
    border-radius: 8px;
    padding: 1rem;
}

.modal-payload {
    margin-top: 1.5rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 1.1rem;
}

@media (max-width: 900px) {
    .generator-workspace { grid-template-columns: 1fr; }
    .view-header { flex-direction: column; align-items: flex-start; }
    .phone-connect-card { width: 100%; }
}

@media (max-width: 600px) {
    .nav-container { flex-direction: column; gap: 1rem; align-items: center; }
    .ui-mode-tabs { width: 100%; justify-content: space-between; }
    .mode-tab { flex: 1; justify-content: center; }
    .view-header h1 { font-size: 1.8rem; }
    .glass-card { padding: 1.2rem; }
}
