/* Premium Design System for QR Code Studio */

:root {
    --bg-dark: #090d16;
    --card-bg: rgba(17, 24, 39, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --accent-color: #c084fc;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    max-width: 100%;
    position: relative;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    line-height: 1.5;
}

/* Gorgeous background animation effects */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 15% 85%, rgba(192, 132, 252, 0.08) 0%, transparent 40%);
    z-index: -2;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.45;
    pointer-events: none;
    animation: orb-float 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 350px;
    height: 350px;
    background: #4f46e5;
    top: 10%;
    right: 15%;
}

.orb-2 {
    width: 450px;
    height: 450px;
    background: #7c3aed;
    bottom: 5%;
    left: 10%;
    animation-delay: -5s;
}

@keyframes orb-float {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(40px, 30px) scale(1.15);
    }
    100% {
        transform: translate(-30px, -45px) scale(0.9);
    }
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* Header Styles */
.app-header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-area {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.app-logo-svg {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 0 10px rgba(129, 140, 248, 0.4));
}

.logo-area h1 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge-premium {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.2) 0%, rgba(192, 132, 252, 0.2) 100%);
    border: 1px solid rgba(192, 132, 252, 0.3);
    color: #e9d5ff;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Layout Grid */
.studio-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    html, body {
        overflow-x: hidden;
    }
    .studio-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .preview-panel {
        order: -1; /* Puts the preview at the top on mobile so users see their QR code changes instantly! */
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    .preview-sticky {
        position: relative;
        top: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .config-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}

/* Premium Frosted Glass Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 15px 45px -10px rgba(0, 0, 0, 0.5);
}

/* Configurator Panel */
.config-panel {
    padding: 2.5rem;
}

.panel-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.panel-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-num {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--bg-dark);
    font-size: 0.9rem;
    font-weight: 800;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Customizer Inputs & Labels */
label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.2px;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group:last-child {
    margin-bottom: 0;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea,
select {
    width: 100%;
    min-width: 0; /* Prevent flex elements from stretching the layout */
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
    background: rgba(15, 23, 42, 0.85);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Tabs System */
.tabs-header {
    display: flex;
    flex-flow: row nowrap;
    width: 100%;
    max-width: 100%;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.5);
    padding: 0.35rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.tabs-header::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.tab-btn {
    flex: 1;
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tabs-content .tab-pane {
    display: none;
}

.tabs-content .tab-pane.active {
    display: block;
    animation: fade-up 0.3s ease;
}

/* Form Helper layouts */
.input-with-icon {
    display: flex;
    align-items: center;
}

.input-icon {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 10px 0 0 10px;
    padding: 0.75rem 0.9rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.input-with-icon input {
    border-radius: 0 10px 10px 0;
}

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

@media (max-width: 640px) {
    .grid-2col {
        grid-template-columns: 1fr;
    }
}

/* Preset Cards (Frames) */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.preset-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition);
}

.preset-card:hover {
    border-color: rgba(129, 140, 248, 0.4);
    background: rgba(15, 23, 42, 0.6);
    transform: translateY(-2px);
}

.preset-card.active {
    border-color: var(--primary-color);
    background: rgba(129, 140, 248, 0.08);
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.15);
}

.preset-card span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.preset-card.active span {
    color: var(--text-primary);
}

/* Frame Previews for Cards */
.frame-preview {
    width: 44px;
    height: 44px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    position: relative;
}

.preset-card.active .frame-preview {
    border-color: var(--primary-color);
}

.frame-none::before {
    content: 'QR';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 800;
    color: var(--text-secondary);
}

.frame-card-style::before {
    content: '';
    position: absolute;
    top: 3px; left: 3px; right: 3px; bottom: 3px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.frame-circle-style::before {
    content: '';
    position: absolute;
    top: 2px; left: 2px; right: 2px; bottom: 2px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.frame-viewfinder-style::before {
    content: '';
    position: absolute;
    top: 6px; left: 6px; right: 6px; bottom: 6px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

.frame-border-style::before {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
}

.frame-pill-style::before {
    content: '';
    position: absolute;
    top: 4px; left: 8px; right: 8px; bottom: 4px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
}

.frame-phone-style::before {
    content: '';
    position: absolute;
    top: 3px; left: 10px; right: 10px; bottom: 3px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
}

.frame-phone-style::after {
    content: '';
    position: absolute;
    top: 6px; left: 50%;
    transform: translateX(-50%);
    width: 8px; height: 1.5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1px;
}

.frame-tag-style::before {
    content: '';
    position: absolute;
    top: 6px; left: 10px; right: 10px; bottom: 3px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 2px 2px 6px 6px;
    border-top: none;
}
.frame-tag-style::after {
    content: '';
    position: absolute;
    top: 3px; left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 4px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.frame-speech-style::before {
    content: '';
    position: absolute;
    top: 4px; left: 6px; right: 6px; bottom: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
}
.frame-speech-style::after {
    content: '';
    position: absolute;
    bottom: 3px; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.5);
}

.frame-luxury-style::before {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}
.frame-luxury-style::after {
    content: '';
    position: absolute;
    top: 7px; left: 7px; right: 7px; bottom: 7px;
    border: 0.75px solid rgba(255, 255, 255, 0.35);
    border-radius: 2px;
}

/* Dot Pattern Selector */
.pattern-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

@media (max-width: 480px) {
    .pattern-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}

.btn-pattern {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-pattern:hover {
    border-color: rgba(129, 140, 248, 0.3);
    color: var(--text-primary);
}

.btn-pattern.active {
    border-color: var(--primary-color);
    background: rgba(129, 140, 248, 0.08);
    color: var(--text-primary);
}

.dot-icon {
    width: 12px;
    height: 12px;
    background-color: var(--text-secondary);
    flex-shrink: 0;
}

.btn-pattern.active .dot-icon {
    background-color: var(--primary-color);
}

.dot-square {
    border-radius: 0;
}

.dot-circle {
    border-radius: 50%;
}

.dot-smooth {
    border-radius: 4px;
}

.dot-star {
    clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
}

.dot-cross {
    clip-path: polygon(35% 0%, 65% 0%, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0% 65%, 0% 35%, 35% 35%);
}

.dot-heart {
    position: relative;
    background-color: var(--text-secondary);
    transform: rotate(-45deg);
    width: 7px;
    height: 7px;
    margin-top: 3px;
    margin-right: 2px;
    flex-shrink: 0;
}

.btn-pattern.active .dot-heart {
    background-color: var(--primary-color) !important;
}

.dot-heart::before,
.dot-heart::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    background-color: inherit;
    border-radius: 50%;
}

.dot-heart::before {
    top: -3.5px;
    left: 0;
}

.dot-heart::after {
    top: 0;
    left: 3.5px;
}

/* Color Picker UI */
.color-picker-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.picker-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.color-box input[type="color"] {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 54px;
    height: 54px;
    border: none;
    cursor: pointer;
    opacity: 0;
}

.picker-labels {
    display: flex;
    flex-direction: column;
}

.picker-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.picker-value {
    font-size: 0.9rem;
    font-weight: 700;
    font-family: monospace;
}

/* Color Presets */
.presets-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.presets-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.theme-presets {
    display: flex;
    gap: 0.5rem;
}

.theme-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: var(--transition);
}

.theme-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

/* Logo Upload & Mask Toggles */
.logo-setup-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .logo-setup-row {
        grid-template-columns: 1fr;
    }
}

.logo-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    background: rgba(15, 23, 42, 0.3);
    transition: var(--transition);
}

.logo-dropzone:hover,
.logo-dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(129, 140, 248, 0.03);
}

.logo-dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.dropzone-text svg {
    color: var(--primary-color);
}

.dropzone-text span {
    font-size: 0.85rem;
}

.dropzone-text strong {
    color: var(--primary-color);
}

.drop-specs {
    font-size: 0.7rem !important;
    opacity: 0.7;
}

.dropzone-preview {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 10px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.dropzone-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.btn-remove-logo {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.logo-controls {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Custom Range Input */
.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    cursor: pointer;
    box-shadow: 0 0 10px rgba(129, 140, 248, 0.5);
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-val {
    font-size: 0.8rem;
    font-weight: 700;
    font-family: monospace;
    min-width: 32px;
}

/* Mask toggle buttons */
.logo-shape-toggle {
    display: flex;
    gap: 0.35rem;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.logo-shape-toggle .btn-toggle {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.logo-shape-toggle .btn-toggle:hover {
    color: var(--text-primary);
}

.logo-shape-toggle .btn-toggle.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}


/* Right Side Preview Panel */
.preview-panel {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    align-self: stretch;
}

.preview-sticky {
    position: sticky;
    top: 2rem;
    width: 100%;
}

.preview-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Cyber Scanning Line */
.scanner-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), var(--accent-color), transparent);
    box-shadow: 0 0 12px 1.5px var(--primary-color);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.scanner-element.scanning {
    animation: scan-loop 2s infinite ease-in-out;
    opacity: 0.85;
}

@keyframes scan-loop {
    0% {
        top: 5%;
    }
    50% {
        top: 95%;
    }
    100% {
        top: 5%;
    }
}

.preview-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.preview-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Advisor badges */
.advisor-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.advisor-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.scannability-excellent {
    background-color: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.scannability-excellent .advisor-dot {
    background-color: #34d399;
    box-shadow: 0 0 8px #34d399;
}

.scannability-good {
    background-color: rgba(129, 140, 248, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(129, 140, 248, 0.2);
}
.scannability-good .advisor-dot {
    background-color: #a5b4fc;
}

.scannability-warning {
    background-color: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.scannability-warning .advisor-dot {
    background-color: #fbbf24;
}

.scannability-danger {
    background-color: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    animation: border-pulse 1.5s infinite alternate ease-in-out;
}
.scannability-danger .advisor-dot {
    background-color: #f87171;
    animation: flash 0.8s infinite alternate;
}

@keyframes border-pulse {
    0% { border-color: rgba(239, 68, 68, 0.2); }
    100% { border-color: rgba(239, 68, 68, 0.6); box-shadow: 0 0 10px rgba(239, 68, 68, 0.15); }
}

@keyframes flash {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Main Preview Canvas container */
.qr-canvas-container {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1;
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    transition: var(--transition);
}

#qr-canvas {
    width: 100%;
    height: 100%;
    max-width: 270px;
    max-height: 270px;
    object-fit: contain;
    border-radius: 8px;
}

.preview-footer {
    width: 100%;
    text-align: center;
}

.preview-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

/* Action Buttons with high polish */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.btn-download {
    flex: 1.8;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--bg-dark);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: var(--transition);
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.4);
}

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

.btn-secondary {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.85rem;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Custom Checkbox Design */
.custom-checkbox-row {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.checkbox-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding-left: 2rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
    transition: var(--transition);
}

.checkbox-container:hover {
    color: var(--text-primary);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-custom {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: var(--transition);
}

.checkbox-container:hover input ~ .checkbox-custom {
    border-color: rgba(129, 140, 248, 0.4);
}

.checkbox-container input:checked ~ .checkbox-custom {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-color: transparent;
}

.checkbox-custom:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid var(--bg-dark);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkbox-custom:after {
    display: block;
}

/* Expandable Eye Panel and CTA Customizer */
.expandable-panel {
    background: rgba(15, 23, 42, 0.35);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    animation: fade-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.eye-color-mode-row {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

#frame-text-group input {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Bulk Excel Table Styling */
.bulk-table-container {
    width: 100%;
    max-width: 100%;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.4);
    scrollbar-width: thin;
}

.bulk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.bulk-table th {
    background: rgba(15, 23, 42, 0.8);
    position: sticky;
    top: 0;
    padding: 0.5rem;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    z-index: 2;
}

.bulk-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.bulk-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Checkbox specific overrides in bulk table */
.bulk-table input[type="checkbox"] {
    cursor: pointer;
    width: 15px;
    height: 15px;
    accent-color: var(--primary-color);
}

/* Glassmorphic progress bar */
.bulk-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.bulk-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    box-shadow: 0 0 10px var(--primary-color);
    border-radius: 4px;
    transition: width 0.1s linear;
}

/* Print Page Layout Styles (for PDF save dialog) */
@media print {
    body * {
        visibility: hidden;
    }
    
    #qr-print-wrapper,
    #qr-print-wrapper * {
        visibility: visible;
    }
    
    #qr-print-wrapper {
        position: absolute;
        left: 50%;
        top: 40%;
        transform: translate(-50%, -50%);
        width: 450px !important;
        height: 450px !important;
        text-align: center;
    }
}

/* Studio Footer bar */
.app-footer-bar {
    margin-top: 5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    text-align: center;
}

.app-footer-bar p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Micro animations utility classes */
.animate-fade-in {
    animation: fade-in 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- High-end Mobile Responsive Overrides --- */
@media (max-width: 768px) {
    .glow-orb {
        display: none; /* Boost mobile performance and remove horizontal overflow */
    }

    .container {
        padding: 1.25rem 0.75rem;
    }
    
    .app-header {
        margin-bottom: 1.5rem;
    }
    
    .logo-area {
        margin-bottom: 0.5rem;
    }
    
    .logo-area h1 {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .config-panel {
        padding: 1.5rem 1rem;
    }
    
    .preview-card {
        padding: 1.5rem 1rem;
    }
    
    .panel-section {
        padding-bottom: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .input-group {
        margin-bottom: 1rem;
    }
    
    .app-footer-bar {
        margin-top: 2rem;
        padding-top: 1rem;
    }
}

@media (max-width: 480px) {
    .config-panel {
        padding: 1.25rem 0.85rem;
    }
    
    .preview-card {
        padding: 1.25rem 0.85rem;
    }
    
    .preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .advisor-badge {
        width: 100%;
        justify-content: center;
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .qr-canvas-container {
        padding: 0.75rem;
        margin-bottom: 1.25rem;
        max-width: 220px; /* Compress height dynamically to save screen space */
    }
    
    /* 2x2 Grid for buttons to save massive height */
    .action-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .btn-download, 
    .btn-secondary {
        width: 100%;
        flex: none;
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
        border-radius: 8px;
    }
    
    .btn-download svg,
    .btn-secondary svg {
        width: 14px;
        height: 14px;
    }
    
    .preview-info {
        font-size: 0.7rem;
        margin-bottom: 1rem;
    }
}

/* Premium Quick Brand Presets and Template Chips Styling */
.brand-preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.65rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.brand-preset-btn:hover {
    border-color: rgba(129, 140, 248, 0.4) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(129, 140, 248, 0.1);
}

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

.saved-template-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition);
    animation: fade-up 0.25s ease;
}

.saved-template-chip:hover {
    border-color: var(--primary-color);
    background: rgba(129, 140, 248, 0.08);
    transform: translateY(-1px);
}

.saved-template-chip:active {
    transform: translateY(0);
}

.saved-template-chip span {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-delete-template {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-delete-template:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.15);
}

/* Contextual Bulk Toggle & Mode styles */
.pane-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.pane-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-bulk-toggle {
    background: rgba(129, 140, 248, 0.08);
    border: 1px solid rgba(129, 140, 248, 0.25);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--transition);
}

.btn-bulk-toggle:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.3);
    border-color: var(--primary-color);
}

.btn-bulk-toggle.active {
    background: var(--success-color);
    border-color: var(--success-color);
    color: var(--bg-dark);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.btn-bulk-toggle.active:hover {
    background: #059669;
    border-color: #059669;
    color: white;
}

