:root {
    --primary: #ff69b4;
    --primary-hover: #ff1493;
    --background: #fff0f5;
    --text-main: #4a154b;
    --text-muted: #8b5a8c;
    --card-bg: rgba(255, 255, 255, 0.85);
    --input-bg: #ffffff;
    --preview-bg: #fff5f8;
    --border: #fbcce3;
    --radius: 24px;
    --shadow: 0 10px 30px -5px rgba(255, 105, 180, 0.2), 0 8px 15px -6px rgba(255, 105, 180, 0.1);
}

[data-theme="dark"] {
    --primary: #bb86fc;
    --primary-hover: #9965f4;
    --background: #1a1b3a;
    --text-main: #e0e0ff;
    --text-muted: #b0b0e0;
    --card-bg: rgba(26, 27, 58, 0.75);
    --input-bg: #2a2b4b;
    --preview-bg: #222340;
    --border: #444470;
    --shadow: 0 10px 30px -5px rgba(187, 134, 252, 0.2);
    --radius: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--background);
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

[data-theme="dark"] body {
    background-image: url('background_dark.png');
}

.background-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: inherit;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
}

.circle-1 {
    width: 500px;
    height: 500px;
    background: #ffb6c1;
    top: -150px;
    right: -100px;
}

.circle-2 {
    width: 400px;
    height: 400px;
    background: #ffc0cb;
    bottom: -100px;
    left: -100px;
}

.circle-3 {
    width: 250px;
    height: 250px;
    background: #ffe4e1;
    top: 40%;
    left: 80%;
}

[data-theme="dark"] .circle-1 {
    background: #4f46e5;
}

[data-theme="dark"] .circle-2 {
    background: #c084fc;
}

[data-theme="dark"] .circle-3 {
    display: none;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 1.5rem;
    z-index: 1;
}

.header-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.theme-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    transition: all 0.2s;
}

.theme-btn:hover {
    transform: scale(1.1);
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.app-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    box-shadow: 0 8px 15px rgba(255, 105, 180, 0.2);
    animation: float 3s ease-in-out infinite;
    object-fit: contain;
    background: white;
    /* Ensure transparency looks good */
    padding: 5px;
}

.mamsaka-logo {
    animation-delay: 1.5s;
    /* Sync float animation slightly offset */
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #ffa07a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.2rem;
}

header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.generator-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.6s ease-out;
}

@media (min-width: 768px) {
    .generator-card {
        flex-direction: row;
        align-items: stretch;
        gap: 2rem;
        padding: 2.5rem;
    }

    .card-left {
        flex: 1.4;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        background: rgba(255, 255, 255, 0.4);
        padding: 2rem;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.5);
    }

    [data-theme="dark"] .card-left {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .card-right {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 1.5rem;
        position: sticky;
        top: 2rem;
        background: rgba(255, 255, 255, 0.4);
        padding: 2rem;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.5);
    }

    [data-theme="dark"] .card-right {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

.type-selector {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.type-selector::-webkit-scrollbar {
    display: none;
}

.type-tab {
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.type-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.input-form {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.input-form.active {
    display: block;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.input-group textarea {
    height: 80px;
    resize: none;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 105, 180, 0.1);
}

.preview-area {
    background: var(--preview-bg);
    border-radius: 16px;
    width: 100%;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
}

#qrcode {
    padding: 12px;
    background: white;
    border-radius: 12px;
    display: none;
}

.preview-placeholder {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

.btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.customization-section {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border);
}

.customization-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.color-pickers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.color-pickers .input-group input[type="color"] {
    height: 45px;
    padding: 5px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-secondary {
    background: var(--card-bg);
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid #ef4444;
    color: #ef4444;
}

.btn-outline:hover {
    background: #ef4444;
    color: white;
}

.btn-primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.5;
}

.footer {
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}