/* Token Gate Styles - Navbar Token Bar */

/* Token bar container in navbar */
.token-bar {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
}

/* Desktop: show in navbar-menu, hide mobile version */
.token-bar-mobile {
    display: none;
}
@media only screen and (max-width: 767px) {
    .token-bar-mobile {
        display: flex;
        margin-left: auto;
        margin-right: 0.5rem;
    }
    /* On mobile hide the username, keep avatar + token badge */
    .token-bar-mobile .token-bar-name {
        display: none;
    }
    .token-bar-mobile .token-bar-chip {
        padding: 0;
        background: none;
        border: none;
    }
}

/* User chip: avatar + name */
.token-bar-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem 0.35rem 0.35rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    transition: background 0.2s;
    cursor: default;
    font-family: Montserrat-Medium, sans-serif;
    font-size: 0.9rem;
}
.token-bar-chip:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Avatar circle with initial */
.token-bar-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: Montserrat-Medium, sans-serif;
    flex-shrink: 0;
    line-height: 1;
}

.token-bar-name {
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--font-color, #e0e0e0);
}

/* Token badge: gold coin + count - match chip height */
.token-bar-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem 0.35rem 0.35rem;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    white-space: nowrap;
    transition: background 0.2s;
    cursor: default;
    font-family: Montserrat-Medium, sans-serif;
    font-size: 0.9rem;
    align-self: stretch;
}
.token-bar-badge:hover {
    background: rgba(245, 158, 11, 0.2);
}

.token-bar-coin {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.token-bar-count {
    font-weight: 700;
    color: #fbbf24;
}
.token-bar-count-zero {
    color: #f87171;
}

/* Icons */
.token-bar-icon {
    width: 15px;
    height: 15px;
    fill: currentColor;
    flex-shrink: 0;
}

.token-bar-loading {
    color: var(--font-color, #e0e0e0);
    opacity: 0.5;
    font-family: Montserrat-Medium, sans-serif;
    font-size: 0.9rem;
    padding: 0.35rem 0.5rem;
}

/* Login button */
.token-bar-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: Montserrat-Medium, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.token-bar-btn:hover {
    opacity: 0.85;
    text-decoration: none;
}
.token-bar-btn-login {
    background: linear-gradient(135deg, #ff2d7b, #00f0ff, #a855f7, #ffe600, #ff2d7b);
    background-size: 300% 300%;
    animation: rgbShift 4s ease infinite;
    color: #fff;
}
@keyframes rgbShift {
	0%   { background-position: 0% 50%; }
	50%  { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}
.token-bar-btn-login .token-bar-icon {
    fill: #fff;
}
.token-bar-btn-shop {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--font-color, #e0e0e0);
    align-self: stretch;
}
.token-bar-btn-shop:hover {
    background: rgba(255, 255, 255, 0.12);
    opacity: 1;
}
.token-bar-btn-shop .token-bar-icon {
    fill: var(--font-color, #e0e0e0);
}

/* Token Messages (near download buttons) */
.token-message {
    padding: 0.5rem 0.8rem;
    margin: 0 0.5rem 0.25rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    animation: tokenMsgIn 0.3s ease-out;
}
.token-message-success {
    background: rgba(22, 163, 74, 0.2);
    border: 1px solid rgba(22, 163, 74, 0.4);
    color: #4ade80;
}
.token-message-error {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.4);
    color: #f87171;
}
.token-message-warning {
    background: rgba(234, 179, 8, 0.2);
    border: 1px solid rgba(234, 179, 8, 0.4);
    color: #fbbf24;
}
.token-message-fade {
    opacity: 0;
    transition: opacity 0.3s;
}
@keyframes tokenMsgIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── DOWNLOAD POPUP ─── */
.token-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, backdrop-filter 0.25s;
    pointer-events: none;
}
.token-popup-overlay.active {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    pointer-events: auto;
}
.token-popup {
    background: #0d0d14;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.token-popup-overlay.active .token-popup {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.token-popup-title {
    font-family: Montserrat-Medium, sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #f0f0f5;
    margin: 0 0 0.25rem;
    text-align: center;
}
.token-popup-subtitle {
    font-family: Montserrat-Medium, sans-serif;
    font-size: 0.8rem;
    color: #8888aa;
    margin: 0 0 1.5rem;
    text-align: center;
}

.token-popup-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.token-popup-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: left;
    font-family: Montserrat-Medium, sans-serif;
    width: 100%;
    box-sizing: border-box;
}
.token-popup-option:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

/* Premium (token) option */
.token-popup-option-premium {
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.06);
}
.token-popup-option-premium:hover {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

/* Free option */
.token-popup-option-free {
    border-color: rgba(255, 255, 255, 0.06);
}
.token-popup-option-free:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Disabled (no tokens) */
.token-popup-option-disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}
.token-popup-option-disabled .token-popup-link {
    pointer-events: auto;
    color: #00f0ff;
    text-decoration: underline;
}

/* Login option */
.token-popup-option-login {
    border-color: rgba(168, 85, 247, 0.2);
    background: rgba(168, 85, 247, 0.05);
}
.token-popup-option-login:hover {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.1);
}

.token-popup-option-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.token-popup-option-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.token-popup-option-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #f0f0f5;
}
.token-popup-option-desc {
    font-size: 0.78rem;
    color: #8888aa;
}
.token-popup-option-meta {
    font-size: 0.72rem;
    color: #fbbf24;
    font-weight: 600;
}

.token-popup-cancel {
    display: block;
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #8888aa;
    font-family: Montserrat-Medium, sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.token-popup-cancel:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #f0f0f5;
}

/* Light mode */
body.light-mode .token-popup {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}
body.light-mode .token-popup-title {
    color: #1a1a1a;
}
body.light-mode .token-popup-subtitle {
    color: #666;
}
body.light-mode .token-popup-option {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
}
body.light-mode .token-popup-option:hover {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.04);
}
body.light-mode .token-popup-option-premium {
    border-color: rgba(245, 158, 11, 0.2);
    background: rgba(245, 158, 11, 0.04);
}
body.light-mode .token-popup-option-premium:hover {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.08);
}
body.light-mode .token-popup-option-title {
    color: #1a1a1a;
}
body.light-mode .token-popup-option-desc {
    color: #666;
}
body.light-mode .token-popup-option-meta {
    color: #d97706;
}
body.light-mode .token-popup-cancel {
    color: #666;
}
body.light-mode .token-popup-cancel:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #1a1a1a;
}

/* Light mode - token bar */
body.light-mode .token-bar-chip {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .token-bar-chip:hover {
    background: rgba(0, 0, 0, 0.07);
}
body.light-mode .token-bar-name {
    color: #333;
}
body.light-mode .token-bar-badge {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
}
body.light-mode .token-bar-badge:hover {
    background: rgba(245, 158, 11, 0.14);
}
body.light-mode .token-bar-count {
    color: #d97706;
}
body.light-mode .token-bar-count-zero {
    color: #dc2626;
}
body.light-mode .token-bar-loading {
    color: #555;
}
body.light-mode .token-bar-btn-shop {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #333;
}
body.light-mode .token-bar-btn-shop:hover {
    background: rgba(0, 0, 0, 0.08);
}
body.light-mode .token-bar-btn-shop .token-bar-icon {
    fill: #333;
}
body.light-mode .token-message-success {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
}
body.light-mode .token-message-error {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}
body.light-mode .token-message-warning {
    background: rgba(234, 179, 8, 0.1);
    color: #b45309;
}
