/**
 * Gamification Styles
 * Streaks, Badges, Levels, Notifications, Challenges
 */

/* ============================================
   USER LEVEL DISPLAY
   ============================================ */
.vr-user-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.vr-user-level .level-icon {
    font-size: 1.5rem;
}

.vr-user-level .level-name {
    font-weight: 600;
    color: var(--text-primary);
}

.vr-user-level .level-progress {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 0.5rem;
}

.vr-user-level .level-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.vr-user-level .level-xp {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   STREAK DISPLAY
   ============================================ */
.vr-user-streak {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.9rem;
}

.vr-user-streak.on-fire {
    background: linear-gradient(135deg, #ff6b35 0%, #f72585 100%);
    color: white;
    animation: streak-pulse 2s infinite;
}

@keyframes streak-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.vr-user-streak .streak-icon {
    font-size: 1.1rem;
}

.vr-user-streak .streak-count {
    font-weight: 700;
    font-size: 1.1rem;
}

.vr-user-streak .streak-label {
    color: var(--text-secondary);
}

.vr-user-streak.on-fire .streak-label {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   ACTIVE USERS
   ============================================ */
.vr-active-users {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
}

.vr-active-users .active-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

/* ============================================
   WEEKLY CHALLENGE
   ============================================ */
.vr-weekly-challenge {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.vr-weekly-challenge .challenge-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.vr-weekly-challenge .challenge-icon {
    font-size: 1.3rem;
}

.vr-weekly-challenge .challenge-title {
    font-weight: 600;
    color: var(--text-primary);
}

.vr-weekly-challenge .challenge-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.vr-weekly-challenge .challenge-hashtag {
    display: inline-block;
    background: var(--color-accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.vr-weekly-challenge .challenge-dates {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ============================================
   RANT OF THE DAY
   ============================================ */
.vr-rant-of-day {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 16px;
    padding: 1.25rem;
    margin: 1rem 0;
    color: #1a1a1a;
}

.vr-rant-of-day .rotd-badge {
    display: inline-block;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.vr-rant-of-day .rotd-text {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 0.75rem;
}

.vr-rant-of-day .rotd-stats {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ============================================
   BADGE MODAL - Modern App Style
   ============================================ */
.vr-badge-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}

.vr-badge-modal.active {
    opacity: 1;
    visibility: visible;
}

.vr-badge-modal-content {
    /* Glassmorphism style with gradient */
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 340px;
    width: 100%;
    position: relative;
    transform: scale(0.8) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    overflow: hidden;
}

/* Glow effect behind modal */
.vr-badge-modal-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(255, 215, 0, 0.2) 0%,
        transparent 50%
    );
    animation: badge-glow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes badge-glow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.vr-badge-modal.active .vr-badge-modal-content {
    transform: scale(1) translateY(0);
}

/* Confetti particles */
.vr-badge-confetti {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.vr-badge-confetti::before,
.vr-badge-confetti::after {
    content: '✨';
    position: absolute;
    font-size: 1.5rem;
    animation: confetti-fall 2s ease-out infinite;
}

.vr-badge-confetti::before {
    left: 15%;
    animation-delay: 0s;
}

.vr-badge-confetti::after {
    right: 15%;
    animation-delay: 0.3s;
}

@keyframes confetti-fall {
    0% { 
        transform: translateY(-20px) rotate(0deg) scale(0);
        opacity: 0;
    }
    20% {
        opacity: 1;
        transform: translateY(20px) rotate(180deg) scale(1);
    }
    100% { 
        transform: translateY(150px) rotate(360deg) scale(0.5);
        opacity: 0;
    }
}

.vr-badge-icon {
    position: relative;
    z-index: 1;
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: badge-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
    filter: drop-shadow(0 4px 20px rgba(255, 215, 0, 0.4));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--badge-color, #f59e0b);
}

.vr-badge-icon svg {
    width: 72px;
    height: 72px;
    stroke: var(--badge-color, #f59e0b);
    color: var(--badge-color, #f59e0b);
    filter: drop-shadow(0 0 12px var(--badge-color, rgba(245, 158, 11, 0.5)));
}

@keyframes badge-pop {
    0% { transform: scale(0) rotate(-15deg); }
    60% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.vr-badge-title {
    position: relative;
    z-index: 1;
    color: #fbbf24;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

.vr-badge-name {
    position: relative;
    z-index: 1;
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.vr-badge-desc {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.vr-badge-close {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1a1a1a;
    border: none;
    padding: 1rem 3rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.vr-badge-close:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(251, 191, 36, 0.6);
}

.vr-badge-close:active {
    transform: scale(0.98);
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.vr-notif-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
}

.vr-notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.vr-notification-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--bg-primary);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
}

.vr-notification-panel.active {
    right: 0;
}

.vr-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.vr-notif-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

.vr-notif-mark-read {
    background: none;
    border: none;
    color: var(--color-accent);
    font-size: 0.85rem;
    cursor: pointer;
}

.vr-notif-list {
    flex: 1;
    overflow-y: auto;
}

.vr-notif-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.vr-notif-item:hover {
    background: var(--bg-secondary);
}

.vr-notif-item.unread {
    background: rgba(var(--color-accent-rgb), 0.1);
}

.vr-notif-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.vr-notif-content {
    flex: 1;
    min-width: 0;
}

.vr-notif-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.vr-notif-body {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vr-notif-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.vr-notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
    text-align: center;
}

.vr-notif-empty span {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ============================================
   "YO TAMBIÉN" BUTTON
   ============================================ */
.vr-metoo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vr-metoo-btn:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #22c55e;
}

.vr-metoo-btn.active {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

.vr-metoo-btn .icon {
    font-size: 1rem;
}

/* ============================================
   BADGES GRID
   ============================================ */
.vr-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
    padding: 1rem 0;
}

.vr-badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    transition: transform 0.2s;
}

.vr-badge-item:hover {
    transform: translateY(-2px);
}

.vr-badge-item.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.vr-badge-item .badge-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.vr-badge-item .badge-icon svg {
    width: 32px;
    height: 32px;
    color: var(--badge-color, var(--vr-text-secondary));
    stroke: var(--badge-color, var(--vr-text-secondary));
}

.vr-badge-item .badge-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ============================================
   LEADERBOARD
   ============================================ */
.vr-leaderboard {
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
}

.vr-leaderboard-header {
    padding: 1rem;
    background: var(--bg-tertiary);
    font-weight: 600;
}

.vr-leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.vr-leaderboard-item:last-child {
    border-bottom: none;
}

.vr-leaderboard-rank {
    width: 28px;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.vr-leaderboard-rank.gold { background: #fbbf24; color: #1a1a1a; }
.vr-leaderboard-rank.silver { background: #9ca3af; color: #1a1a1a; }
.vr-leaderboard-rank.bronze { background: #cd7f32; color: white; }

.vr-leaderboard-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vr-leaderboard-score {
    font-weight: 600;
    color: var(--color-accent);
}

/* ============================================
   DRAWER GAMIFICATION
   ============================================ */
.vr-drawer__gamification {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.vr-drawer__stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.vr-drawer__swipe-btn-container {
    padding: 0 1rem 1rem;
}

.vr-sidebar-swipe-btn {
    position: relative;
}

.vr-sidebar-swipe-btn .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

.vr-drawer__challenge,
.vr-drawer__rotd {
    padding: 0 1rem;
    margin-bottom: 0.75rem;
}

.vr-drawer__challenge .vr-weekly-challenge,
.vr-drawer__rotd .vr-rant-of-day {
    padding: 1rem;
    margin: 0;
}

/* ============================================
   REPLY RANT BUTTON
   ============================================ */
.vr-card__action--reply-rant {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.vr-card__action--reply-rant:hover {
    color: var(--color-accent);
}

/* ============================================
   REPLY RANT MODAL
   ============================================ */
.vr-reply-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.vr-reply-modal.active {
    opacity: 1;
    visibility: visible;
}

.vr-reply-modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.vr-reply-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.vr-reply-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.vr-reply-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.vr-reply-original {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-style: italic;
    color: var(--text-secondary);
}

.vr-reply-original::before {
    content: '↩️ Respondiendo a:';
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-style: normal;
    color: var(--text-secondary);
}

.vr-reply-textarea {
    width: 100%;
    min-height: 120px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 1rem;
}

.vr-reply-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.vr-reply-submit {
    width: 100%;
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.vr-reply-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .vr-notification-panel {
        max-width: 100%;
    }
    
    .vr-badge-modal-content {
        padding: 2rem 1.5rem;
    }
    
    .vr-badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    
    .vr-drawer__stats-row {
        flex-direction: column;
        gap: 0.5rem;
    }
}
