:root {
    --bg-base: #000000;
    --bg-card: #151515;
    --bg-input: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #333333;
    --accent-color: #1abc9c;
    --accent-hover: #16a085;
    --danger-color: #e74c3c;
    --font-family: 'Inter', sans-serif;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

/* Hide scrollbar for a seamless App feel */
::-webkit-scrollbar {
    display: none;
}

html {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-base);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    /* Zero friction, no scroll */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.app-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto 1fr;
    gap: 20px;
    max-width: 1400px;
    width: 100%;
    margin-top: 36px;
}

.stylish-header {
    margin-bottom: 0px !important;
}

.col-1,
.col-2,
.col-3 {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.flex-grow {
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1050px) {
    body {
        height: auto;
        overflow-y: auto;
        padding-top: 40px;
    }

    .app-container {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeInSlide {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    opacity: 0;
    animation: fadeInSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.header p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(26, 188, 156, 0.05);
    border-color: #3a3a3a;
}

.glow-title {
    font-size: 38px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 4px;
    background: linear-gradient(to right, var(--accent-color), #ffffff, var(--accent-color));
    background-size: 200% auto;
    color: #fff;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    filter: drop-shadow(0 0 12px rgba(26, 188, 156, 0.4));
    margin-bottom: 8px;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tab-btn span {
    font-size: 16px;
}

.tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.tab-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.2);
}

/* Dynamic Forms */
.dynamic-form {
    display: none;
    animation: fadeInSlide 0.3s ease forwards;
}

.dynamic-form.active {
    display: block;
}

/* Inputs */
label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.qr-input,
select {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.qr-input:focus,
select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(26, 188, 156, 0.1);
}

textarea.qr-input {
    resize: vertical;
    min-height: 80px;
}

/* Customize Grid */
.customize-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.custom-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.hover-lift {
    transition: transform 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-1px);
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}

.color-picker-wrapper:focus-within {
    border-color: var(--accent-color);
}

input[type="color"] {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    background: none;
    padding: 0;
}

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

input[type="color"]::-webkit-color-swatch {
    border: 1px solid #444;
    border-radius: 4px;
}

#fg-hex,
#bg-hex {
    font-size: 14px;
    font-family: monospace;
}

/* Select wrapper for custom arrow */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "▼";
    font-size: 10px;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
}

option {
    background-color: var(--bg-input);
    color: var(--text-primary);
}

/* File Upload */
.file-upload-group {
    grid-column: span 2;
}

.upload-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: var(--radius-md);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.upload-controls:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(26, 188, 156, 0.1);
}

.btn-icon-danger {
    background-color: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.btn-icon-danger:hover {
    background-color: var(--danger-color);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

input[type="file"] {
    display: none;
}

.file-upload-btn {
    background-color: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}

.file-upload-btn:hover {
    background-color: #444;
    transform: translateY(-1px);
}

#file-name {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Output Panel */
.output-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: fit-content;
    position: sticky;
    top: 40px;
}

/* Empty State & Canvas Wrapper */
.qr-wrapper {
    position: relative;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 280px;
    overflow: hidden;
    transition: border-color 0.3s ease, background-color 0.3s;
}

.qr-wrapper:not(.empty-state) {
    background-color: var(--bg-input);
}

.qr-wrapper.empty-state {
    border: 1px dashed var(--border-color);
}

.qr-wrapper.empty-state #qrcode_container {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
}

.empty-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.empty-placeholder span {
    font-size: 32px;
    margin-bottom: 12px;
    animation: pulseFloat 2s ease-in-out infinite;
}

@keyframes pulseFloat {
    0% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-5px) scale(1.05);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

.qr-wrapper.empty-state .empty-placeholder {
    opacity: 1;
}

#qrcode_container {
    transition: opacity 0.4s ease, transform 0.4s ease;
    width: 100%;
    display: flex;
    justify-content: center;
}

.qr-wrapper:not(.empty-state) #qrcode_container {
    opacity: 1;
    transform: scale(1);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}


/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: background 0.2s, opacity 0.2s;
    font-family: inherit;
}

.btn:active {
    opacity: 0.8;
}

.btn-anim {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary.btn-anim:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.3);
}

.btn-secondary.btn-anim:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
}

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

.btn-secondary {
    background-color: #333333;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #444444;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.download-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: opacity 0.3s ease;
}

.primary-downloads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Footer Styling */
.quirky-footer {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    width: 100%;
    z-index: 10;
}

.shikhar-name {
    color: var(--accent-color);
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    animation: glowText 2s infinite alternate;
    transition: color 0.2s, text-shadow 0.2s;
}

.shikhar-name:hover {
    color: #fff;
    text-shadow: 0 0 20px rgba(26, 188, 156, 1);
}

@keyframes glowText {
    0% {
        text-shadow: 0 0 5px rgba(26, 188, 156, 0.2);
    }

    100% {
        text-shadow: 0 0 12px rgba(26, 188, 156, 0.8);
    }
}