/**
 * Gamification Styles
 */

.gamification-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ─── Dashboard Header ──────────────────────────────────────────────────── */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 2rem;
    color: #2d3748;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ─── Stats Overview ────────────────────────────────────────────────────── */

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Level Progress ────────────────────────────────────────────────────── */

.level-progress {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #2d3748;
}

.progress-bar {
    height: 24px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    transition: width 0.5s ease;
}

.progress-info {
    text-align: center;
    font-size: 0.9rem;
    color: #718096;
}

/* ─── Recent Scores / Activity ──────────────────────────────────────────── */

.recent-scores,
.recent-activity {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.recent-scores h3,
.recent-activity h3 {
    margin: 0 0 1.5rem 0;
    color: #2d3748;
    font-size: 1.25rem;
}

.scores-list,
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.score-item,
.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    transition: background 0.2s;
}

.score-item:hover,
.activity-item:hover {
    background: #edf2f7;
}

.score-icon,
.activity-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.score-details,
.activity-details {
    flex: 1;
}

.score-name,
.activity-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.score-date,
.activity-date {
    font-size: 0.85rem;
    color: #718096;
}

.score-points,
.activity-points {
    font-size: 1.25rem;
    font-weight: bold;
    color: #48bb78;
    flex-shrink: 0;
}

/* ─── Leaderboard ───────────────────────────────────────────────────────── */

.leaderboard-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.leaderboard-section h3 {
    margin: 0 0 1.5rem 0;
    color: #2d3748;
    font-size: 1.25rem;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    transition: background 0.2s, transform 0.2s;
}

.leaderboard-entry:hover {
    background: #edf2f7;
    transform: translateX(4px);
}

