/* --- TASKS AREA: HACKER NOIR EDITION --- */

.tasks-area {
    display: flex;
    flex-direction: column;
    padding: 15px 20px;
    
    /* FIX DEFINITIVO PER IL FOOTER AL FONDO: 
       Usiamo flex-grow invece di height fissa per occupare tutto lo spazio disponibile */
    flex-grow: 1; 
    
    /* Permette lo scroll interno se i task sono troppi */
    overflow-y: auto;
    box-sizing: border-box;
    position: relative;
    
    /* Scrollbar personalizzata per il terminale */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-cyan) transparent;
}

/* Scrollbar Webkit (Chrome/Safari) */
.tasks-area::-webkit-scrollbar {
    width: 3px;
}
.tasks-area::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    box-shadow: 0 0 5px var(--accent-cyan);
}

/* --- HEADER DELLE TASKS --- */
.tasks-header-title {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dashed rgba(0, 255, 255, 0.3);
    position: relative;
    flex-shrink: 0; /* Impedisce al titolo di rimpicciolirsi se ci sono molti task */
}

/* Tag di sistema in basso a destra */
.tasks-header-title::after {
    content: '[SYS.REQ_ACTIVE]';
    position: absolute;
    right: 0;
    bottom: -8px;
    background: #000;
    padding: 0 5px;
    font-size: 0.65rem;
    color: rgba(0, 255, 255, 0.5);
    font-family: monospace;
    letter-spacing: 1px;
}

.tasks-header-title h2 {
    font-family: 'Orbitron', sans-serif;
    color: var(--accent-cyan);
    font-size: 1.4rem;
    letter-spacing: 3px;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

.tasks-header-title p {
    font-family: monospace;
    color: #888;
    font-size: 0.8rem;
    margin: 0;
    border-left: 2px solid var(--accent-cyan);
    padding-left: 10px;
    line-height: 1.4;
}

/* --- LISTA DEI TASK --- */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Spazio extra al fondo per evitare che l'ultimo task sia troppo vicino al footer */
    padding-bottom: 100px; 
    flex-grow: 1;
}

/* --- TASK CARDS --- */
.task-card {
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.4) 100%);
    border: 1px solid rgba(0, 255, 255, 0.15);
    border-left: 3px solid var(--accent-cyan);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    backdrop-filter: blur(2px);
}

/* Effetto Scanline HUD */
.task-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,255,255,0.02) 2px, rgba(0,255,255,0.02) 4px);
    pointer-events: none;
}

.task-card:hover {
    border-color: rgba(0, 255, 255, 0.4);
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.12) 0%, rgba(0, 0, 0, 0.5) 100%);
}

.task-card:active {
    transform: scale(0.97);
}

/* Stato Completato */
.task-card.completed {
    opacity: 0.6;
    border-color: #333;
    border-left: 3px solid #555;
    background: rgba(20, 20, 20, 0.8);
    filter: grayscale(100%);
    pointer-events: none;
}

.task-info {
    position: relative;
    z-index: 1;
}

.task-info h4 {
    margin: 0;
    font-size: 0.85rem;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    color: #fff;
    text-transform: uppercase;
}

.task-reward {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-cyan);
    font-size: 0.75rem;
    margin-top: 6px;
    font-family: monospace;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.task-reward img {
    width: 12px;
    height: auto;
    filter: drop-shadow(0 0 2px var(--accent-cyan));
}

/* --- BOTTONI DEI TASK --- */
.task-btn {
    background: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
    color: #000;
    padding: 8px 14px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    min-width: 90px;
    text-align: center;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.task-btn:active {
    background: #fff;
    box-shadow: 0 0 20px var(--accent-cyan);
    transform: scale(0.9);
}

/* Tasto GO (Link esterni o azioni) */
.task-btn.go {
    background: rgba(0, 255, 255, 0.1);
    color: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
    box-shadow: inset 0 0 5px rgba(0, 255, 255, 0.2);
}

.task-btn.go:hover {
    background: var(--accent-cyan);
    color: #000;
}

/* Tasto DONE (Disabilitato) */
.task-btn.completed-btn {
    background: transparent !important;
    color: #444 !important;
    border: 1px solid #333 !important;
    box-shadow: none !important;
    cursor: default;
    pointer-events: none;
}

/* --- FOOTER FIX --- */
/* Il footer deve avere position fixed o essere l'ultimo elemento del contenitore flex principale */
.main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #000;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
}