/* ─── Variables (ACTotal Theme) ─── */
:root {
    --bg: #050506;
    --surface: #111827;
    --surface-light: #1f2937;
    --surface-hover: #374151;
    --accent: #00A7E1;
    --accent-glow: rgba(0, 167, 225, 0.35);
    --text: #ffffff;
    --text-dim: #9ca3af;
    --radius: 20px;
    --radius-sm: 12px;

    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --success: #10b981;
}

/* ─── Base Reset ─── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* ─── Layout ─── */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, .08);
    background: var(--surface);
    color: var(--text-dim);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all .2s;
}

.btn-icon:hover {
    background: var(--surface-light);
    color: var(--text);
}

.hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.4rem;
}

/* ─── Buttons ─── */
.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    color: #fff;
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.3);
    margin-top: 1rem;
}

.btn-primary:active {
    transform: scale(0.96);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:active {
    transform: scale(0.96);
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

/* ─── Main Content ─── */
.qrgen-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

/* ─── Tabs ─── */
.tabs-container {
    display: flex;
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 0.8rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--surface-light);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ─── Form Inputs ─── */
.input-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.2rem;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.input-group input,
.input-group textarea {
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 1rem;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: border-color 0.2s;
    outline: none;
    resize: none;
}

.input-group textarea {
    height: 120px;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--blue-500);
}

/* ─── Output Area ─── */
.output-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.4s ease-out;
}

.qr-wrapper {
    background: #ffffff;
    /* White background is required for QR readability */
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.qr-wrapper img,
.qr-wrapper canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.output-actions {
    width: 100%;
}

/* ─── Footer ─── */
.app-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: auto;
    padding-top: 2rem;
}