/**
 * 433 Article Enhancer – Frontend Styles
 * 
 * Minimalist, dark-mode compatible styling
 * using 433-tema CSS variables.
 */

/* =========================================================================
   PLAYER CARD
   ========================================================================= */

.enhancer-player-card {
    margin: 2.5rem 0;
}

:root {
    --enhancer-accent: #2271b1;
    --enhancer-accent-fade: rgba(34, 113, 177, 0.15);
}

@media (prefers-color-scheme: dark) {
    :root {
        --enhancer-accent: #b8860b;
        --enhancer-accent-fade: rgba(184, 134, 11, 0.15);
    }
}
body.dark-mode,
html.dark-mode,
.dark-theme {
    --enhancer-accent: #b8860b;
    --enhancer-accent-fade: rgba(184, 134, 11, 0.15);
}

.epc-inner {
    background-color: transparent;
    border: none;
    border-top: 1px solid var(--border-medium, #e2e8f0);
    border-bottom: 1px solid var(--border-medium, #e2e8f0);
    border-radius: 0;
    padding: 2rem 0;
    position: relative;
    box-shadow: none;
}

/* Header: Avatar + Name + League */
.epc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
    border-bottom: none;
}

.epc-identity {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.epc-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-light);
    background-color: var(--bg-surface);
}

.epc-name-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.epc-name {
    font-family: inherit;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.epc-position {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.epc-league-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    opacity: 0.7;
}

/* Rank Badge */
.epc-rank-badge {
    margin-bottom: 1rem;
}

.epc-rank-badge a {
    text-decoration: none;
}

.epc-rank-badge .ftt-player-rank__badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #b8860b;
    letter-spacing: 0.3px;
}

/* Stats Grid */
.epc-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-bottom: 1.5rem;
}

