/* assets/css/style.css */
:root {
    --bg-main: #0f1016;
    --bg-panel: #171821;
    --bg-input: #232533;
    
    --text-main: #ffffff;
    --text-muted: #8b8d9b;
    
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    
    --border-color: #2e303e;
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 4px 30px rgba(99, 102, 241, 0.15);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, #a5a6b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Typography */
h2, h3 {
    font-weight: 600;
    letter-spacing: -0.5px;
}
.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Main Grid Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.page-h1 {
    grid-column: 1 / -1;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

@media (max-width: 800px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .page-h1 {
        font-size: 1.3rem;
    }
}

.panel {
    background-color: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.panel-header {
    margin-bottom: 2rem;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}
input[type="url"],
input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.2s ease;
}
input[type="url"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 100%;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
input[type="color"]::-webkit-color-swatch { border-radius: 4px; border: none; }

.style-select {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    appearance: none;
}
.style-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Header Logo Styling */
.top-nav .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    height: 48px; /* Reduced from default to fit well in header */
    width: auto;
    transform: rotate(15deg); /* Tips the logo to the right, simulating a pouring motion */
    transition: transform 0.3s ease;
    transform-origin: bottom right; /* Ensures the rotation pivots naturally */
}

.brand-logo:hover {
    transform: rotate(25deg); /* Pours slightly more on hover */
}

/* Footer */
.app-footer {
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 3rem 2rem;
    background-color: var(--bg-panel);
}

/* Affiliate Strip */
.affiliate-strip {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
}

.affiliate-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.affiliate-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.affiliate-link {
    font-size: 0.82rem;
    color: #a5b4fc;
    text-decoration: none;
    padding: 0.25rem 0.6rem;
    border: 1px solid rgba(165, 180, 252, 0.25);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, color 0.2s;
}

.affiliate-link:hover {
    color: #fff;
    border-color: rgba(165, 180, 252, 0.6);
}

/* UTM Parameter Builder */
.utm-section {
    margin-bottom: 0.75rem;
}

.utm-toggle {
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
    font-family: inherit;
}

.utm-toggle:hover {
    color: var(--accent-primary-hover);
}

.utm-fields {
    margin-top: 10px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.utm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.utm-grid label {
    display: block;
    font-size: 0.78rem;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-weight: 500;
}

.utm-grid input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Scan History Sparkline */
.sparkline {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 24px;
    margin-top: 6px;
    opacity: 0.8;
}

.spark-bar {
    flex: 1;
    background: var(--accent-primary);
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: height 0.4s ease, opacity 0.2s;
    cursor: default;
}

.spark-bar:hover {
    opacity: 1;
    background: #a5b4fc;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
}

.brand-logo-small {
    height: 30px;
    width: auto;
    transform: rotate(15deg);
    transition: transform 0.3s ease;
    transform-origin: bottom right;
}

.brand-logo-small:hover {
    transform: rotate(25deg);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}
.btn-primary {
    background-color: var(--accent-primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--accent-primary-hover);
    box-shadow: var(--shadow-glow);
}
.btn-secondary {
    background-color: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: #2a2c3d;
}
.btn-outline {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}
.btn-outline:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}
.btn-outline.active {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}
.btn-full {
    width: 100%;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form layouts */
.type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
}
.type-selector .btn {
    flex: 1;
}

/* Helpers */
.hidden {
    display: none !important;
}

/* Edit Modal specific */
#edit-modal .modal-content {
  border-top: 4px solid var(--accent-primary);
}

/* Preview Area */
.preview-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}
.qr-render-area {
    background: var(--bg-main);
    padding: 2rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Dashboard List */
.dashboard-area {
    margin-top: 2rem;
}
.dashboard-area h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.qr-item {
    background: var(--bg-input);
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.qr-item-info strong {
    display: block;
    margin-bottom: 0.25rem;
}
.qr-item-info small {
    color: var(--text-muted);
    font-family: monospace;
}
.qr-actions {
    display: flex;
    gap: 0.5rem;
}

/* FAQ Accordion */
.faq-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}
.faq-header {
    text-align: center;
    margin-bottom: 2rem;
}
.faq-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}
.faq-item {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
}
.faq-question {
    width: 100%;
    text-align: left;
    padding: 1.25rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}
