/* ===== VARIABILI ===== */
:root {
    --primary: #4a6741;
    --primary-light: #6b8f5e;
    --primary-dark: #2d4228;
    --secondary: #8b7355;
    --accent: #c9a227;
    --bg-dark: #1a1a2e;
    --bg-medium: #16213e;
    --bg-light: #0f3460;
    --text-light: #e8e8e8;
    --text-muted: #a0a0a0;
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    --info: #2196f3;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-medium) 50%, var(--bg-light) 100%);
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.6;
}

/* App container per footer sticky */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* ===== HEADER ===== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.user-role {
    background: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.user-name {
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-points {
    color: var(--accent);
    font-weight: bold;
    white-space: nowrap;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.btn-logout:hover {
    border-color: var(--error);
    color: var(--error);
}

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.welcome-card {
    max-width: 800px;
    margin: 2rem auto;
    text-align: center;
}

.welcome-card h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ===== FORM ELEMENTS ===== */
.input-field {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-light);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.input-field.error {
    border-color: var(--error);
}

.login-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -0.5rem 0 1.5rem 0;
    text-align: center;
    max-width: 400px;
}

.login-hint strong {
    color: var(--accent);
}

/* ===== ROLES GRID ===== */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.role-card {
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.role-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-3px);
}

.role-card.selected {
    border-color: var(--accent);
    background: rgba(201, 162, 39, 0.1);
}

.role-icon {
    font-size: 2rem;
}

.role-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.role-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
    position: relative;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(74, 103, 65, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary.loading {
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== NAVIGATION ===== */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.nav-btn:hover {
    border-color: var(--primary-light);
    color: var(--text-light);
}

.nav-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ===== TAB CONTENT ===== */
.tab-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ===== MISSIONS ===== */
.missions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.progress-bar {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    min-width: 200px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 20px;
    transition: width 0.5s ease-out;
    z-index: 0;
}

.progress-text {
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
}

.missions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mission-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.3s;
}

.mission-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.mission-notes {
    width: 100%;
}

.mission-note-input {
    width: 100%;
    min-height: 60px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.3s;
}

.mission-note-input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.mission-note-input::placeholder {
    color: var(--text-muted);
}

.btn-save-note {
    margin-top: 0.5rem;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.btn-save-note:hover {
    background: var(--primary-light);
}

.btn-attach {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s;
}

.btn-attach:hover {
    background: var(--accent);
}

.mission-files {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.attached-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.attached-file {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.attached-file.pending {
    background: rgba(201, 162, 39, 0.2);
    border: 1px dashed var(--accent);
}

.pending-label {
    color: var(--accent);
    font-size: 0.75rem;
}

.file-link {
    color: var(--text-light);
    text-decoration: none;
}

.file-link:hover {
    color: var(--accent);
}

.btn-remove-file {
    background: transparent;
    border: none;
    color: var(--error);
    cursor: pointer;
    padding: 0 0.25rem;
    font-size: 0.9rem;
}

.btn-remove-file:hover {
    color: #ff6b6b;
}

.mission-item:hover {
    border-color: var(--primary-light);
}

.mission-item.completed {
    opacity: 0.6;
    border-color: var(--success);
}

.mission-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.mission-checkbox:hover {
    border-color: var(--success);
}

.mission-item.completed .mission-checkbox {
    background: var(--success);
    border-color: var(--success);
}

.mission-item.completed .mission-checkbox::after {
    content: '\2713';
    color: white;
    font-size: 14px;
}

.mission-text {
    flex: 1;
}

.mission-xp {
    color: var(--accent);
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
}

.daily-challenge {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1) 0%, rgba(74, 103, 65, 0.1) 100%);
    border: 1px solid var(--accent);
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: center;
}

.daily-challenge h4 {
    margin-bottom: 0.5rem;
}

.daily-challenge p {
    margin-bottom: 0.75rem;
}

.challenge-reward {
    display: inline-block;
    background: var(--accent);
    color: var(--bg-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.challenge-complete-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s;
}

.challenge-complete-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.challenge-complete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.daily-challenge.completed {
    border-color: var(--success);
    opacity: 0.7;
}

.daily-challenge.completed .challenge-reward {
    background: var(--success);
}

/* ===== SCRIPTORIUM ===== */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 2rem;
}

.upload-area:hover {
    border-color: var(--primary-light);
    background: rgba(74, 103, 65, 0.1);
}

.upload-area.dragover {
    border-color: var(--accent);
    background: rgba(201, 162, 39, 0.1);
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.transcription-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.manuscript-viewer {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1rem;
}

.manuscript-viewer h4 {
    margin-bottom: 0.75rem;
}

.manuscript-viewer img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    max-height: 400px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.2);
}

.transcription-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-section, .human-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1rem;
}

.ai-section h4, .human-section h4 {
    margin-bottom: 0.75rem;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-light);
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-light);
}

