/**
 * Main Stylesheet - QR Generator
 * Organized by: Reset, Base, Components, Layout, Utilities
 */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --bg-gradient-start: #f5f7fa;
    --bg-gradient-end: #c3cfe2;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== BASE ===== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ===== LAYOUT ===== */
.container {
    width: 100%;
    max-width: 32rem;
    margin: 0 auto;
    padding: 1rem;
}

.main-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

/* ===== COMPONENTS ===== */

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
}

/* Header */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-picker {
    width: 100%;
    height: 2.5rem;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: white;
    border: 1px solid var(--border-color);
}

/* QR Display */
.qr-display {
    background: #f9fafb;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    position: relative;
}

.qr-code-container img {
    display: block;
    margin: 0 auto;
    border: 8px solid white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* Placeholder */
.qr-placeholder {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

.qr-placeholder svg {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.5rem;
    opacity: 0.2;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    outline: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    flex: 1;
}

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

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

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

.btn-icon {
    padding: 0.75rem;
}

/* Button Group */
.btn-group {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

.btn-icon {
    padding: 0.75rem;
    min-width: 48px;
    min-height: 48px;
}

.btn-icon svg {
    width: 24px;
    height: 24px;
}

/* Footer */
.page-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== ADSPACE ===== */
.ad-container {
    text-align: center;
    margin: 0.5rem 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-container.placeholder {
    background: #f3f4f6;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Grid */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}