/* Round History Modal Modernized CSS - Extracted from mockup_simplified.html */

/* Modal size override - adjust to content size */
#modalHistoricoRodada .modal-dialog {
    max-width: calc(800px + 3rem) !important;
    /* conteúdo + padding */
}

:root {
    /* Purple gradient theme from PRD */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-dark: #764ba2;

    /* Semantic colors */
    --success-color: #10b981;
    --success-bg: #ecfdf5;
    --danger-color: #ef4444;
    --danger-bg: #fef2f2;
    --info-color: #3b82f6;
    --info-bg: #eff6ff;
    --warning-color: #f59e0b;
    --warning-bg: #fffbeb;

    /* Neutrals */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Spacing system */
    --spacing-unit: 1rem;
    --border-radius: 0.75rem;
    --border-radius-sm: 0.5rem;

    /* Typography */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
}

body {
    background: var(--gray-50);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-unit);
}

.response-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    overflow: hidden;
    transition: all 0.2s ease;
}

.response-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.response-header {
    padding: calc(var(--spacing-unit) * 1.25);
    background: linear-gradient(to right, var(--gray-50), white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.author-info {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.75);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.author-name {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--gray-800);
    line-height: 1.2;
}

.author-stats {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-top: 4px;
    font-weight: 500;
}

.effectiveness-container {
    flex: 1;
    max-width: 200px;
    margin-left: auto;
}

.effectiveness-bar-container {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.effectiveness-bar {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.effectiveness-bar.effectiveness-75 {
    background: var(--primary-gradient);
}

.effectiveness-bar.effectiveness-50 {
    background: var(--primary-gradient);
}

.effectiveness-bar.effectiveness-25 {
    background: var(--primary-gradient);
}

.effectiveness-bar.effectiveness-0 {
    background: var(--gray-400);
}

.effectiveness-label {
    font-size: var(--font-size-xs);
    color: var(--gray-600);
    text-align: center;
    font-weight: 500;
}

/* Identification Bar (segunda barra no header) */
.identification-bar-container {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
    margin-bottom: 6px;
}

.identification-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.identification-bar.identification-100 {
    background: var(--primary-gradient);
}

.identification-bar.identification-75 {
    background: var(--primary-gradient);
}

.identification-bar.identification-50 {
    background: var(--primary-gradient);
}

.identification-bar.identification-25 {
    background: var(--primary-gradient);
}

.identification-bar.identification-0 {
    background: var(--gray-400);
}

.identification-label {
    font-size: var(--font-size-xs);
    color: var(--gray-600);
    text-align: center;
    font-weight: 500;
}

.response-content {
    padding: calc(var(--spacing-unit) * 1.25);
}

.response-text {
    font-size: var(--font-size-lg);
    color: var(--gray-800);
    font-style: italic;
    margin: 0;
    line-height: 1.5;
}

/* Custom buttons - no Bootstrap classes */
.profile-toggle-btn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 calc(var(--spacing-unit) * 1.25) calc(var(--spacing-unit) * 1.25);
}

.profile-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.profile-toggle-btn.expanded {
    background: var(--gray-600);
}

/* Tabs System */
.tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.tab-btn {
    flex: 1;
    padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit));
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

.tab-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.progress-badge {
    background: var(--primary-color);
    color: white;
    font-size: var(--font-size-xs);
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    font-weight: 600;
}

/* ✅ FIX: Tornar específico apenas para modal de histórico */
#modalHistoricoRodada .tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

#modalHistoricoRodada .tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Votes Section */
.votes-section {
    padding: calc(var(--spacing-unit) * 1.25);
    background: var(--gray-50);
}

.votes-progress {
    background: white;
    padding: calc(var(--spacing-unit));
    border-radius: var(--border-radius-sm);
    margin-bottom: calc(var(--spacing-unit));
    border: 1px solid var(--gray-200);
}

.progress-info h6 {
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    font-size: var(--font-size-base);
}

.progress-stats {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    margin-bottom: calc(var(--spacing-unit) * 0.75);
}

.progress-bar-container {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.votes-grid {
    display: grid;
    gap: calc(var(--spacing-unit));
}

.vote-section {
    background: white;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.vote-header {
    padding: calc(var(--spacing-unit) * 0.75);
    font-weight: 600;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.vote-header.success {
    background: var(--success-bg);
    color: var(--success-color);
}

.vote-header.danger {
    background: var(--danger-bg);
    color: var(--danger-color);
}

/* Collapsible styles for vote headers */
.vote-header.collapsible-header {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.vote-header.collapsible-header:hover {
    opacity: 0.9;
}

.collapsible-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.collapsible-content.collapsed {
    display: none;
}

.collapse-icon {
    transition: transform 0.3s ease;
    font-size: 0.875rem;
    opacity: 0.7;
}

.vote-list {
    padding: calc(var(--spacing-unit) * 0.75);
}

.vote-item {
    padding: calc(var(--spacing-unit) * 0.75) 0;
    border-bottom: 1px solid var(--gray-200);
}

.vote-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.vote-quote {
    font-style: italic;
    color: var(--gray-700);
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    font-size: var(--font-size-base);
}

.vote-details {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 0.5);
}

.vote-details.d-flex {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.author-real {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    font-weight: 500;
    flex-shrink: 0;
}

.author-real .player-badge {
    max-width: fit-content;
}

.author-guess {
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-align: center;
    flex-shrink: 0;
}

.author-guess .player-badge {
    max-width: fit-content;
}

.author-guess.correct {
    color: var(--success-color);
}

.author-guess.incorrect {
    color: var(--danger-color);
}

.vote-points {
    font-weight: 600;
    color: var(--success-color);
    font-size: var(--font-size-sm);
}

.vote-points.error {
    color: var(--gray-500);
}

/* Response Quote Section */
.response-quote-section {
    padding: calc(var(--spacing-unit) * 1.25);
    background: linear-gradient(135deg, var(--info-bg), white);
    border-bottom: 1px solid var(--gray-200);
}

.response-quote {
    text-align: center;
    position: relative;
    padding: calc(var(--spacing-unit) * 1.5);
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.quote-icon {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: var(--primary-color);
    background: white;
    padding: 0 8px;
}

.quote-text {
    font-size: var(--font-size-xl);
    font-style: italic;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
    min-height: 1.5em;
}

/* Always visible details section */
.response-details {
    padding: calc(var(--spacing-unit) * 1.25);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.details-grid {
    display: grid;
    gap: calc(var(--spacing-unit));
}

.detail-section {
    background: white;
    padding: calc(var(--spacing-unit));
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--gray-200);
}

.detail-header {
    font-weight: 600;
    font-size: var(--font-size-sm);
    margin-bottom: calc(var(--spacing-unit) * 0.75);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: calc(var(--spacing-unit) * 0.75);
    margin: 0 0 calc(var(--spacing-unit) * 0.75) 0;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.detail-header.success {
    background: var(--success-bg);
    color: var(--success-color);
}

.detail-header.danger {
    background: var(--danger-bg);
    color: var(--danger-color);
}

.detail-header.info {
    color: var(--info-color);
}

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

.header-points {
    font-weight: 700;
    font-size: var(--font-size-sm);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.2);
}

.player-badges {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 0.5);
}

.player-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 1rem;
    font-size: var(--font-size-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.player-badge.success {
    background: var(--success-bg);
    color: var(--success-color);
}

.player-badge.danger {
    background: var(--danger-bg);
    color: var(--danger-color);
}

.player-badge.info {
    background: var(--info-bg);
    color: var(--info-color);
}

/* Efeito invertido para o jogador atual - baseado no contexto */
.player-badge.current-player {
    font-weight: 600 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    cursor: default;
    position: relative;
}

.player-badge.current-player i {
    color: white !important;
}

/* Verde: success context */
.bg-success .player-badge.current-player,
.success-votes .player-badge.current-player,
.player-badge.success.current-player {
    background: var(--success-color) !important;
    color: white !important;
}

/* Vermelho: danger context */
.bg-danger .player-badge.current-player,
.error-votes .player-badge.current-player,
.player-badge.danger.current-player {
    background: var(--danger-color) !important;
    color: white !important;
}

/* Current Player Highlight System - Simplified */
.current-player {
    background: var(--success-color) !important;
    color: white !important;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.3);
    cursor: default;
    position: relative;
}

.current-player i {
    color: white;
}

/* Reduce current player prominence in error contexts */
.error-votes .current-player,
.vote-section.error-votes .current-player {
    font-weight: 500;
    border: 1px solid transparent;
    padding: 0.2rem 0.4rem;
}

/* Tooltip System */
.tooltip-popup {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tooltip-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gray-800);
}

.current-player:hover .tooltip-popup,
.tooltip-popup.show {
    opacity: 1;
    visibility: visible;
    bottom: 125%;
}

/* Current player styling inherits the parent's semantic color but inverted */
.bg-success .current-player,
.success-votes .current-player {
    background: var(--success-color) !important;
    color: white !important;
}

.bg-danger .current-player,
.error-votes .current-player {
    background: var(--danger-color) !important;
    color: white !important;
}

/* Collapsible profile section */
.player-profile-inline {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--info-bg);
    border-top: 1px solid var(--gray-200);
}

.player-profile-inline.expanded {
    max-height: 600px;
}

.discovery-grid {
    padding: calc(var(--spacing-unit) * 1.25);
    display: grid;
    gap: calc(var(--spacing-unit));
}

.discovery-section {
    background: white;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.discovery-header {
    padding: calc(var(--spacing-unit) * 0.75);
    font-weight: 600;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.discovery-header.success {
    background: var(--success-bg);
    color: var(--success-color);
}

.discovery-header.danger {
    background: var(--danger-bg);
    color: var(--danger-color);
}

.discovery-list {
    padding: calc(var(--spacing-unit) * 0.75);
}

.discovery-item {
    padding: calc(var(--spacing-unit) * 0.5) 0;
    border-bottom: 1px solid var(--gray-200);
}

.discovery-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.discovery-quote {
    font-style: italic;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.discovery-author {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.discovery-points {
    font-weight: 600;
    color: var(--success-color);
}

.discovery-points.error {
    color: var(--gray-500);
}

/* Vote response styling */
.quote-response {
    background: var(--gray-50);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--primary-color);
    margin-top: 0.5rem;
}

.quote-response .bi-quote {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.response-text {
    font-style: italic;
    color: var(--gray-700);
    font-size: var(--font-size-sm);
}

/* Responsive design */
@media (max-width: 768px) {
    .main-container {
        padding: calc(var(--spacing-unit) * 0.5);
    }

    .response-header {
        flex-direction: column;
        align-items: stretch;
        gap: calc(var(--spacing-unit) * 0.75);
    }

    .effectiveness-container {
        max-width: none;
        margin-left: 0;
    }

    .author-info {
        justify-content: center;
    }

    .player-badges {
        gap: 0.5rem;
    }
}

/* Animation utilities */
.slide-down {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Round Info Section */
.round-info-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: calc(var(--spacing-unit) * 2);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

.round-info-header {
    padding: calc(var(--spacing-unit) * 1.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.round-info-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.round-number-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.round-prompt {
    background: rgba(255, 255, 255, 0.05);
    padding: calc(var(--spacing-unit) * 1.5);
    border-radius: var(--border-radius);
    margin: calc(var(--spacing-unit) * 1.5);
    backdrop-filter: blur(10px);
}

.prompt-text {
    font-size: var(--font-size-lg);
    font-style: italic;
    text-align: center;
    margin: 0;
    line-height: 1.6;
    color: white;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.prompt-author {
    text-align: center;
    margin-top: calc(var(--spacing-unit) * 0.75);
    font-size: var(--font-size-sm);
    opacity: 0.9;
    color: white;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.round-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: calc(var(--spacing-unit));
    padding: calc(var(--spacing-unit) * 1.5);
}

.round-stat {
    text-align: center;
    padding: calc(var(--spacing-unit) * 0.75);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
}

.round-stat-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    display: block;
}

.round-stat-label {
    font-size: var(--font-size-xs);
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* Responses Grid */
.responses-grid {
    display: grid;
    gap: calc(var(--spacing-unit) * 1.5);
}

/* Leaderboard styling */
.leaderboard-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: 700;
    font-size: var(--font-size-xs);
    margin-left: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.leaderboard-position.position-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #b45309;
}

.leaderboard-position.position-2 {
    background: linear-gradient(135deg, #c0c0c0, #e5e7eb);
    color: #374151;
}

.leaderboard-position.position-3 {
    background: linear-gradient(135deg, #cd7f32, #d69e2e);
    color: white;
}

.leaderboard-position.position-other {
    background: var(--gray-200);
    color: var(--gray-600);
}