/* ============================================
   MISSIONS PAGE - PREMIUM STYLES
   ============================================ */

/* Base layout */
body {
    background: linear-gradient(135deg, #0a0a12 0%, #12121f 50%, #0d0d18 100%);
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.missions-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 24px 60px;
    min-height: calc(100vh - 160px);
}

/* Loading state */
.missions-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.loading-spinner-large {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(168, 85, 247, 0.2);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Login required state */
.missions-login-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 16px;
    text-align: center;
}

.missions-login-required .login-icon {
    color: #a855f7;
    opacity: 0.8;
}

.missions-login-required h2 {
    font-size: 1.5rem;
    color: #fff;
    margin: 0;
}

.missions-login-required p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.login-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
}

/* ============================================
   HEADER
   ============================================ */
.missions-header {
    text-align: center;
    margin-bottom: 32px;
}

.missions-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Sora', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 12px 0;
}

.title-icon {
    width: 40px;
    height: 40px;
    stroke: #a855f7;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.5));
}

.missions-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    margin: 0;
}

/* ============================================
   TABS
   ============================================ */
.missions-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(30, 30, 50, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
    color: #fff;
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(236, 72, 153, 0.15));
    border-color: #a855f7;
    color: #fff;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.tab-btn svg {
    opacity: 0.8;
}

.tab-btn.active svg {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.5));
}

.tab-count {
    background: rgba(168, 85, 247, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.tab-btn.active .tab-count {
    background: rgba(168, 85, 247, 0.5);
}

/* Countdown timer */
.countdown-timer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-left: auto;
}

.countdown-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.countdown-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #a855f7;
}

.time-block {
    background: rgba(168, 85, 247, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 28px;
    text-align: center;
}

.time-sep {
    color: rgba(168, 85, 247, 0.5);
}

/* ============================================
   SUMMARY CARDS
   ============================================ */
.missions-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.8), rgba(20, 20, 40, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.summary-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 12px;
    color: var(--card-color, #a855f7);
}

.summary-icon svg {
    width: 24px;
    height: 24px;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.summary-subtext {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   MISSIONS GRID
   ============================================ */
.missions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.no-missions {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   MISSION CARD
   ============================================ */
.mission-card {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.9), rgba(20, 20, 40, 0.95));
    border: 1px solid var(--rarity-border, rgba(156, 163, 175, 0.4));
    border-radius: 16px;
    padding: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mission-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--rarity-border, rgba(156, 163, 175, 0.4)), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mission-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--rarity-glow, rgba(156, 163, 175, 0.2));
    border-color: var(--rarity-border, rgba(156, 163, 175, 0.6));
}

.mission-card:hover::before {
    opacity: 1;
}

.mission-card.completed {
    border-color: rgba(34, 197, 94, 0.5);
}

.mission-card.completed::before {
    background: linear-gradient(90deg, transparent, #22c55e, transparent);
    opacity: 1;
}

.mission-card.claimed {
    opacity: 0.6;
    filter: grayscale(30%);
}

.mission-card.claiming {
    animation: pulse-claim 0.5s ease;
}

@keyframes pulse-claim {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 40px rgba(34, 197, 94, 0.5); }
}

/* Rarity variations */
.mission-card.rarity-legendary {
    background: linear-gradient(135deg, rgba(50, 40, 20, 0.9), rgba(30, 25, 15, 0.95));
}

.mission-card.rarity-legendary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(245, 158, 11, 0.05));
    pointer-events: none;
}

.mission-card.rarity-epic {
    background: linear-gradient(135deg, rgba(40, 30, 50, 0.9), rgba(25, 20, 35, 0.95));
}

