/* Global Reset & Base */
:root {
    --primary: #1595D4;
    --secondary: #942280;
    --accent: #5ED2FF;

    --bg-dark: #030308;
    --bg-gradient: radial-gradient(circle at top left, #0e0d1f 0%, #030308 60%, #070312 100%);

    --glass-bg: rgba(18, 18, 30, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(21, 149, 212, 0.3);

    --text-main: #FFFFFF;
    --text-muted: #8E8EA8;

    --radius-2xl: 32px;
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --neon-blue: rgba(21, 149, 212, 0.5);
    --neon-purple: rgba(148, 34, 128, 0.5);

    --transition: all 250ms cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    height: auto;
    position: relative;
    letter-spacing: -0.2px;
}

/* Background Ambient Blur */
.decorative-blur {
    position: fixed;
    border-radius: 50%;
    filter: blur(150px);
    z-index: 0;
    opacity: 0.35;
    pointer-events: none;
}

.blur-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    animation: float 20s ease-in-out infinite alternate;
}

.blur-2 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    bottom: -300px;
    right: -200px;
    animation: float 25s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* App Layout Setup */
.app-container {
    width: 95%;
    max-width: 1200px;
    margin: 40px auto;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-wrapper {
    width: 64px;
    height: 64px;
    /* background: linear-gradient(135deg, var(--primary), var(--secondary)); */
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    /* box-shadow: 0 10px 30px var(--neon-blue), inset 0 0 10px rgba(255, 255, 255, 0.4); */
}

.logo-icon {
    font-size: 36px;
    color: white;
}

.header-text h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 6px;
    background: linear-gradient(to right, #fff, #b1b1c7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-text p {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 500;
}

/* Main Workspace */
.workspace {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.preview-column {
    position: relative;
    flex: 0 0 540px;
    min-width: 360px;
}

.preview-panel {
    position: relative;
    width: 100%;
    transition: transform 0.18s ease-out;
    will-change: transform;
}

.preview-sticky-shell {
    position: relative;
    min-height: 100%;
}

.preview-wrapper {
    transition: transform 0.18s ease-out;
    will-change: transform;
}

@media (max-width: 900px) {
    .workspace {
        flex-direction: column;
    }

    .preview-column {
        flex: 1 1 auto;
        min-width: 100%;
    }

    .preview-panel {
        transform: none !important;
    }
}

/* Premium Glass Cards */
.glass-panel {
    background: rgb(57 57 57 / 45%);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: var(--radius-xl);
    padding: 30px 35px;
    flex: 1;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.glass-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.02) 40%, rgba(21, 149, 212, 0.3) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.panel-header {
    /* margin-bottom: 30px; */
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-header h2 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    letter-spacing: -0.5px;
}

.panel-header i {
    color: var(--primary);
    font-size: 24px;
    filter: drop-shadow(0 0 8px var(--neon-blue));
}

/* Left side Form Controls */
.controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Type Selector Tabs */
.type-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .type-selector-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.type-btn {
    background: rgba(10, 10, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 14px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.type-btn i {
    font-size: 20px;
    transition: var(--transition);
}

.type-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(21, 149, 212, 0.4);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.type-btn.active {
    background: linear-gradient(135deg, rgba(21, 149, 212, 0.15), rgba(148, 34, 128, 0.15));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 8px 25px var(--neon-blue), inset 0 0 20px rgba(21, 149, 212, 0.2);
    animation: activeGlowPulse 4s infinite alternate ease-in-out;
}

@keyframes activeGlowPulse {
    0% {
        box-shadow: 0 8px 20px rgba(21, 149, 212, 0.4), inset 0 0 15px rgba(21, 149, 212, 0.1);
    }

    100% {
        box-shadow: 0 8px 30px rgba(21, 149, 212, 0.7), inset 0 0 25px rgba(21, 149, 212, 0.3);
    }
}

.type-btn.active i {
    color: var(--accent);
    filter: drop-shadow(0 0 5px var(--accent));
}

/* Dynamic Panes */
.input-pane {
    display: none;
    opacity: 0;
    animation: contentReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.input-pane.active {
    display: block;
}

@keyframes contentReveal {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.helper-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: -4px;
    margin-left: 2px;
    display: block;
}

.error-text {
    font-size: 12px;
    font-weight: 500;
    color: #FF4757;
    margin-top: -4px;
    margin-left: 2px;
    display: none;
    animation: fadeIn 0.3s ease;
}

input.input-error {
    border-color: #FF4757 !important;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 71, 87, 0.2) !important;
}

/* Multi-Section Forms */
.form-section {
    margin-bottom: 35px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    filter: drop-shadow(0 0 8px rgba(21, 149, 212, 0.3));
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(21, 149, 212, 0.4) 0%, rgba(255, 255, 255, 0.02) 100%);
    display: block;
    box-shadow: 0 1px 3px rgba(21, 149, 212, 0.2);
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.grid-1-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.mt-15 {
    margin-top: 15px !important;
}

@media (max-width: 650px) {
    .grid-2-col {
        grid-template-columns: 1fr;
    }
}



/* Inputs */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: flex-start;
}

.input-with-icon i {
    position: absolute;
    left: 18px;
    top: 18px;
    color: var(--text-muted);
    font-size: 20px;
    pointer-events: none;
    transition: var(--transition);
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="tel"],
textarea {
    width: 100%;
    padding: 18px;
    padding-left: 52px;
    background: rgba(10, 10, 18, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    color: white;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
    outline: none;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

input::placeholder,
textarea::placeholder {
    color: rgba(142, 142, 168, 0.5);
    font-weight: 400;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    background: rgba(15, 15, 25, 0.8);
    box-shadow: 0 0 20px rgba(21, 149, 212, 0.4), inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

input:focus+i,
textarea:focus+i,
.input-with-icon:focus-within i {
    color: var(--primary);
    filter: drop-shadow(0 0 5px var(--primary));
}

/* Secondary Settings Card */
.settings-card {
    background: rgba(10, 10, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: relative;
    overflow: hidden;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-card-header i {
    color: var(--secondary);
    font-size: 20px;
    filter: drop-shadow(0 0 8px var(--neon-purple));
}

.settings-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.2px;
}

.settings-card-body {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.style-controls {
    display: flex;
    gap: 20px;
}

.style-controls .input-group {
    flex: 1;
}

@media (max-width: 600px) {
    .style-controls {
        flex-direction: column;
    }
}

.toggle-group {
    display: flex;
    gap: 4px;
    background: rgba(5, 5, 10, 0.6);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.toggle-group input[type="radio"] {
    display: none;
}

.toggle-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.toggle-btn:hover {
    color: #fff;
}

.toggle-group input[type="radio"]:checked+.toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Color Palette Controls */
.color-controls {
    display: flex;
    gap: 20px;
}

.color-controls .input-group {
    flex: 1;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(10, 10, 20, 0.6);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.color-picker-wrapper:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(20, 20, 30, 0.8);
}

input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.color-value {
    font-family: monospace;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

/* Sliders */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.range-value {
    background: rgba(21, 149, 212, 0.15);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(21, 149, 212, 0.3);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    outline: none;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 0 15px var(--neon-blue);
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* Right Side: Preview Panel specifics */
.preview-panel {
    display: flex;
    flex-direction: column;
}

.preview-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding: 20px 0;
    position: relative;
}

.qr-card {
    background: rgba(10, 10, 20, 0.6);
    border-radius: var(--radius-xl);
    padding: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5), 0 30px 60px rgba(0, 0, 0, 0.6);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.qr-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-xl);
    padding: 2px;
    background: linear-gradient(135deg, var(--neon-blue) 0%, transparent 40%, var(--neon-purple) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
}

.qr-card::after {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, var(--primary) 0%, var(--secondary) 100%);
    filter: blur(80px);
    opacity: 0.25;
    z-index: 0;
    pointer-events: none;
    animation: pulseGlow 4s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    from {
        opacity: 0.15;
        transform: scale(0.9);
    }

    to {
        opacity: 0.35;
        transform: scale(1.1);
    }
}

/* The actual QR target area */
.qr-container {
    width: 320px;
    height: 320px;
    background: white;
    padding: 16px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s ease, opacity 0.4s ease, filter 0.4s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    transform: scale(1);
    opacity: 1;
    filter: blur(0px);
    overflow: hidden;
}

.qr-generating {
    transform: scale(0.95) !important;
    opacity: 0.3 !important;
    filter: blur(6px) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) !important;
}

/* Button Styles */
.btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 18px 24px;
    border-radius: var(--radius-xl);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    position: relative;
}

.download-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    padding: 0 20px;
}

.download-row {
    display: flex;
    gap: 16px;
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    /* box-shadow: 0 10px 30px var(--neon-blue), inset 0 2px 0 rgba(255, 255, 255, 0.2); */
}

.btn-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    filter: blur(15px);
    opacity: 0;
    z-index: -1;
    transition: var(--transition);
}

.btn-gradient:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px var(--neon-purple);
}

.btn-gradient:hover::before {
    opacity: 0.5;
}

.btn-gradient:active {
    transform: translateY(1px) scale(0.98);
}

.btn-outline {
    background: rgba(10, 10, 20, 0.6);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-xl);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.btn-outline:active {
    transform: translateY(1px) scale(0.98);
}