/* ======================================== */
/* EMOTION INFO TOOLTIPS & MODALS */
/* ======================================== */

.metric-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.emotion-info-icon {
    background: linear-gradient(135deg, var(--color-bg) 0%, white 100%);
    border: 2px solid var(--color-border);
    font-size: var(--font-size-lg);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-xs);
}

.emotion-info-icon:hover {
    background: var(--gradient-primary);
    border-color: var(--color-primary);
    transform: scale(1.1) rotate(10deg);
    box-shadow: var(--shadow-md);
    color: white;
}

.emotion-info-icon:active {
    transform: scale(0.95);
}

/* ======================================== */
/* EMOTION TOOLTIP */
/* ======================================== */
.emotion-tooltip {
    position: absolute;
    background: white;
    border: 2px solid var(--color-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-tooltip);
    max-width: 320px;
    animation: scaleIn 0.3s var(--ease-bounce);
    transform-origin: top left;
}

.emotion-tooltip::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--color-primary);
}

.emotion-tooltip::after {
    content: '';
    position: absolute;
    top: -7px;
    left: 22px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.emotion-tooltip-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-bg);
}

.emotion-icon {
    font-size: var(--font-size-2xl);
    animation: pulse 2s ease-in-out infinite;
}

.emotion-tooltip h4 {
    margin: 0;
    color: var(--color-primary);
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.emotion-short-desc {
    font-size: var(--font-size-sm);
    margin: var(--space-sm) 0 var(--space-md);
    color: var(--color-text);
    line-height: 1.6;
}

.learn-more-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 600;
    width: 100%;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.learn-more-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.learn-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.learn-more-btn:hover::before {
    width: 300px;
    height: 300px;
}

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

/* ======================================== */
/* EMOTION MODAL */
/* ======================================== */
.emotion-modal-content {
    max-width: 700px;
}

.emotion-modal-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--color-bg);
    animation: fadeIn 0.5s var(--ease-standard);
}

.emotion-icon-large {
    font-size: 4rem;
    display: block;
    margin-bottom: var(--space-md);
    animation: scaleIn 0.6s var(--ease-bounce);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.emotion-modal-header h2 {
    border: none;
    padding: 0;
    margin-bottom: var(--space-sm);
    animation: slideInRight 0.5s var(--ease-standard) 0.1s both;
}

.emotion-category {
    display: inline-block;
    background: var(--gradient-accent);
    color: white;
    padding: var(--space-xs) var(--space-lg);
    border-radius: 20px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-top: var(--space-sm);
    box-shadow: var(--shadow);
    animation: fadeIn 0.5s var(--ease-standard) 0.2s both;
}

.emotion-modal-body h3 {
    color: var(--color-primary);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    font-size: var(--font-size-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.emotion-modal-body h3::before {
    content: '●';
    color: var(--color-primary);
    font-size: var(--font-size-sm);
}

.emotion-description,
.emotion-range,
.emotion-example {
    animation: slideInLeft 0.5s var(--ease-standard);
    animation-fill-mode: both;
}

.emotion-description { animation-delay: 0.1s; }
.emotion-range { animation-delay: 0.2s; }
.emotion-example { animation-delay: 0.3s; }

.range-display {
    background: linear-gradient(135deg, var(--color-bg) 0%, white 100%);
    padding: var(--space-lg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-inner);
}

.range-bar {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: var(--space-md);
    gap: var(--space-md);
}

.range-gradient {
    flex: 1;
    height: 36px;
    background: linear-gradient(to right, #C0152F, #E66761, #E6A77F, #7DAFA3, #21808D);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-inner);
    position: relative;
    overflow: hidden;
}

.range-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 100%);
}

.range-gradient::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 60s infinite;
}

.range-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    padding: var(--space-xs) var(--space-sm);
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-xs);
}

.range-explanation {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    margin: 0;
    text-align: center;
    font-weight: 500;
}

/* ======================================== */
/* EMOTIONS GUIDE */
/* ======================================== */
.emotions-guide-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.guide-intro {
    background: var(--gradient-accent);
    color: white;
    padding: var(--space-lg);
    border-radius: var(--border-radius-lg);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.4s var(--ease-standard);
}

