@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@200;500;700;800&display=swap');

:root {
    --primary-bg: #0f172a;
    --secondary-bg: #1e1b4b;
    --accent-bg: #311847;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-bg-hover: rgba(255, 255, 255, 0.313);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.131);
    --accent-color: #a78bfa;
    --accent-glow: rgba(167, 139, 250, 0.6);
}

html {
    background-color: var(--primary-bg);
    min-height: 100%;
}

body {
    font-family: 'Exo 2', sans-serif;
    background: linear-gradient(-45deg, var(--primary-bg), var(--secondary-bg), var(--accent-bg), var(--primary-bg));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    background-attachment: fixed;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.header {
    text-align: center;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(to right, #c084fc, #818cf8, #c084fc);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShine 4s linear infinite;
}

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

.header p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
}

.input-group {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.input-field {
    width: 100%;
    padding: 1.2rem 1.5rem;
    border-radius: 50px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 1.1rem;
    text-align: center;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.input-field:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(167, 139, 250, 0.6);
    animation: inputGlow 2s infinite alternate;
}

@keyframes inputGlow {
    0% { box-shadow: 0 0 10px rgba(167, 139, 250, 0.3), inset 0 2px 4px rgba(0,0,0,0.1); }
    100% { box-shadow: 0 0 25px rgba(167, 139, 250, 0.7), inset 0 2px 4px rgba(0,0,0,0.1); }
}

.options-group {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    gap: 0.5rem;
}

/* Updated to a strict fixed width to perfectly align the inputs */
.option-row label {
    flex: 0 0 140px; 
    color: var(--text-muted);
    font-weight: 500;
}

/* Updated flex to fill the remaining space equally */
.glass-input {
    flex: 1; 
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.5rem 0.5rem;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.glass-input:focus {
    border-color: var(--accent-color);
}

select.glass-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2394a3b8%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 1rem auto;
    padding-right: 2.5rem;
}

.glass-input option {
    background: var(--primary-bg);
}

/* Updated flex to fill the remaining space equally */
.color-opacity-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 1; 
    background: rgba(0,0,0,0.2);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    box-sizing: border-box;
}

.color-picker {
    background: none;
    border: none;
    height: 28px;
    width: 35px;
    cursor: pointer;
    padding: 0;
    border-radius: 4px;
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.slider-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slider-val {
    font-size: 0.7rem;
    color: var(--accent-color);
    width: 35px;
    text-align: right;
    font-weight: 600;
}

.slider {
    flex: 1;
    accent-color: var(--accent-color);
    width: 100%;
}

.output-wrapper {
    margin-top: 0.5rem;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateY(-10px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.output-wrapper.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.output-wrapper.visible .qr-card {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

.qr-card {
    background: transparent;
    padding: 1rem;
    border-radius: 1.5rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.05);
}

.qr-card::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(192, 132, 252, 0.5), transparent, rgba(129, 140, 248, 0.5));
    border-radius: 1.6rem;
    z-index: -1;
    filter: blur(12px);
    background-size: 200% 200%;
    animation: borderGlow 6s ease infinite;
}

@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#qrcode-container {
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#qrcode-container canvas, 
#qrcode-container svg {
    max-width: 100% !important;
    height: auto !important;
}

.download-group {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.dl-btn {
    flex: 1;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.4);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dl-btn:hover {
    background: rgba(167, 139, 250, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(167, 139, 250, 0.3);
}

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