/* Rarity badge */
.mission-rarity {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    background: var(--rarity-bg, rgba(156, 163, 175, 0.15));
    border: 1px solid var(--rarity-border, rgba(156, 163, 175, 0.4));
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Status badge */
.mission-status {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.mission-status.ready {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #22c55e;
    animation: pulse-ready 2s infinite;
}

@keyframes pulse-ready {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.mission-status.claimed {
    background: rgba(100, 100, 100, 0.2);
    border: 1px solid rgba(100, 100, 100, 0.4);
    color: rgba(255, 255, 255, 0.5);
}

/* Mission header */
.mission-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
    margin-top: 20px;
}

.mission-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--rarity-border, rgba(156, 163, 175, 0.4));
}

.mission-icon svg {
    width: 26px;
    height: 26px;
}

.mission-info {
    flex: 1;
    min-width: 0;
}

.mission-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px 0;
}

.mission-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.4;
}

/* Progress bar */
.mission-progress {
    margin-bottom: 16px;
}

.progress-bar-container {
    position: relative;
    height: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-bar-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.mission-card.claimed .progress-bar-shine {
    display: none;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.progress-current {
    font-weight: 600;
}

.progress-percent {
    color: rgba(255, 255, 255, 0.5);
}

/* Rewards */
.mission-rewards {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.rewards-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.reward-item.coins {
    color: #4fffb0;
}

.reward-item.coins img {
    width: 16px;
    height: 16px;
}

.reward-item.xp {
    color: #f59e0b;
}

.reward-item.xp svg {
    width: 14px;
    height: 14px;
    fill: #f59e0b;
}

.reward-item.bonus {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
    color: #ec4899;
    gap: 8px;
}

.bonus-badge {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
}

/* Claim button */
.claim-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.claim-btn:not(.ready):not(.claimed) {
    background: rgba(100, 100, 100, 0.3);
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
}

.claim-btn.ready {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    animation: glow-claim 2s infinite;
}

@keyframes glow-claim {
    0%, 100% { box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3); }
    50% { box-shadow: 0 4px 25px rgba(34, 197, 94, 0.5); }
}

.claim-btn.ready:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(34, 197, 94, 0.4);
}

.claim-btn.ready:active {
    transform: scale(0.98);
}

.claim-btn.claimed {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    cursor: default;
}

/* ============================================
   FLOATING REWARD ANIMATION
   ============================================ */
.floating-reward {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
}

.floating-reward.show {
    animation: float-in 0.3s ease forwards;
}

.floating-reward.hide {
    animation: float-out 0.3s ease forwards;
}

@keyframes float-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes float-out {
    from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    to { opacity: 0; transform: translate(-50%, -100%) scale(1.1); }
}

.floating-reward-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 40px;
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.98), rgba(20, 20, 40, 0.98));
    border: 2px solid #22c55e;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(34, 197, 94, 0.4);
}

.floating-coins {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 2rem;
    font-weight: 800;
    color: #4fffb0;
    text-shadow: 0 0 20px rgba(79, 255, 176, 0.5);
}

.floating-coins img {
    width: 36px;
    height: 36px;
    animation: coin-spin 1s linear infinite;
}

@keyframes coin-spin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.floating-xp {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f59e0b;
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

.floating-tickets {
    font-size: 1.3rem;
    font-weight: 700;
    color: #a855f7;
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.floating-badge {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fbbf24;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

.floating-bonus {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ec4899;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
    border-radius: 8px;
    border: 1px solid rgba(236, 72, 153, 0.4);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .missions-main {
        padding: 80px 16px 40px;
    }
    
    .missions-title {
        font-size: 1.8rem;
    }
    
    .title-icon {
        width: 30px;
        height: 30px;
    }
    
    .missions-tabs {
        flex-direction: column;
        gap: 12px;
    }
    
    .tab-btn {
        width: 100%;
        justify-content: center;
    }
    
    .countdown-timer {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
    
    .missions-grid {
        grid-template-columns: 1fr;
    }
    
    .missions-summary {
        grid-template-columns: 1fr;
    }
    
    .mission-rewards {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rewards-list {
        justify-content: center;
    }
    
    .claim-btn {
        width: 100%;
    }
}