.guide-intro strong {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.emotion-category-section {
    margin-bottom: var(--space-xl);
    animation: fadeIn 0.6s var(--ease-standard);
    animation-fill-mode: both;
}

.emotion-category-section:nth-child(2) { animation-delay: 0.1s; }
.emotion-category-section:nth-child(3) { animation-delay: 0.2s; }

.emotion-category-section h3 {
    color: var(--color-primary);
    margin-bottom: var(--space-md);
    font-size: var(--font-size-xl);
    font-weight: 600;
}

.category-desc {
    color: var(--color-text-light);
    margin-bottom: var(--space-lg);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

.emotion-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
}

.emotion-card {
    background: linear-gradient(135deg, white 0%, var(--color-bg) 100%);
    padding: var(--space-lg);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid var(--color-border);
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.4s var(--ease-standard);
    animation-fill-mode: both;
}

.emotion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.emotion-card:hover::before {
    transform: scaleX(1);
}

.emotion-card:nth-child(1) { animation-delay: 0.05s; }
.emotion-card:nth-child(2) { animation-delay: 0.1s; }
.emotion-card:nth-child(3) { animation-delay: 0.15s; }
.emotion-card:nth-child(4) { animation-delay: 0.2s; }
.emotion-card:nth-child(5) { animation-delay: 0.25s; }

.emotion-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.emotion-card:active {
    transform: translateY(-4px);
}

.emotion-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.emotion-card-header .emotion-icon {
    font-size: var(--font-size-2xl);
}

.emotion-card h4 {
    margin: 0;
    color: var(--color-primary);
    font-size: var(--font-size-base);
    font-weight: 600;
}

.emotion-card p {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    line-height: 1.5;
}

/* ======================================== */
/* CLICKABLE EMOTION NAMES */
/* ======================================== */
.emotion-name-clickable {
    color: var(--color-primary);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: all var(--transition-fast);
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.emotion-name-clickable::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base);
}

.emotion-name-clickable:hover {
    color: var(--color-primary-dark);
    text-decoration-style: solid;
}

.emotion-name-clickable:hover::after {
    width: 100%;
}

.emotion-name-clickable:active {
    transform: scale(0.98);
}

/* ======================================== */
/* RESEARCH TEAM & COUNTRY FLAG */
/* ======================================== */
.research-team {
    margin: var(--space-lg) 0;
}

.researcher {
    margin-bottom: var(--space-md);
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--color-bg) 0%, white 100%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
    animation: slideInLeft 0.4s var(--ease-standard);
    animation-fill-mode: both;
}

.researcher:nth-child(1) { animation-delay: 0.1s; }
.researcher:nth-child(2) { animation-delay: 0.2s; }
.researcher:nth-child(3) { animation-delay: 0.3s; }

.researcher:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.researcher strong {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--color-primary);
    font-size: var(--font-size-base);
    font-weight: 600;
}

.researcher a {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    text-decoration: none;
    margin-right: var(--space-md);
    transition: all var(--transition-fast);
    position: relative;
}

.researcher a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-primary);
    transition: width var(--transition-base);
}

.researcher a:hover {
    color: var(--color-primary-dark);
}

.researcher a:hover::after {
    width: 100%;
}

/* Country flag in modal title */
.country-flag {
    height: 48px;
    width: auto;
    max-width: 72px;
    margin-right: var(--space-md);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-md);
    vertical-align: middle;
    object-fit: contain;
    border: 2px solid white;
    transition: all var(--transition-base);
    animation: scaleIn 0.5s var(--ease-bounce);
}

.country-flag:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: var(--shadow-lg);
}

#modal-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

#modal-title span {
    flex: 1;
}

/* ======================================== */
/* RESPONSIVE - EMOTION INFO */
/* ======================================== */
@media (max-width: 768px) {
    .emotion-tooltip {
        max-width: 280px;
        padding: var(--space-md);
    }
    
    .emotion-icon {
        font-size: var(--font-size-xl);
    }
    
    .emotion-icon-large {
        font-size: 3rem;
    }
    
    .emotion-cards {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    
    .emotion-card {
        padding: var(--space-md);
    }
    
    .emotions-guide-content {
        max-height: 90vh;
    }
    
    .guide-intro {
        padding: var(--space-md);
    }
    
    .country-flag {
        height: 36px;
        max-width: 54px;
    }
    
    .researcher {
        padding: var(--space-md);
    }
}

@media (max-width: 480px) {
    .emotion-info-icon {
        width: 32px;
        height: 32px;
        padding: var(--space-xs);
        font-size: var(--font-size-base);
    }
    
    .emotion-tooltip {
        max-width: 240px;
    }
    
    .learn-more-btn {
        padding: var(--space-sm);
        font-size: var(--font-size-xs);
    }
    
    .range-gradient {
        height: 28px;
    }
    
    .country-flag {
        height: 32px;
        max-width: 48px;
        margin-right: var(--space-sm);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .emotion-info-icon {
        width: 44px;
        height: 44px;
    }
    
    .learn-more-btn {
        padding: var(--space-md);
    }
    
    .emotion-card {
        padding: var(--space-lg);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .emotion-tooltip,
    .emotion-modal-content,
    .emotion-card,
    .researcher {
        animation: none !important;
    }
    
    .emotion-icon {
        animation: none !important;
    }
    
    .range-gradient::after {
        animation: none !important;
    }
}
