/* --- 433 Rewards: Minimalistisk Design --- */

/* Widget Trigger (Ikonet) */
.f433-rewards-widget {
    position: relative;
    display: inline-block;
    margin-right: 4px;
    vertical-align: middle;
}

.f433-rewards-trigger {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--header-text, #fff);
    position: relative;
    transition: all 0.2s ease;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.f433-rewards-trigger:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.f433-rewards-trigger svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Rød varsel-prikk */
/* Rød varsel-prikk m/ tall */
.f433-rewards-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    background-color: var(--red-500, #e80f0f);
    border-radius: 50%;
    /* Mer pilleform hvis tosifret */
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1px;
    line-height: 1;
    z-index: 2;
}

/* --- POPUP CONTAINER (FELLES STILER) --- */
.f433-rewards-popup {
    display: none;
    background-color: var(--bg-card, #ffffff);
    width: 380px;
    max-height: 590px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light, #e9e9e9);
    z-index: 999999999;
    overflow: hidden;
    color: var(--text-main, #0a0a0a);
    font-family: 'Inter', sans-serif;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    flex-direction: column;
}

/* --- POSISJONERING: MOBIL (SENTRERT) --- */
@media (max-width: 768px) {
    .f433-rewards-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.95);
        max-width: 90vw;
        max-height: 85vh;
    }

    .f433-rewards-popup.is-visible {
        display: flex;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* --- POSISJONERING: DESKTOP (UNDER IKON) --- */
@media (min-width: 769px) {
    .f433-rewards-popup {
        position: fixed;
        /* Fixed fordi headeren er sticky */
        transform: translateY(10px);
        /* Start litt lenger ned for animasjon */
        transform-origin: top center;
        /* Top og Left settes av JS */
    }

    .f433-rewards-popup.is-visible {
        display: flex;
        opacity: 1;
        transform: translateY(0);
        /* Gli på plass */
    }
}

/* --- HEADER --- */
.f433-rewards-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light, #f0f0f0);
    background: var(--bg-surface, #fff);
    flex-shrink: 0;
}

.f433-rewards-logo {
    height: 24px;
    width: auto;
    display: block;
}

.f433-rewards-balance-wrapper {
    text-align: right;
    margin-right: 30px;
}

.f433-rewards-balance-amount {
    font-family: 'Geist', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: var(--blue-800, #0d1365);
    line-height: 1;
    display: block;
}

.f433-rewards-balance-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-meta, #888);
    font-weight: 600;
    display: block;
    margin-top: 2px;
}

.f433-rewards-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--text-meta, #999);
    cursor: pointer;
    padding: 5px;
    z-index: 10;
    transition: color 0.2s;
}

.f433-rewards-close:hover {
    color: var(--text-main, #000);
}

/* --- BODY --- */
.f433-rewards-body {
    padding: 20px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.f433-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-meta, #999);
    margin: 24px 0 12px 0;
    letter-spacing: 0.5px;
}

.f433-section-title:first-child {
    margin-top: 0;
}

.f433-task-item {
    margin-bottom: 12px;
    background: var(--bg-surface, #f9f9f9);
    padding: 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.f433-task-item.completed {
    background: #fff;
    border-color: var(--border-light, #eee);
}

.f433-task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.f433-task-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main, #0a0a0a);
}

.f433-task-reward {
    font-size: 12px;
    font-weight: 700;
    color: var(--blue-600, #004e92);
    background: rgba(0, 78, 146, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
}

.f433-task-item.completed .f433-task-reward {
    color: #34c759;
    background: rgba(52, 199, 89, 0.1);
}

.f433-progress-bg {
    height: 5px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.f433-progress-bar {
    height: 100%;
    background: var(--blue-800, #0d1365);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.f433-task-item.completed .f433-progress-bar {
    background: #34c759;
}

.f433-task-status {
    font-size: 11px;
    color: var(--text-meta, #888);
    margin-top: 6px;
    text-align: right;
    font-weight: 500;
}

/* --- FOOTER --- */
.f433-rewards-footer {
    padding: 16px 24px 20px 24px;
    text-align: center;
    border-top: 1px solid var(--border-light, #f0f0f0);
    background: var(--bg-surface, #fff);
    flex-shrink: 0;
}

.f433-login-btn {
    display: block;
    width: 80%;
    margin: 0 auto;
    background: var(--text-main, #0a0a0a);
    color: #fff;
    padding: 12px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
    transition: transform 0.2s, opacity 0.2s;
}

.f433-info-link {
    font-size: 13px;
    color: var(--text-tertiary, #666);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.f433-info-link:hover {
    color: var(--text-main, #0a0a0a);
    border-bottom-color: var(--text-main, #0a0a0a);
}

/* --- BACKDROP (Kun mobil) --- */
.f433-rewards-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 999999998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.f433-rewards-backdrop.is-visible {
    display: block;
    opacity: 1;
}

/* Dark Mode */
[data-theme="dark"] .f433-rewards-popup {
    background-color: #121212;
    border-color: #333;
}

[data-theme="dark"] .f433-rewards-header,
[data-theme="dark"] .f433-rewards-footer {
    background-color: #1a1a1a;
    border-color: #333;
}

[data-theme="dark"] .f433-task-item {
    background-color: #1f1f1f;
}

[data-theme="dark"] .f433-task-item.completed {
    background-color: #1a1a1a;
    border-color: #333;
}

[data-theme="dark"] .f433-task-name {
    color: #fff;
}

[data-theme="dark"] .f433-rewards-balance-amount {
    color: #fff;
}

[data-theme="dark"] .f433-section-title {
    color: #888;
}

[data-theme="dark"] .f433-progress-bg {
    background-color: #333;
}

[data-theme="dark"] .f433-login-btn {
    background-color: #fff;
    color: #000;
}

[data-theme="dark"] .f433-info-link {
    color: #aaa;
}

[data-theme="dark"] .f433-info-link:hover {
    color: #fff;
    border-bottom-color: #fff;
}