:root {
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(255, 255, 255, 0.8);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 40px 20px;
}

/* Dynamic background blobs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.7;
    animation: float 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #bfdbfe; /* Light Blue */
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #e9d5ff; /* Light Purple */
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 40px) scale(1.05); }
}

/* Main Container (Glassmorphism) */
.container {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    padding: 48px 40px;
    width: 90%;
    max-width: 440px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #0f172a, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

/* Inputs */
.input-group {
    text-align: left;
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"] {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

input[type="text"]::placeholder {
    color: #94a3b8;
}

/* Color Picker Customization */
.color-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.6);
    padding: 8px 16px 8px 8px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.color-wrapper:focus-within {
    border-color: #cbd5e1;
    background: #ffffff;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#color-hex {
    font-size: 0.95rem;
    font-weight: 600;
    font-family: monospace;
    color: var(--text-primary);
}

/* Buttons */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.primary-btn {
    background: var(--accent);
    color: white;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.35);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: white;
    color: var(--text-primary);
    padding: 14px;
    border: 1px solid #e2e8f0;
    margin-top: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.secondary-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* Result Panel */
.result-panel {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, height 0.4s ease, margin-top 0.4s ease;
}

.result-panel.active {
    opacity: 1;
    height: auto;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.qr-container {
    background: white;
    padding: 16px;
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    display: inline-block;
    animation: scaleIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.qr-container img, .qr-container canvas {
    border-radius: 8px;
    display: block;
}

/* Utility Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.3s ease-in-out;
}
