@font-face {
    font-family: 'Poppins';
    src: url('fonts/Poppins-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0E0E12;
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 600;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

nav {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    text-align: center;
}

nav a {
    text-decoration: none;
    color: #CAB2FF;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: 0.3s;
}

nav a:hover {
    opacity: 1;
}

.layout {
    max-width: 1100px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: flex-start;
    justify-content: center;
}

.controls {
    flex: 1.2;
    min-width: 260px;
    background: transparent;
}

.preview {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.2rem;
}

h1 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #FFFFFF 20%, #CAB2FF 80%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 2rem;
    text-align: left;
}

.field {
    margin-bottom: 1.5rem;
}

.field label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9d69ff;
    margin-bottom: 0.4rem;
}

select, input[type="text"] {
    width: 100%;
    background: #1A1A24;
    border: 1px solid #2A2A34;
    border-radius: 1rem;
    padding: 0.8rem 1rem;
    color: #F0F0F8;
    font-family: 'Poppins', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    transition: none;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239d69ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.2rem;
}

select:focus, input:focus {
    border-color: #2A2A34;
    box-shadow: none;
}

select:hover, input:hover {
    border-color: #2A2A34;
}

input::placeholder {
    color: #6a6a8a;
    opacity: 0.6;
    font-weight: 400;
}

.file-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

input[type="file"] {
    background: #1F1F2C;
    border: 1px solid #2E2E3C;
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    color: #c7b9ff;
    font-size: 0.75rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    outline: none;
}

input[type="file"]:focus, input[type="file"]:hover {
    outline: none;
    box-shadow: none;
    border-color: #2E2E3C;
}

#fileNameDisplay {
    font-size: 0.7rem;
    color: #9CA3AF;
    background: #0E0E14;
    padding: 0.3rem 0.8rem;
    border-radius: 40px;
}

.small-btn {
    background: none;
    border: 1px solid #3a2a4a;
    color: #ff8a7a;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    transition: 0.1s;
    outline: none;
}

.small-btn:hover {
    background: #2a1a2a;
    border-color: #3a2a4a;
}

.gen-btn, .download-btn {
    width: 100%;
    background: #9d69ff;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #0D0D12;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    margin-top: 0.5rem;
    outline: none;
}

.gen-btn:hover, .download-btn:hover {
    background: #b17eff;
    transform: translateY(-1px);
}

.gen-btn:focus, .download-btn:focus {
    outline: none;
    box-shadow: none;
}

.qr-frame {
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    display: inline-block;
    box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.4);
}

#qrcode {
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 0;
}

#qrcode table,
#qrcode tr,
#qrcode td {
    border: none !important;
    background: white;
}

#qrcode td {
    padding: 0 !important;
    margin: 0 !important;
}

.qr-wrapper {
    position: relative;
    display: inline-block;
}

.custom-center-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22%;
    max-width: 55px;
    background: white;
    border-radius: 10px;
    padding: 3px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    pointer-events: none;
    z-index: 10;
}

.tooltip {
    position: fixed;
    background: #1A1A24;
    color: #CAB2FF;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-family: 'Poppins', monospace;
    font-weight: 500;
    max-width: 260px;
    text-align: center;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid #9d69ff;
    opacity: 0;
    transition: opacity 0.1s;
}

@media (max-width: 760px) {
    .layout {
        flex-direction: column;
        gap: 2rem;
    }
    .controls, .preview {
        width: 100%;
    }
    h1 {
        text-align: center;
    }
    .preview {
        margin-top: 0;
    }
}
