:root {
    --primary: #8e2de2;
    --primary-dark: #4a00e0;
    --accent: #00f2fe;
    --accent-dark: #4facfe;
    --success: #25d366;
    --whatsapp-bg: #e5ddd5;
    --text: #ffffff;
    --text-muted: #b0b0b0;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: #0f0c29;
    background: linear-gradient(to right, #24243e, #302b63, #0f0c29);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Blobs for Visual Interest */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
}

.blob-1 {
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation: float 20s infinite alternate;
}

.blob-2 {
    background: var(--accent);
    bottom: -100px;
    left: -100px;
    animation: float 25s infinite alternate-reverse;
}

.blob-3 {
    background: var(--primary-dark);
    top: 40%;
    left: 30%;
    width: 300px;
    height: 300px;
    animation: float 15s infinite alternate;
}

@keyframes float {
    from { transform: translate(0, 0); }
    to { transform: translate(50px, 100px); }
}

.app-container {
    width: 95%;
    max-width: 1000px;
    padding: 2rem;
    z-index: 10;
}

.app-header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    color: var(--accent);
    -webkit-text-fill-color: var(--accent);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: -0.5rem;
}

/* Grid System */
.generator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Cards & Glassmorphism */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.step-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Inputs */
.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.phone-input-wrapper {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0 1rem;
    align-items: center;
    transition: border-color 0.3s ease;
}

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

.country-prefix {
    color: var(--accent);
    font-weight: 600;
    margin-right: 0.5rem;
}

input, textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    padding: 1rem 0;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

.textarea-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    padding-right: 3rem; /* Espacio para el botón de emojis */
    resize: none;
    transition: border-color 0.3s ease;
    width: 100%;
}

textarea:focus {
    border-color: var(--accent);
}

#emoji-btn {
    position: absolute;
    right: 12px;
    top: 12px;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 5;
    user-select: none;
}

#emoji-btn:hover {
    transform: scale(1.2);
}

/* Estilos básicos para el selector de emojis custom (si se usa) */
.emoji-picker-popup {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: #1a1a2e;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 100;
    width: 250px;
    max-height: 200px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.emoji-picker-popup span {
    font-size: 1.2rem;
    cursor: pointer;
    text-align: center;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.emoji-picker-popup span:hover {
    background: rgba(255,255,255,0.1);
}

.input-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.5rem;
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #0f0c29;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 242, 254, 0.3);
}

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

.secondary-btn {
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* WhatsApp Preview */
.whatsapp-bubble {
    background: var(--whatsapp-bg);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease;
}

.bubble-header {
    background: #075e54;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.avatar {
    width: 32px;
    height: 32px;
    background: #ccc;
    border-radius: 50%;
}

.status {
    display: flex;
    flex-direction: column;
}

.name {
    font-size: 0.9rem;
    font-weight: 600;
}

.online {
    font-size: 0.7rem;
    opacity: 0.8;
}

.bubble-body {
    padding: 1rem;
    position: relative;
    background: #dcf8c6;
    margin: 1rem;
    border-radius: 8px 8px 0 8px;
    max-width: 90%;
    margin-left: auto;
    box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
}

.bubble-body::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 0;
    width: 0;
    height: 0;
    border-top: 10px solid #dcf8c6;
    border-right: 10px solid transparent;
}

.bubble-body p {
    color: #303030;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.time {
    display: block;
    text-align: right;
    font-size: 0.7rem;
    color: rgba(0,0,0,0.45);
    margin-top: 4px;
}

/* Output Area */
.hidden {
    display: none;
}

.divider {
    height: 1px;
    background: var(--glass-border);
    margin: 2rem 0;
}

.qr-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.link-actions {
    display: flex;
    gap: 0.5rem;
}

#final-link {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    opacity: 0.6;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 600px) {
    .app-container {
        padding: 1rem;
    }
    .logo {
        font-size: 2.5rem;
    }
    .generator-grid {
        grid-template-columns: 1fr;
    }
}