textarea:read-only {
    opacity: 0.8;
}

.btn-ai {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 0.75rem;
    transition: all 0.3s;
    position: relative;
}

.btn-ai:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-ai:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-ai.loading {
    color: transparent;
}

.btn-ai.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-save {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 0.75rem;
    transition: all 0.3s;
}

.btn-save:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Gallery */
.manuscripts-gallery {
    margin-top: 2rem;
}

.manuscripts-gallery h4 {
    margin-bottom: 1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.gallery-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.gallery-item:hover {
    border-color: var(--primary-light);
    transform: translateY(-3px);
}

.gallery-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.sample-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.gallery-item p {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.difficulty {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-top: 0.5rem;
}

.difficulty.medium {
    background: var(--warning);
}

.difficulty.hard {
    background: var(--error);
}

.gallery-item .author {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== TEAM ===== */
.team-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent);
}

.stat-label {
    color: var(--text-muted);
}

.team-by-role {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.role-group {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1rem;
}

.role-group h4 {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-group ul {
    list-style: none;
}

.role-group li {
    padding: 0.25rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.leaderboard {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
}

.leaderboard h4 {
    margin-bottom: 1rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    width: 30px;
    height: 30px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.leaderboard-rank.gold {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #333;
}

.leaderboard-rank.silver {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #333;
}

.leaderboard-rank.bronze {
    background: linear-gradient(135deg, #cd7f32, #b87333);
}

.leaderboard-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-xp {
    color: var(--accent);
    font-weight: bold;
    white-space: nowrap;
}

/* ===== LEARN ===== */
.learn-intro {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.learn-tracks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.track-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
}

.track-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.track-card h4 {
    margin-bottom: 1rem;
}

.track-card ul {
    list-style: none;
}

.track-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.track-card li:last-child {
    border-bottom: none;
}

.track-card a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s;
}

.track-card a:hover {
    color: var(--accent);
}

.lesson-complete-badge {
    color: var(--success);
    font-size: 0.9rem;
}

/* Lesson Modal */
.lesson-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: 1000;
    padding: 1rem;
}

.lesson-content {
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.close-lesson {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-lesson:hover {
    color: var(--error);
    background: rgba(244, 67, 54, 0.1);
}

.lesson-content h3 {
    margin-bottom: 1.5rem;
    padding-right: 3rem;
}

#lessonBody {
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

#lessonBody h4 {
    margin: 1.5rem 0 0.75rem;
    color: var(--accent);
}

#lessonBody code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

#lessonBody pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1rem 0;
}

#lessonBody pre code {
    background: none;
    padding: 0;
}

#lessonBody ul, #lessonBody ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

#lessonBody li {
    margin-bottom: 0.5rem;
}

.btn-complete {
    background: var(--success);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s;
}

.btn-complete:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-complete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== CONFIRM MODAL ===== */
.confirm-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: 1100;
    padding: 1rem;
}

.confirm-content {
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.confirm-content h4 {
    margin-bottom: 1rem;
}

.confirm-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.confirm-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-confirm {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    border: none;
}

.btn-confirm.primary {
    background: var(--error);
    color: white;
}

.btn-confirm.secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
}

.btn-confirm:hover {
    transform: translateY(-2px);
}

/* ===== TOAST NOTIFICATIONS ===== */
#toastContainer {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--success);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 350px;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--error);
}

.toast-warning {
    background: var(--warning);
    color: #333;
}

.toast-info {
    background: var(--info);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast.removing {
    animation: slideOut 0.3s ease forwards;
}

/* ===== FOOTER ===== */
.main-footer {
    text-align: center;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.main-footer a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s;
}

.main-footer a:hover {
    color: var(--primary-light);
}

/* ===== DAILY CHALLENGE ===== */
.daily-challenge {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.15), rgba(74, 103, 65, 0.15));
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.daily-challenge.completed {
    opacity: 0.7;
    border-color: var(--success);
}

.challenge-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.challenge-icon {
    font-size: 1.5rem;
}

.challenge-header h4 {
    margin: 0;
    color: var(--accent);
}

.challenge-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.challenge-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.challenge-xp {
    color: var(--accent);
    font-weight: bold;
}

.challenge-status.completed {
    color: var(--success);
    font-weight: bold;
}

/* ===== CONFIRM MODAL ===== */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.confirm-modal-content {
    background: var(--bg-medium);
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.confirm-modal-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.confirm-modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--error);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #d32f2f;
}

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
}

/* ===== LOADING STATES ===== */
.btn.loading,
button.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after,
button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ===== MANUSCRIPT GALLERY MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-medium);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--accent);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.close-btn:hover {
    color: var(--text-light);
}

