@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary: #0f172a;
    --accent: #f47020;
    --secondary: #334155;
    --bg-light: #f8fafc;
    --card-border: rgba(255, 255, 255, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.85);
}

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

body {
    background: #0f172a;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(244, 112, 32, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(12, 45, 100, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 1) 0%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 20px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--primary);
    overflow-x: hidden;
    position: relative;
}

/* Grid pattern removed per request */

body::after {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(244, 112, 32, 0.05) 0%, transparent 50%);
    animation: rotateBg 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes rotateBg {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Floating Emojis Background */
.floating-emojis {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

/* Remove floating highlights / background anims */
.floating-emojis {
    display: none;
}

/* Container compactado */
.container {
    width: 95%;
    max-width: 820px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 40px;
    padding: 1rem 2rem;
    /* Menos padding superior */
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
    max-height: 92vh;
    overflow-y: auto;
    animation: futuristicSlide 1s cubic-bezier(0.2, 1, 0.3, 1);
}

@keyframes futuristicSlide {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Scrollbar styling */
.container::-webkit-scrollbar {
    display: none;
}

.container {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Sections más juntos */
.section {
    margin-bottom: 0.8rem;
    /* Aún más compacto */
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
    animation: sectionReveal 0.6s cubic-bezier(0.2, 1, 0.3, 1) backwards;
}

@keyframes sectionReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section.section-exit {
    pointer-events: none;
    transition: all 0.5s ease;
}

/* Explosive Text Effect */
.explosion-char {
    display: inline-block;
    transition: transform 0.8s cubic-bezier(0.1, 0.8, 0.3, 1), opacity 0.8s ease-out;
    will-change: transform, opacity;
    white-space: pre;
}

.explosion-char.active {
    opacity: 0;
    filter: blur(8px);
}

.shockwave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244, 112, 32, 0.4) 0%, transparent 70%);
    border: 2px solid rgba(244, 112, 32, 0.3);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 99;
    animation: shockwaveAnim 0.6s cubic-bezier(0.1, 0, 0.3, 1) forwards;
}

@keyframes shockwaveAnim {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(50);
        opacity: 0;
    }
}

.explosion-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
    will-change: transform, opacity;
}

.section.completed {
    pointer-events: none;
}

.section.completed .sentiment-btn:not(.selected),
.section.completed .influence-btn:not(.selected) {
    opacity: 0.5;
    filter: grayscale(1);
    transform: scale(0.9);
}

#btn-next-influence {
    transition: all 0.3s ease;
    animation: buttonPulse 2s infinite;
}

@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(15, 23, 42, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(15, 23, 42, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(15, 23, 42, 0);
    }
}

.section#submit-section {
    padding-top: 1rem;
    margin-top: 0.5rem;
}

/* Header más compacto */
/* Header con diseño premium y balanceado */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    /* Menos margen inferior del header */
    gap: 20px;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #f8fafc;
}

