/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(145deg, #0b0b1a, #1a1a3e, #0f0f23);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    direction: rtl;
}

.container {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 36px;
    padding: 40px 32px;
    max-width: 620px;
    width: 100%;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    transition: 0.3s ease;
}

/* ===== BRAND HEADER ===== */
.brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 6px;
}

.brand-icon {
    font-size: 2.2rem;
    color: #7c6df0;
    animation: pulse-icon 2s infinite;
    display: inline-block;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.15) rotate(5deg); }
}

h1 {
    color: #fff;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-name {
    background: linear-gradient(135deg, #7c6df0, #e07cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #b0b0d9;
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 16px;
}

/* ===== TYPE SELECTOR ===== */
.type-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.type-btn {
    padding: 10px 6px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: #b0b0d9;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.type-btn .icon {
    font-size: 1.4rem;
    line-height: 1;
}

.type-btn:hover {
    background: rgba(124, 109, 240, 0.15);
    border-color: rgba(124, 109, 240, 0.3);
    color: #fff;
    transform: translateY(-2px);
}

.type-btn.active {
    background: linear-gradient(135deg, #7c6df0, #5a4bd1);
    border-color: #7c6df0;
    color: #fff;
    box-shadow: 0 6px 18px rgba(124, 109, 240, 0.35);
}

/* ===== INPUT FORM ===== */
.input-form {
    margin-bottom: 20px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    right: 14px;
    color: #7c6df0;
    font-size: 1.1rem;
    opacity: 0.7;
    pointer-events: none;
}

.input-wrapper input,
.input-wrapper textarea,
.input-wrapper select {
    width: 100%;
    padding: 14px 18px 14px 14px;
    padding-right: 42px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    outline: 2px solid transparent;
    transition: 0.25s ease;
    resize: vertical;
    direction: rtl;
}

.input-wrapper textarea {
    padding-top: 14px;
    min-height: 60px;
}

.input-wrapper select {
    appearance: none;
    padding-right: 42px;
    cursor: pointer;
}

.input-wrapper select option {
    background: #1a1a3e;
    color: #fff;
}

.input-wrapper input:focus,
.input-wrapper textarea:focus,
.input-wrapper select:focus {
    outline-color: #7c6df0;
    background: rgba(255, 255, 255, 0.12);
}

.input-wrapper input::placeholder,
.input-wrapper textarea::placeholder {
    color: #8888b5;
}

/* ===== GENERATE BUTTON ===== */
.generate-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 60px;
    background: linear-gradient(135deg, #7c6df0, #5a4bd1);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s ease;
    box-shadow: 0 8px 24px rgba(90, 75, 209, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    font-family: inherit;
}

.generate-btn:hover {
    transform: scale(1.02);
    background: linear-gradient(135deg, #8f81f5, #6b5cdb);
    box-shadow: 0 12px 32px rgba(90, 75, 209, 0.55);
}

.generate-btn:active {
    transform: scale(0.97);
}

/* ===== QR DISPLAY ===== */
.qr-display {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 24px;
    padding: 25px;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    transition: 0.3s ease;
}

#qrcode {
    display: flex;
    justify-content: center;
    align-items: center;
}

#qrcode img,
#qrcode canvas {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* ===== DOWNLOAD BUTTON ===== */
#download-btn {
    display: none;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 60px;
    background: #2ecc71;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s ease;
    box-shadow: 0 6px 18px rgba(46, 204, 113, 0.35);
    font-family: inherit;
}

#download-btn:hover {
    background: #27ae60;
    transform: scale(1.02);
}

/* ===== FOOTER ===== */
.footer {
    margin-top: 24px;
    text-align: center;
    color: #7a7aa5;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 18px;
}

.footer strong {
    color: #b0b0e6;
    background: linear-gradient(135deg, #7c6df0, #e07cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
    .container {
        padding: 24px 16px;
    }

    .type-selector {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .type-btn {
        font-size: 0.65rem;
        padding: 8px 4px;
    }

    .type-btn .icon {
        font-size: 1.1rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .brand-icon {
        font-size: 1.6rem;
    }
}

@media (max-width: 400px) {
    .type-selector {
        grid-template-columns: repeat(3, 1fr);
    }
}