.manuscript-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.manuscript-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.manuscript-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.manuscript-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.manuscript-info {
    padding: 1rem;
}

.manuscript-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.difficulty {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    background: var(--primary);
}

.difficulty-facile { background: var(--success); }
.difficulty-media { background: var(--warning); color: #333; }
.difficulty-difficile { background: var(--error); }

.period {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ===== TRANSCRIPTION GALLERY ===== */
.transcriptions-gallery {
    margin-top: 2rem;
}

.transcriptions-gallery h4 {
    margin-bottom: 1rem;
    color: var(--accent);
}

.transcription-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.transcription-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.transcription-preview {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-dark);
}

.transcription-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.transcription-preview .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-muted);
}

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

.transcription-author {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.transcription-excerpt {
    font-size: 0.9rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transcription-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.transcription-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: var(--primary);
    color: white;
    transition: all 0.3s;
}

.btn-small:hover {
    background: var(--primary-light);
}

.btn-small.btn-danger {
    background: var(--error);
}

.btn-small.btn-danger:hover {
    background: #d32f2f;
}

.btn-accent {
    background: var(--accent);
    color: #1a1a2e;
}

.btn-accent:hover {
    background: #d9b23a;
}

/* ===== TRANSCRIPTION VIEW MODAL ===== */
.transcription-view {
    padding: 1.5rem;
}

.transcription-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: var(--bg-dark);
}

.transcription-texts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.text-block h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.text-block pre {
    background: var(--bg-dark);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
}

.transcription-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen {
    animation: fadeIn 0.3s ease;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .transcription-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .main-header {
        padding: 1rem;
        justify-content: center;
        text-align: center;
    }

    .logo {
        width: 100%;
        justify-content: center;
    }

    .user-info {
        width: 100%;
        justify-content: center;
    }

    .tab-content {
        padding: 1rem;
    }

    .team-stats {
        grid-template-columns: 1fr;
    }

    .missions-header {
        flex-direction: column;
        text-align: center;
    }

    .welcome-card {
        margin: 1rem;
        padding: 1.5rem;
    }

    .roles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #toastContainer {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .toast {
        max-width: 100%;
    }
}

/* ===== TEAM ROLE GROUPS (NEW) ===== */
.role-group {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.role-group.uncovered {
    opacity: 0.7;
    border-style: dashed;
}

.role-group-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--primary);
    background: rgba(0, 0, 0, 0.2);
}

.role-group-icon {
    font-size: 1.8rem;
}

.role-group-info {
    flex: 1;
}

.role-group-info h4 {
    margin: 0;
    font-size: 1rem;
}

.role-group-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.role-status {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-covered {
    background: var(--success);
    color: white;
}

.status-uncovered {
    background: var(--warning);
    color: #333;
}

.role-members {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.member-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.member-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.member-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.member-xp {
    color: var(--accent);
    font-weight: bold;
    font-size: 0.85rem;
}

.member-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.mini-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.member-tasks {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.member-missions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.mini-task {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
    cursor: default;
}

.mini-task.done {
    background: var(--success);
    color: white;
}

.role-uncovered-message {
    padding: 1rem;
    text-align: center;
}

.role-uncovered-message p {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    margin: 0;
}

/* ===== TUTORIAL MODAL ===== */
.tutorial-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.tutorial-content {
    background: var(--bg-medium);
    border: 2px solid var(--accent);
    border-radius: 16px;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.tutorial-header {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.2), rgba(74, 103, 65, 0.2));
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.tutorial-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.tutorial-header h2 {
    margin: 0;
    color: var(--accent);
}

.tutorial-body {
    padding: 1.5rem;
}

.tutorial-section {
    margin-bottom: 1.5rem;
}

.tutorial-section:last-of-type {
    margin-bottom: 0;
}

.tutorial-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

.tutorial-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.tutorial-steps {
    margin: 0;
    padding-left: 1.25rem;
}

.tutorial-steps li {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.tutorial-steps li strong {
    color: var(--text-light);
}

.tutorial-resources {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tutorial-resources li {
    margin-bottom: 0.5rem;
}

.tutorial-resources a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s;
}

.tutorial-resources a:hover {
    color: var(--accent);
}

.tutorial-tip {
    background: rgba(201, 162, 39, 0.1);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 1rem !important;
    margin-top: 1rem;
}

.tutorial-tip h3 {
    color: var(--accent) !important;
    margin-bottom: 0.5rem !important;
}

.tutorial-footer {
    padding: 1rem 1.5rem 1.5rem;
    text-align: center;
}

.tutorial-footer .btn-primary {
    width: 100%;
    margin-top: 0;
}

/* ===== YOUR RESOURCES (LEARN TAB) ===== */
.your-resources {
    margin-bottom: 2rem;
}

.your-resources-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1), rgba(74, 103, 65, 0.1));
    border: 1px solid var(--accent);
    border-radius: 12px 12px 0 0;
}

.your-role-icon {
    font-size: 2.5rem;
}

.your-resources-header h4 {
    margin: 0;
    color: var(--accent);
}

.your-role-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0 0;
}

