/**
 * Sistema de Missões - FynixGlobal
 * Estilos CSS
 */

/* ============================================== */
/* MODAL DE MISSÕES                              */
/* ============================================== */

.missions-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.missions-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.missions-modal {
    background: linear-gradient(145deg, #1a1a2e 0%, #0d0d1a 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    border: 1px solid rgba(15, 175, 89, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(15, 175, 89, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.missions-modal-overlay.show .missions-modal {
    transform: scale(1);
}

.missions-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(90deg, rgba(15, 175, 89, 0.2) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.missions-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #fff;
}

.missions-modal-close {
    font-size: 28px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.missions-modal-close:hover {
    color: #fff;
}

/* Tabs */
.missions-modal-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.missions-tab {
    flex: 1;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.missions-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.missions-tab.active {
    color: #0faf59;
    border-bottom-color: #0faf59;
    background: rgba(15, 175, 89, 0.1);
}

/* Conteúdo */
.missions-modal-content {
    padding: 16px;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
}

.missions-tab-content {
    display: none;
}

.missions-tab-content.active {
    display: block;
}

.missions-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

/* ============================================== */
/* CARDS DE MISSÃO                               */
/* ============================================== */

.mission-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s;
}

.mission-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(15, 175, 89, 0.3);
    transform: translateX(4px);
}

.mission-card.active {
    border-left: 4px solid #0faf59;
}

.mission-card.available {
    border-left: 4px solid #ffa500;
}

.mission-card.completed {
    border-left: 4px solid #00a8ff;
}

.mission-icon {
    font-size: 36px;
    flex-shrink: 0;
}

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

.mission-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.mission-desc {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    line-height: 1.4;
}

.mission-target {
    font-size: 13px;
    color: #ffa500;
}

.mission-reward-info {
    font-size: 14px;
    color: #0faf59;
    font-weight: 600;
}

/* Barra de progresso */
.mission-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.mission-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0faf59 0%, #00d46a 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.mission-progress-text {
    font-size: 12px;
    color: #0faf59;
    font-weight: 600;
}

/* Recompensa */
.mission-reward {
    text-align: center;
    flex-shrink: 0;
}

.mission-reward .reward-percent {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #0faf59;
}

/* Ações */
.mission-actions {
    flex-shrink: 0;
}