.header-flex img.plain-logo {
    height: 100px !important;
    /* Logo más pequeño */
    width: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.header-flex img:hover {
    transform: scale(1.1) rotate(2deg);
}

h1 {
    font-size: 2.2rem;
    /* Título más compacto */
    font-weight: 950;
    margin: 0;
    text-align: right;
    background: linear-gradient(135deg, #0c2d64 0%, #1a468d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
    line-height: 0.8;
    font-family: 'Outfit', sans-serif;
    position: relative;
    text-transform: uppercase;
}

h1::after {
    content: 'Indicador de Bienestar';
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    color: #f47020;
    letter-spacing: 5px;
    opacity: 1;
    text-align: right;
    margin-top: 8px;
    text-transform: uppercase;
}

.tagline {
    font-size: 1.1rem;
    color: #0c2d64;
    opacity: 0.8;
    font-weight: 600;
    margin-bottom: 0.3rem;
}


@media (max-width: 600px) {
    .header-flex {
        flex-direction: column;
        text-align: center;
    }

    h1 {
        text-align: center;
        font-size: 2.2rem;
    }
}

.section {
    margin-bottom: 1.2rem;
    /* Compacto aún más */
}

.version-tag {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: monospace;
    letter-spacing: 0;
    z-index: 100;
}

.version-tag a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 600;
}

.version-tag a:hover {
    color: var(--accent);
}

.section-title {
    font-size: 1.2rem;
    /* Título de sección más pequeño */
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.8rem;
    /* Menos espacio tras el título */
    display: block;
    border-left: 4px solid var(--accent);
    padding-left: 12px;
    line-height: 1.1;
}

#section-branch {
    position: relative;
    z-index: 100 !important;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.options-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    z-index: 1000;
    display: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.options-list.show {
    display: block;
    animation: dropdownFade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option {
    padding: 12px 20px;
    cursor: pointer;
    transition: 0.2s;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text);
    font-weight: 600;
}

.option:last-child {
    border-bottom: none;
}

.option:hover {
    background: #f8fafc;
    color: var(--primary);
    padding-left: 28px;
}

.sentiment-grid,
.influence-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
}