.faq-question:hover {
    background-color: var(--bg-input);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 1.5rem;
    transition: all 0.3s ease;
    color: var(--text-muted);
    line-height: 1.6;
}
.faq-item.active .faq-answer {
    max-height: 200px;
    padding: 0 1.5rem 1.25rem 1.5rem;
}
.faq-item.active .faq-question .icon {
    transform: rotate(45deg);
}
.faq-question .icon {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--accent-primary);
    transition: transform 0.3s ease;
}
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.modal-content {
    background: var(--bg-panel);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
    position: relative;
    box-shadow: var(--shadow-glow);
}
.modal-content h2 { margin-bottom: 1rem; }
.modal-content p { color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.5; font-size: 0.95rem; }
.close-btn {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none; border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Ad Layout */
.ad-space {
    margin-top: 2rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.ad-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.ad-placeholder {
    width: 100%;
    height: 150px;
    background: #2a2c3d;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
    font-size: 0.9rem;
}

/* FAQ Accordion */
.faq-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.faq-header {
    text-align: center;
    margin-bottom: 2rem;
}
.faq-item {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.faq-question {
    width: 100%;
    text-align: left;
    padding: 1.25rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-question:hover {
    background: var(--bg-input);
}
.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: var(--text-muted);
    line-height: 1.6;
}
.faq-item.active .faq-answer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    max-height: 300px;
}
.faq-item.active .icon {
    transform: rotate(45deg);
}
.icon {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}

/* How It Works Section - Sexy Styling */
.how-it-works-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}
.how-it-works-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.how-it-works-card {
    background: linear-gradient(145deg, var(--bg-panel), var(--bg-input));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.5rem 1.5rem 4rem;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.how-it-works-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), #a5b4fc, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.how-it-works-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.35);
}
.how-it-works-card:hover::before {
    opacity: 1;
}

/* Beautiful Number Badge */
.step-badge {
    position: absolute;
    left: 1.25rem;
    top: 1.5rem;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary), #a5b4fc);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}
.how-it-works-card:hover .step-badge {
    transform: rotate(0deg) scale(1.1);
}
.step-number {
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1;
}

.how-it-works-card h3 {
    color: var(--text-main);
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}
.how-it-works-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .how-it-works-grid {
        flex-direction: row;
        gap: 2rem;
    }
    .how-it-works-card {
        flex: 1;
        padding: 3rem 2rem 2rem 2rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .how-it-works-card::before {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .step-badge {
        position: static;
        margin: 0 0 1.5rem 0;
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }
    .step-number {
        font-size: 1.4rem;
    }
}

/* Use Cases Section */
.use-cases-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.use-case-badge {
    position: absolute;
    left: 1.25rem;
    top: 1.5rem;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    line-height: 1;
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.how-it-works-card:hover .use-case-badge {
    transform: rotate(0deg) scale(1.1);
}

.how-it-works-card:has(.use-case-badge):hover {
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.35);
}

.how-it-works-card:has(.use-case-badge)::before {
    background: linear-gradient(90deg, #7c3aed, #a78bfa, transparent);
}

@media (min-width: 768px) {
    .use-case-badge {
        position: static;
        margin: 0 0 1.5rem 0;
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 1.4rem;
    }
}

/* ── Use-Case Hero ────────────────────────────────────────────────────────── */
.uc-hero {
    grid-column: 1 / -1;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2.5rem 2rem;
    margin-bottom: 0.5rem;
}

.uc-hero__eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: 0.6rem;
}

.uc-hero__h1 {
    grid-column: unset;
    font-size: 1.65rem;
    margin-bottom: 0.5rem;
}

.uc-hero__tagline {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 1.1rem;
    opacity: 0.75;
}

.uc-hero__body {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-muted);
    max-width: 72ch;
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--accent-primary);
    padding-left: 1rem;
}

.uc-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.uc-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-input, rgba(255,255,255,0.04));
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
}

@media (max-width: 800px) {
    .uc-hero {
        padding: 1.5rem 1.25rem 1.25rem;
    }
    .uc-hero__h1 {
        font-size: 1.35rem;
    }
    .uc-hero__body {
        font-size: 0.95rem;
    }
}