.mission-activate-btn {
    padding: 10px 20px;
    background: linear-gradient(145deg, #ffa500 0%, #ff8c00 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.mission-activate-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.4);
}

.mission-claim-btn {
    padding: 10px 16px;
    background: linear-gradient(145deg, #0faf59 0%, #00d46a 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    animation: pulse-claim 2s infinite;
}

.mission-claim-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(15, 175, 89, 0.4);
}

@keyframes pulse-claim {
    0%, 100% { box-shadow: 0 0 0 0 rgba(15, 175, 89, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(15, 175, 89, 0); }
}

.mission-claimed {
    color: #00a8ff;
    font-size: 13px;
    font-weight: 600;
}

/* ============================================== */
/* ALERTA DE MISSÃO COMPLETADA                   */
/* ============================================== */

.mission-completed-alert {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10001;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mission-completed-alert.show {
    transform: translateX(0);
}

.mission-alert-content {
    background: linear-gradient(145deg, #1a1a2e 0%, #0d0d1a 100%);
    border: 2px solid #0faf59;
    border-radius: 16px;
    padding: 20px 24px;
    min-width: 280px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(15, 175, 89, 0.2);
    position: relative;
}

.mission-alert-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 12px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.mission-alert-title {
    font-size: 20px;
    font-weight: 700;
    color: #0faf59;
    text-align: center;
    margin-bottom: 8px;
}

.mission-alert-name {
    font-size: 14px;
    color: #fff;
    text-align: center;
    margin-bottom: 8px;
}

.mission-alert-reward {
    font-size: 18px;
    font-weight: 700;
    color: #ffa500;
    text-align: center;
    margin-bottom: 16px;
}

.mission-alert-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(145deg, #0faf59 0%, #00d46a 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.mission-alert-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(15, 175, 89, 0.4);
}

.mission-alert-close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.mission-alert-close:hover {
    color: #fff;
}

/* ============================================== */
/* POPUP DE VITÓRIA                              */
/* ============================================== */

.mission-victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mission-victory-overlay.show {
    opacity: 1;
    visibility: visible;
}

.mission-victory-content {
    text-align: center;
    padding: 40px;
    transform: scale(0.5);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mission-victory-overlay.show .mission-victory-content {
    transform: scale(1);
}

.mission-victory-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: victory-bounce 0.6s ease infinite;
}

@keyframes victory-bounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.mission-victory-title {
    font-size: 48px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 40px rgba(15, 175, 89, 0.8);
    margin-bottom: 16px;
    animation: glow 2s infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 40px rgba(15, 175, 89, 0.8); }
    50% { text-shadow: 0 0 60px rgba(15, 175, 89, 1), 0 0 80px rgba(15, 175, 89, 0.6); }
}

.mission-victory-message {
    font-size: 18px;
    color: #ccc;
    margin-bottom: 24px;
}

.mission-victory-reward {
    margin-bottom: 24px;
}

.mission-victory-reward .reward-label {
    display: block;
    font-size: 16px;
    color: #888;
    margin-bottom: 8px;
}

.mission-victory-reward .reward-value {
    display: block;
    font-size: 56px;
    font-weight: 800;
    color: #0faf59;
    text-shadow: 0 0 30px rgba(15, 175, 89, 0.6);
}

.mission-victory-next {
    font-size: 16px;
    color: #ffa500;
    margin-bottom: 32px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.mission-victory-btn {
    padding: 18px 48px;
    background: linear-gradient(145deg, #0faf59 0%, #00d46a 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mission-victory-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(15, 175, 89, 0.5);
}

/* ============================================== */
/* NOTIFICAÇÃO SIMPLES                           */
/* ============================================== */

.mission-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 10003;
    background: #1a1a2e;
    border-radius: 12px;
    padding: 16px 24px;
    min-width: 250px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-left: 4px solid #0faf59;
}

.mission-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mission-notification.error {
    border-left-color: #ff025c;
}

.mission-notification-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.mission-notification-message {
    font-size: 13px;
    color: #aaa;
}

/* ============================================== */
/* BOTÃO NO HEADER                               */
/* ============================================== */

.missions-header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(145deg, rgba(15, 175, 89, 0.2) 0%, rgba(15, 175, 89, 0.1) 100%);
    border: 1px solid rgba(15, 175, 89, 0.3);
    border-radius: 8px;
    color: #0faf59;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.missions-header-btn:hover {
    background: linear-gradient(145deg, rgba(15, 175, 89, 0.3) 0%, rgba(15, 175, 89, 0.2) 100%);
    border-color: #0faf59;
    transform: translateY(-2px);
}

.missions-header-btn .missions-count {
    background: #ff025c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ============================================== */
/* RESPONSIVO MOBILE                             */
/* ============================================== */

@media (max-width: 767px) {
    .missions-modal {
        width: 95%;
        max-height: 90vh;
        margin: 10px;
    }
    
    .missions-modal-header {
        padding: 16px;
    }
    
    .missions-modal-header h2 {
        font-size: 20px;
    }
    
    .missions-tab {
        padding: 12px 8px;
        font-size: 12px;
    }
    
    .mission-card {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .mission-icon {
        font-size: 28px;
    }
    
    .mission-name {
        font-size: 14px;
    }
    
    .mission-actions {
        width: 100%;
    }
    
    .mission-activate-btn,
    .mission-claim-btn {
        width: 100%;
    }
    
    .mission-completed-alert {
        right: 10px;
        left: 10px;
    }
    
    .mission-alert-content {
        min-width: auto;
    }
    
    .mission-victory-content {
        padding: 24px;
    }
    
    .mission-victory-icon {
        font-size: 60px;
    }
    
    .mission-victory-title {
        font-size: 32px;
    }
    
    .mission-victory-reward .reward-value {
        font-size: 40px;
    }
}

/* ============================================== */
/* FIM CSS MISSÕES                               */
/* ============================================== */

/* Modal de Detalhes da Missão */
.mission-details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mission-details-overlay.show {
    opacity: 1;
}

.mission-details-modal {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid #00d4aa;
    box-shadow: 0 20px 60px rgba(0, 212, 170, 0.3);
}

.mission-details-header {
    background: linear-gradient(90deg, #00d4aa, #00a885);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mission-details-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.3em;
}

.mission-details-close {
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.mission-details-close:hover {
    background: rgba(255,255,255,0.2);
}

.mission-details-body {
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
}

.mission-details-desc {
    margin-bottom: 20px;
}

.mission-details-desc p {
    color: #ccc;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.mission-details-how {
    background: rgba(0, 212, 170, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.mission-details-how h4,
.mission-details-levels h4,
.mission-details-tips h4 {
    color: #00d4aa;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.mission-details-how p {
    color: #aaa;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.mission-details-levels {
    margin-bottom: 20px;
}

.levels-table {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    overflow: hidden;
}

.level-row {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    gap: 10px;
}

.level-row:last-child {
    border-bottom: none;
}

.level-row.completed {
    background: rgba(0, 212, 170, 0.1);
}

.level-row.current {
    background: rgba(255, 193, 7, 0.15);
    border-left: 3px solid #ffc107;
}

.level-icon {
    font-size: 16px;
    width: 25px;
}

.level-num {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    width: 70px;
}

.level-target {
    color: #aaa;
    font-size: 12px;
    flex: 1;
}

.level-reward {
    color: #00d4aa;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
}

.mission-details-tips {
    background: rgba(255, 193, 7, 0.1);
    border-radius: 10px;
    padding: 15px;
}

.mission-details-tips ul {
    margin: 0;
    padding-left: 20px;
}

.mission-details-tips li {
    color: #aaa;
    font-size: 13px;
    margin-bottom: 5px;
}

.mission-details-footer {
    padding: 15px 20px;
    background: rgba(0,0,0,0.2);
    text-align: center;
}

.mission-details-btn {
    background: linear-gradient(90deg, #00d4aa, #00a885);
    color: #fff;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mission-details-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 212, 170, 0.4);
}

/* Botão pequeno de detalhes nos cards */
.mission-details-btn-small {
    background: transparent;
    color: #00d4aa;
    border: 1px solid #00d4aa;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 8px;
}

.mission-details-btn-small:hover {
    background: #00d4aa;
    color: #000;
}

/* Ajuste no card para acomodar o botão */
.mission-reward-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.mission-card .mission-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