.epc-stat {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    background-color: transparent;
    border: none;
    border-right: 1px solid var(--border-light, #e2e8f0);
    border-radius: 0;
    position: relative;
    transition: none;
}

.epc-stat:last-child {
    border-right: none;
}

.epc-stat-value {
    font-size: 2.2rem;
    font-weight: 500;
    color: var(--enhancer-accent);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.epc-stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

/* Footer */
.epc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.epc-league-name {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
}

.epc-profile-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.epc-profile-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Responsive: 3 cols on very small screens */
@media (max-width: 400px) {
    .epc-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* =========================================================================
   POLL
   ========================================================================= */

.enhancer-poll {
    margin: 2.5rem 0;
}

.epoll-inner {
    background-color: transparent;
    border: none;
    border-top: 1px solid var(--border-medium, #e2e8f0);
    border-bottom: 1px solid var(--border-medium, #e2e8f0);
    border-radius: 0;
    padding: 2rem 0;
    box-shadow: none;
}

/* Header */
.epoll-header {
    margin-bottom: 0.5rem;
}

.epoll-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--enhancer-accent);
}

/* Question */
.epoll-question {
    font-family: inherit;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--text-main);
    margin: 0 0 1.25rem 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Options */
.epoll-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.epoll-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 8px;
    background-color: var(--bg-surface, #f8fafc);
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    text-align: left;
    overflow: hidden;
    z-index: 1;
    transition: transform 0.1s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.epoll-option:active:not(:disabled) {
    transform: scale(0.99);
}

.epoll-option:disabled {
    cursor: default;
}

/* Progress bar (background fill) */
.epoll-option-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background-color: var(--text-main);
    opacity: 0.05;
    border-radius: 8px;
    transition: width 0.4s cubic-bezier(0.85, 0, 0.15, 1);
    z-index: -1;
}

.epoll-option.is-leader .epoll-option-bar {
    background-color: var(--enhancer-accent);
    opacity: 0.15;
}

/* Text and percentage */
.epoll-option-text {
    position: relative;
    z-index: 1;
}

.epoll-option-pct {
    position: relative;
    z-index: 1;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-size: 1rem;
    color: var(--text-main);
    min-width: 45px;
    text-align: right;
}

/* Voted state */
.epoll-option.is-voted {
    border-color: var(--border-light, #e2e8f0);
}

.epoll-option.is-voted.is-leader {
    border-color: var(--enhancer-accent);
    border-width: 1px;
}

/* Footer */
.epoll-footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.epoll-thanks {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* =========================================================================
   GOOGLE NEWS BUTTON
   ========================================================================= */

.enhancer-google-news {
    margin: 2rem 0;
    font-family: inherit;
}

.egn-anchor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #b1b1b117;
    border-radius: 4px;
    padding: 16px;
    gap: 16px;
    text-decoration: none;
    border: none;
}

body.dark-mode .egn-anchor,
html.dark-mode .egn-anchor,
.dark-theme .egn-anchor {
    background-color: var(--bg-surface, #1e293b);
    border-color: var(--border-medium, #334155);
}

.egn-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.egn-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ffffff;
    flex-shrink: 0;
}

body.dark-mode .egn-logo-wrapper,
html.dark-mode .egn-logo-wrapper {
    background-color: #0f172a;
}

.egn-logo {
    width: 32px;
    height: 32px;
}

.egn-text-block {
    display: flex;
    flex-direction: column;
}

.egn-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main, #1e293b);
    line-height: 1.3;
}

body.dark-mode .egn-title,
html.dark-mode .egn-title {
    color: var(--text-main, #f8fafc);
}

.egn-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    margin-top: 4px;
}

body.dark-mode .egn-subtitle,
html.dark-mode .egn-subtitle {
    color: var(--text-muted, #94a3b8);
}

.egn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #041ab3;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 13px;
    border-radius: 20px;
    white-space: nowrap;
}

body.dark-mode .egn-cta,
html.dark-mode .egn-cta {
    background-color: #041ab3;
}

@media (max-width: 480px) {
    .egn-anchor {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px;
        gap: 12px;
    }
    
    .egn-cta {
        width: 92%;
        text-align: center;
        margin-top: 4px;
    }
}

/* =========================================================================
   GOOGLE NEWS BOTTOM CTA (heartfelt variant)
   ========================================================================= */

.enhancer-google-news--bottom {
    margin: 2.5rem 0 1rem;
    border-top: 1px solid var(--border-medium, #e2e8f0);
    padding-top: 2rem;
}

.egn-anchor--bottom {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 14px;
    background-color: #f0f4ff;
    border: 1px solid #d0d9f0;
}

body.dark-mode .egn-anchor--bottom,
html.dark-mode .egn-anchor--bottom,
.dark-theme .egn-anchor--bottom {
    background-color: rgba(20, 30, 50, 0.7);
    border-color: var(--border-medium, #334155);
}

/* Header row: logo sits beside titles only */
.egn-header-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

/* Typography hierarchy — heading */
.egn-title--heading {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.3;
}

/* Typography hierarchy — sub-heading */
.egn-title--sub {
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 2px;
}

body.dark-mode .egn-title--heading,
html.dark-mode .egn-title--heading,
body.dark-mode .egn-title--sub,
html.dark-mode .egn-title--sub {
    color: var(--text-main, #f1f5f9);
}

.egn-subtitle--bottom {
    font-size: 0.82rem;
    line-height: 1.5;
    margin-top: 6px;
    color: var(--text-muted, #475569);
}

body.dark-mode .egn-subtitle--bottom,
html.dark-mode .egn-subtitle--bottom {
    color: var(--text-muted, #94a3b8);
}

.egn-cta--bottom {
    width: 92%;
    text-align: center;
    justify-content: center;
    padding: 10px 16px;
    margin-top: 4px;
    background-color: #0a42bf;
}

.egn-cta--bottom:hover {
    background-color: #083699;
}

body.dark-mode .egn-cta--bottom,
html.dark-mode .egn-cta--bottom {
    background-color: #0a42bf;
}

/* =========================================================================
   QUIZ EMBED
   ========================================================================= */

.enhancer-quiz-embed {
    margin: 2.5rem 0;
}

.enhancer-quiz-embed__inner {
    background-color: transparent;
    border: none;
    border-top: 1px solid var(--border-medium, #e2e8f0);
    border-bottom: 1px solid var(--border-medium, #e2e8f0);
    border-radius: 0;
    padding: 2rem 0;
    box-shadow: none;
}

.enhancer-quiz-embed__header {
    margin-bottom: 1.25rem;
}

.enhancer-quiz-embed__label {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--enhancer-accent);
    display: block;
    margin-bottom: 0.25rem;
    font-family: 'Playfair Display';
}

.enhancer-quiz-embed__title {
    font-family: 'Playfair Display';
    font-weight: 500;
    font-size: 1.3rem;
    color: var(--text-main);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.enhancer-quiz-embed__footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
}

.enhancer-quiz-embed__see-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    padding: 8px 18px;
    border: 1.5px solid var(--border-light, #ddd);
    border-radius: 50px;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}

.enhancer-quiz-embed__see-all:hover {
    background: var(--text-main, #111);
    color: var(--bg-card, #fff);
    border-color: var(--text-main, #111);
}

.enhancer-quiz-embed__see-all svg {
    transition: transform 0.2s;
}

.enhancer-quiz-embed__see-all:hover svg {
    transform: translateX(3px);
}