.rank-badge {
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.member-details {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.voice-part {
    color: #718096;
}

.points-badge {
    font-size: 1.25rem;
    font-weight: bold;
    color: #667eea;
    flex-shrink: 0;
}

/* ─── Empty States ──────────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #a0aec0;
    font-style: italic;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #edf2f7;
    color: #2d3748;
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

/* ─── Loading & Error ───────────────────────────────────────────────────── */

.loading,
.error {
    text-align: center;
    padding: 3rem;
    font-size: 1.25rem;
}

.loading {
    color: #667eea;
}

.error {
    color: #f56565;
    background: #fff5f5;
    border-radius: 8px;
}

/* ─── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .gamification-dashboard {
        padding: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .stats-overview {
        grid-template-columns: 1fr;
    }

    .leaderboard-entry {
        flex-wrap: wrap;
    }

    .rank-badge {
        min-width: 40px;
        font-size: 1.25rem;
    }

    .points-badge {
        width: 100%;
        text-align: right;
    }
}

/* ─── Modal Specific Elements ──────────────────────────────────────────── */

.criteria-item,
.level-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: background 0.2s;
}

.criteria-item:hover,
.level-item:hover {
    background: #edf2f7;
}

.criteria-item.inactive {
    opacity: 0.5;
}

.criteria-icon,
.level-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.criteria-info,
.level-info {
    flex: 1;
}

.criteria-name,
.level-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.criteria-details,
.level-range {
    font-size: 0.85rem;
    color: #718096;
}

.criteria-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.status-badge {
    font-size: 1.25rem;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.level-color-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.criteria-list,
.levels-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

/* ─── Field Styles ──────────────────────────────────────────────────────── */

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .field-row {
        grid-template-columns: 1fr;
    }
}

/* ─── Lineup (Escalação) Styles ────────────────────────────────────────── */

.lineup-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.stat-badge {
    padding: 0.5rem 1rem;
    background: #edf2f7;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #2d3748;
}

.stat-badge.confirmed {
    background: #c6f6d5;
    color: #276749;
}

.stat-badge.pending {
    background: #fefcbf;
    color: #744210;
}

.stat-badge.declined {
    background: #fed7d7;
    color: #742a2a;
}

.scaled-list,
.available-list {
    margin-bottom: 2rem;
}

.scaled-member,
.available-member {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 4px solid #cbd5e0;
    transition: all 0.2s;
}

.scaled-member:hover,
.available-member:hover {
    background: #edf2f7;
}

.scaled-member.confirmed {
    border-left-color: #48bb78;
    background: #f0fff4;
}

.scaled-member.pending {
    border-left-color: #ecc94b;
    background: #fffff0;
}

.scaled-member.declined {
    border-left-color: #f56565;
    background: #fff5f5;
    opacity: 0.7;
}

.available-member {
    cursor: pointer;
    border-left-color: #667eea;
}

.available-member input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.member-notes {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #718096;
    font-style: italic;
}

.modal-large {
    max-width: 800px;
    width: 90%;
}

/* ─── Repertoire Voting Styles ─────────────────────────────────────────── */

.voting-header {
    margin-bottom: 2rem;
}

.voting-part {
    background: #f7fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.part-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.part-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.part-stats {
    color: #718096;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.open {
    background: #c6f6d5;
    color: #276749;
}

.status-badge.closed {
    background: #fed7d7;
    color: #742a2a;
}

.status-badge.finalized {
    background: #bee3f8;
    color: #2c5282;
}

.candidates-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.candidate {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.candidate:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.candidate.winner {
    border: 2px solid #f6ad55;
    background: #fffaf0;
}

.candidate-info {
    flex: 1;
}

.candidate-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.winner-badge {
    background: linear-gradient(135deg, #f6ad55, #ed8936);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.candidate-meta {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 0.5rem;
}

.vote-counts {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.vote-count {
    font-weight: 600;
}

.vote-count.up {
    color: #48bb78;
}

.vote-count.down {
    color: #f56565;
}

.vote-score {
    color: #4299e1;
    font-weight: 700;
}

.candidate-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.vote-btn {
    background: #edf2f7;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn:hover {
    transform: scale(1.1);
}

.vote-btn.up {
    border-color: #9ae6b4;
}

.vote-btn.up:hover {
    background: #c6f6d5;
}

.vote-btn.up.active {
    background: #48bb78;
    border-color: #38a169;
}

.vote-btn.down {
    border-color: #fc8181;
}

.vote-btn.down:hover {
    background: #fed7d7;
}

.vote-btn.down.active {
    background: #f56565;
    border-color: #e53e3e;
}

.form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10000;
    overflow-y: auto;
    padding: 24px 12px;
}

.form-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.form-card h4 {
    margin-bottom: 1.5rem;
}

.form-card label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.form-card select,
.form-card input,
.form-card textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1rem;
}

.form-card select:focus,
.form-card input:focus,
.form-card textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Voting summary in rehearsal detail */
.voting-part-summary {
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.part-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.status-mini {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    background: #edf2f7;
}

.winner-summary {
    color: #d69e2e;
    font-weight: 600;
    font-size: 0.9rem;
}

.voting-stats-mini {
    color: #718096;
    font-size: 0.85rem;
}

/* ─── Polls (Enquetes) Styles ──────────────────────────────────────────── */

.polls-section {
    max-width: 1000px;
    margin: 0 auto;
}

.section-description {
    color: #718096;
    margin-bottom: 2rem;
    text-align: center;
}

.polls-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.poll-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.poll-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.poll-card.closed {
    opacity: 0.8;
}

.poll-header {
    margin-bottom: 1rem;
}

.poll-header h4 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
}

.poll-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.poll-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.poll-status-badge.draft {
    background: #edf2f7;
    color: #4a5568;
}

.poll-status-badge.active {
    background: #c6f6d5;
    color: #276749;
}

.poll-status-badge.closed {
    background: #fed7d7;
    color: #742a2a;
}

.poll-status-badge.archived {
    background: #e6fffa;
    color: #234e52;
}

.badge-small {
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
    background: #edf2f7;
    color: #4a5568;
}

.poll-description {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.poll-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #a0aec0;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.user-voted-badge {
    background: #d3f9d8;
    color: #2f855a;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 0.5rem;
    text-align: center;
}

/* Poll Modal Content */
.poll-description-full {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: #4a5568;
}

.poll-info-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: #edf2f7;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
}

.poll-stats-summary {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.poll-stats-summary .stat {
    color: #4a5568;
}

.poll-stats-summary strong {
    color: #2d3748;
    font-size: 1.2rem;
}

.poll-options {
    margin-bottom: 1.5rem;
}

.poll-option {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.poll-option:hover {
    border-color: #cbd5e0;
}

.poll-option.user-selected {
    border-color: #667eea;
    background: #f7faff;
}

.poll-option-vote {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.poll-option-vote input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.option-text {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
}

.option-text-result {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.75rem;
}

.option-stats {
    margin-top: 0.75rem;
}

.vote-bar {
    height: 8px;
    background: #edf2f7;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.vote-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s;
}

.vote-count {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 600;
}

.poll-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
}

/* Create Poll Form */
.form-large {
    max-width: 600px;
}

.poll-option-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.poll-option-input input {
    flex: 1;
}