.resources-list {
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--text-light);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s;
}

.resource-item:last-child {
    border-bottom: none;
}

.resource-item:hover {
    background: rgba(201, 162, 39, 0.1);
}

.resource-icon {
    font-size: 1.5rem;
}

.resource-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.resource-title {
    font-weight: 500;
}

.resource-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.resource-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.resource-item:hover .resource-arrow {
    transform: translateX(5px);
    color: var(--accent);
}

.section-divider {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* ===== LEADERBOARD ROLE ICON ===== */
.leaderboard-role {
    font-size: 1.2rem;
}

/* ===== PRINT STYLES ===== */
@media print {
    .main-header,
    .main-nav,
    .main-footer,
    .btn-logout,
    .btn-ai,
    .btn-save,
    .btn-primary,
    .upload-area,
    #toastContainer {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card,
    .tab-content {
        background: white;
        border: 1px solid #ccc;
    }
}

/* ===== RESPONSIVE ADJUSTMENTS FOR NEW COMPONENTS ===== */
@media (max-width: 600px) {
    .role-group-header {
        flex-wrap: wrap;
    }

    .role-status {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }

    .tutorial-content {
        max-height: 95vh;
    }

    .tutorial-header {
        padding: 1rem;
    }

    .tutorial-icon {
        font-size: 2rem;
    }

    .your-resources-header {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== TASK MODAL ===== */
.task-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.task-modal {
    background: var(--bg-medium);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.task-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 1;
}

.task-modal-close:hover {
    background: var(--error);
    transform: rotate(90deg);
}

.task-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-light) 100%);
    border-bottom: 1px solid var(--border-color);
}

.task-modal-icon {
    font-size: 3rem;
}

.task-modal-title-section {
    flex: 1;
}

.task-modal-title-section h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-light);
}

.task-modal-role {
    font-size: 0.9rem;
    opacity: 0.9;
}

.task-modal-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.task-modal-status.completed {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.task-modal-status.pending {
    background: rgba(255, 152, 0, 0.2);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.task-modal-body {
    padding: 2rem;
}

.task-modal-section {
    margin-bottom: 2rem;
}

.task-modal-section:last-child {
    margin-bottom: 0;
}

.task-modal-section h3 {
    color: var(--accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.task-modal-mission-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.task-modal-xp {
    display: inline-block;
    background: rgba(201, 162, 39, 0.2);
    color: var(--accent);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.task-modal-notes {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 10px;
    line-height: 1.8;
    color: var(--text-light);
    white-space: pre-wrap;
}

.task-modal-empty {
    color: var(--text-muted);
    font-style: italic;
}

.task-modal-files {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-modal-file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.task-modal-file:hover {
    background: rgba(201, 162, 39, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* Responsive task modal */
@media (max-width: 600px) {
    .task-modal-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .task-modal-status {
        margin-top: 0.5rem;
    }

    .task-modal-body {
        padding: 1.5rem;
    }
}

/* ===== VOTAZIONE ===== */
.task-modal-voting {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1) 0%, rgba(74, 103, 65, 0.1) 100%);
    border-radius: 12px;
    padding: 1.5rem !important;
    margin-top: 1rem;
}

.vote-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.vote-count {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent);
    line-height: 1;
}

.vote-label {
    color: var(--text-muted);
    font-size: 1rem;
}

.btn-vote {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    margin-left: auto;
}

.btn-vote:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

.btn-vote.voted {
    background: var(--success);
}

.btn-vote.voted:hover {
    background: #388e3c;
}

.btn-vote-change {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    margin-left: auto;
}

.btn-vote-change:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

.vote-info {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin-left: auto;
}

/* Indicatore voti sui mini-task nella vista team */
.mini-task {
    position: relative;
}

.mini-task .vote-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent);
    color: var(--bg-dark);
    font-size: 0.65rem;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== TASK LIST VERTICALE ===== */
.member-missions-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.task-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.task-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--primary-light);
}

.task-row.done {
    border-left-color: var(--success);
}

.task-row.done .task-status {
    color: var(--success);
}

.task-status {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.task-excerpt {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-light);
    opacity: 0.9;
    line-height: 1.3;
}

.task-row.done .task-excerpt {
    opacity: 0.6;
    text-decoration: line-through;
}

.task-votes {
    font-size: 0.75rem;
    color: var(--accent);
    background: rgba(201, 162, 39, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    flex-shrink: 0;
}