.sentiment-btn,
.influence-btn {
    width: 100%;
    height: 85px;
    /* Botones más compactos */
    background: #ffffff;
    border: 2px solid #f1f5f9;
    border-radius: 15px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.sentiment-btn .emoji-icon,
.influence-btn .emoji-icon {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sentiment-btn:hover .emoji-icon,
.influence-btn:hover .emoji-icon {
    transform: scale(1.2) rotate(5deg);
}

.sentiment-btn:hover:not(.selected),
.influence-btn:hover:not(.selected) {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(12, 45, 100, 0.1);
    border-color: var(--primary);
    background: #fff;
}

.sentiment-btn.selected,
.influence-btn.selected {
    transform: scale(0.95);
    transition: all 0.2s ease;
}

.sentiment-btn.selected {
    background: linear-gradient(135deg, var(--secondary), #a01d35);
    border: 2px solid var(--secondary);
    box-shadow: 0 10px 25px rgba(130, 21, 41, 0.25);
    transform: translateY(-2px);
}

.sentiment-btn.selected .label,
.sentiment-btn.selected .description,
.stress-btn-card.selected .label,
.energy-btn-card.selected .label,
.influence-btn.selected .label {
    color: #fff !important;
    opacity: 1;
}

.sentiment-btn.selected .emoji-icon {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.sentiment-btn .label,
.influence-btn .label {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text);
    text-align: center;
    line-height: 1.2;
}

.sentiment-btn .description {
    display: none;
}

.stress-btn-card:hover:not(.selected) .label {
    color: var(--text);
}

.stress-btn-card.selected {
    background: linear-gradient(135deg, var(--secondary), #a01d35);
    border: 2px solid var(--secondary);
    box-shadow: 0 10px 25px rgba(130, 21, 41, 0.25);
    transform: translateY(-2px);
}

.stress-btn-card.selected .label,
.stress-btn-card.selected .description {
    color: #fff !important;
}

/* Influence Selected States */

.influence-btn:hover:not(.selected) {
    border-color: var(--primary);
    background: rgba(12, 45, 100, 0.05);
    transform: translateY(-2px);
}

.influence-btn.selected {
    background: linear-gradient(135deg, var(--secondary), #a01d35);
    color: #fff;
    border: 2px solid var(--secondary);
    box-shadow: 0 10px 25px rgba(130, 21, 41, 0.25);
    transform: translateY(-2px);
}

.influence-btn.selected .label,
.influence-btn.selected .icon-circle {
    color: #fff;
}

/* Search Input */
.search-input {
    width: 100%;
    background: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 18px;
    padding: 18px 24px;
    color: var(--text);
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
    transition: 0.3s;
}

.search-input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(12, 45, 100, 0.08);
}

.selection-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(12, 45, 100, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: selectionPulse 0.6s ease-out forwards;
}

@keyframes selectionPulse {
    0% {
        width: 20px;
        height: 20px;
        opacity: 0.8;
    }

    100% {
        width: 150%;
        height: 150%;
        opacity: 0;
    }
}

.sentiment-btn.selected,
.influence-btn.selected {
    border-color: var(--primary);
    background: rgba(12, 45, 100, 0.03);
    box-shadow: 0 10px 25px rgba(12, 45, 100, 0.1);
    transform: scale(0.98);
}


/* Buttons */
.btn {
    padding: 22px 30px;
    border-radius: 22px;
    border: none;
    font-family: inherit;
    font-weight: 800;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    letter-spacing: -0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 15px 35px rgba(12, 45, 100, 0.25);
}

.btn-primary:not(.btn-disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 45px rgba(12, 45, 100, 0.35);
}

.btn-secondary {
    background: rgba(12, 45, 100, 0.05);
    color: var(--primary);
    border: 1.5px solid rgba(12, 45, 100, 0.1);
}

.btn-secondary:hover {
    background: rgba(12, 45, 100, 0.1);
    transform: translateY(-2px);
}

.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
}

/* Responsive Adjustments */
@media (max-width: 850px) {
    .container {
        width: 98%;
        padding: 1.5rem 1.2rem;
        border-radius: 25px;
    }

    h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 650px) {
    .header-flex {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding-bottom: 1rem;
    }

    .header-flex img {
        height: 80px !important;
    }

    h1 {
        font-size: 2rem;
        text-align: center;
        letter-spacing: -1px;
    }

    h1::after {
        text-align: center;
        font-size: 0.7rem;
        letter-spacing: 3px;
    }

    .section-title {
        font-size: 1rem;
        gap: 8px;
    }

    .container {
        padding: 1.5rem 1rem;
        margin: 10px;
        max-height: calc(100vh - 20px);
    }

    /* Grid adjustments for sentiment/influence */
    .sentiment-grid,
    .influence-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .sentiment-btn,
    .influence-btn {
        width: 100% !important;
        min-width: 0 !important;
        height: 70px !important;
        padding: 5px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        border-radius: 12px !important;
    }

    .sentiment-btn .emoji-icon,
    .influence-btn .emoji-icon {
        font-size: 1.5rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 45px !important;
    }

    .sentiment-btn .label,
    .influence-btn .label {
        font-size: 0.55rem !important;
        line-height: 1.1 !important;
        font-weight: 800 !important;
        text-align: center !important;
        white-space: normal !important;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 1.2rem 0.6rem;
    }
}

/* Hidden Dashboard Button - Top Right */
#admin-btn {
    position: fixed;
    /* Changed to fixed for better mobile positioning */
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1.5px solid rgba(12, 45, 100, 0.15);
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.4;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

#admin-btn:hover {
    opacity: 1;
    background: #ffffff;
    color: var(--secondary);
    border-color: var(--secondary);
}

/* Success State Styles */
#success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 10px;
    min-height: 400px;
    animation: fadeInScale 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#success.active {
    display: flex;
}

.success-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 500px;
    width: 100%;
}

.success-card h1 {
    font-size: 2.5rem;
    /* Slightly smaller for mobile */
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.emoji-icon {
    font-size: 2.2rem;
    /* Emojis ligeramente más pequeños para ahorrar espacio */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    width: 100%;
}

.emoji-icon lottie-player {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 100%;
}

.sentiment-btn * {
    pointer-events: none;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #fff, #f0fdf4);
    border: 2px solid rgba(16, 185, 129, 0.1);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.05);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 2rem;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@media (max-width: 600px) {
    #success {
        padding: 40px 10px;
        min-height: 50vh;
    }

    .success-icon {
        width: 100px;
        height: 100px;
        font-size: 3rem;
    }
}