/* Sistema de Provas - Estilos Frontend */

.sp-provas-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Card de Prova Aleatória */
.sp-prova-random-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 50px 40px;
    text-align: center;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.sp-prova-random-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse-random 8s infinite;
}

@keyframes pulse-random {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.5; }
}

.sp-random-icon {
    font-size: 64px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.sp-prova-random-card h3 {
    margin: 0 0 15px 0;
    font-size: 32px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.sp-prova-random-card p {
    margin: 0 0 10px 0;
    font-size: 16px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.sp-prova-random-card p:last-of-type {
    margin-bottom: 30px;
}

.sp-btn-large {
    padding: 16px 40px !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    position: relative;
    z-index: 1;
    border-radius: 50px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.sp-btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.sp-provas-container h1 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #333;
}

/* Tabs */
.sp-provas-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.sp-tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.sp-tab-btn:hover {
    color: #333;
}

.sp-tab-btn.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

/* Tab Content */
.sp-tab-content {
    display: none;
}

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

/* Grid de Provas Disponíveis */
.sp-provas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.sp-prova-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.sp-prova-card h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #333;
}

.sp-prova-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.sp-questoes-count::before {
    content: "📝 ";
}

.sp-prova-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* Lista de Provas Realizadas */
.sp-provas-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sp-prova-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #ccc;
    border-radius: 4px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sp-prova-item.sp-status-corrigida {
    border-left-color: #4caf50;
}

.sp-prova-item.sp-status-pendente {
    border-left-color: #ff9800;
}

.sp-prova-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.sp-prova-details {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.sp-data {
    color: #666;
    font-size: 14px;
}

.sp-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.sp-status.sp-corrigida {
    background: #e8f5e9;
    color: #2e7d32;
}

.sp-status.sp-pendente {
    background: #fff3e0;
    color: #e65100;
}

.sp-nota {
    font-weight: bold;
    color: #2271b1;
    font-size: 16px;
}

/* Botões */
.sp-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.sp-btn-primary {
    background: #2271b1;
    color: white;
}

.sp-btn-primary:hover {
    background: #135e96;
    color: white;
}

.sp-btn-secondary {
    background: #f0f0f1;
    color: #2c3338;
}

.sp-btn-secondary:hover {
    background: #dcdcde;
}

/* Mensagem vazia */
.sp-empty-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* ====== Página de Fazer Prova ====== */
.sp-fazer-prova-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.sp-prova-header {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.sp-prova-header h1 {
    margin: 0 0 15px 0;
    color: #333;
}

.sp-prova-instrucoes {
    background: #f0f8ff;
    padding: 15px;
    border-left: 4px solid #2271b1;
    margin: 15px 0;
    border-radius: 4px;
}

.sp-prova-info {
    color: #666;
    margin: 10px 0 0 0;
}

.sp-questao-box {
    background: white;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sp-questao-numero {
    display: inline-block;
    background: #2271b1;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 15px;
}

.sp-questao-titulo {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.sp-questao-enunciado {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.sp-alternativas {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sp-alternativa-label {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.sp-alternativa-label:hover {
    border-color: #2271b1;
    background: #f0f8ff;
}

.sp-alternativa-label input[type="radio"] {
    margin: 0;
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.sp-alternativa-label input[type="radio"]:checked ~ .sp-alternativa-letra {
    background: #2271b1;
    color: white;
}

.sp-alternativa-letra {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #e0e0e0;
    color: #333;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.sp-alternativa-texto {
    flex: 1;
    line-height: 1.5;
}

.sp-form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ====== Página de Resultado ====== */
.sp-resultado-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.sp-resultado-container h1 {
    margin-bottom: 30px;
}

.sp-resultado-header {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.sp-resultado-info {
    color: #666;
    margin-bottom: 20px;
}

.sp-nota-box {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
    margin: 20px 0;
}

.sp-nota-label {
    font-size: 16px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.sp-nota-valor {
    font-size: 48px;
    font-weight: bold;
}

.sp-feedback-box {
    background: #f9f9f9;
    padding: 20px;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
    margin: 20px 0;
}

.sp-feedback-box h3 {
    margin-top: 0;
    color: #333;
}

.sp-feedback-content {
    line-height: 1.6;
    color: #555;
}

.sp-feedback-meta {
    margin-top: 15px;
    font-size: 13px;
    color: #999;
}

.sp-pendente-box {
    background: #fff3e0;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

.sp-pendente-box p {
    margin: 0;
    color: #e65100;
    font-size: 16px;
    font-weight: 500;
}

.sp-respostas-lista {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.sp-resultado-container h2 {
    margin: 30px 0 20px 0;
    font-size: 24px;
}

.sp-resposta-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #2271b1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sp-resposta-numero {
    font-size: 14px;
    font-weight: bold;
    color: #2271b1;
    margin-bottom: 8px;
}

.sp-resposta-questao {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.sp-resposta-dada {
    background: #f0f8ff;
    padding: 12px;
    border-radius: 4px;
    color: #333;
}

/* ====== NOVOS ESTILOS - CRONÔMETRO ====== */
.sp-cronometro-wrapper {
    position: fixed;
    top: 32px;
    right: 20px;
    z-index: 9999;
}

.sp-cronometro {
    background: #2271b1;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 180px;
}

.sp-cronometro-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.sp-cronometro-tempo {
    font-size: 32px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.sp-cronometro.sp-tempo-critico {
    background: #d63638;
    animation: pulse 1s infinite;
}

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

/* ====== QUESTÕES DISCURSIVAS ====== */
.sp-discursiva {
    margin-top: 15px;
}

.sp-discursiva label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.sp-textarea-discursiva {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
}

.sp-textarea-discursiva:focus {
    outline: none;
    border-color: #2271b1;
}

/* ====== RESULTADO COM CORES ====== */
.sp-resposta-item.sp-acertou {
    border-left-color: #4caf50;
    background: #f1f8f4;
}

.sp-resposta-item.sp-errou {
    border-left-color: #d63638;
    background: #fef3f3;
}

.sp-badge-acerto {
    background: #4caf50;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 10px;
}

.sp-badge-erro {
    background: #d63638;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 10px;
}

/* Alternativas com cores no resultado */
.sp-alternativas-resultado {
    margin: 15px 0;
}

.sp-alternativa-resultado {
    padding: 12px;
    margin: 8px 0;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sp-alt-letra {
    font-weight: bold;
    color: #666;
    min-width: 30px;
}

.sp-alternativa-resultado.sp-alt-correta {
    background: #d4edda;
    border: 2px solid #28a745;
    font-weight: 600;
    position: relative;
    padding-left: 20px;
}

.sp-alternativa-resultado.sp-alt-correta::before {
    content: "✓";
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: #28a745;
    font-size: 20px;
    font-weight: bold;
}

.sp-alternativa-resultado.sp-alt-errada {
    background: #f8d7da;
    border: 2px solid #dc3545;
    font-weight: 600;
    position: relative;
    padding-left: 20px;
}

.sp-alternativa-resultado.sp-alt-errada::before {
    content: "✗";
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: #dc3545;
    font-size: 20px;
    font-weight: bold;
}

.sp-alternativa-resultado.sp-alt-selecionada {
    background: #e7f5ff;
    border-color: #2271b1;
}

.sp-alt-badge {
    margin-left: auto;
    background: #2271b1;
    color: white;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.sp-alt-badge.sp-badge-acertou {
    background: #28a745;
}

.sp-alt-badge.sp-badge-errou {
    background: #dc3545;
}

.sp-alt-badge-correto {
    margin-left: auto;
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

/* Resposta discursiva no resultado */
.sp-resposta-discursiva {
    margin: 15px 0;
}

.sp-resposta-titulo {
    margin-bottom: 8px;
}

.sp-resposta-texto {
    background: #f9f9f9;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* Feedback por questão */
.sp-feedback-questao {
    margin-top: 15px;
    padding: 15px;
    background: #fffbcc;
    border-left: 4px solid #f39c12;
    border-radius: 4px;
}

.sp-feedback-questao strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
}

.sp-feedback-texto {
    color: #555;
    line-height: 1.6;
}

/* Responsivo */
@media (max-width: 768px) {
    .sp-provas-grid {
        grid-template-columns: 1fr;
    }

    .sp-prova-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .sp-prova-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .sp-form-actions {
        flex-direction: column;
    }

    .sp-form-actions .sp-btn {
        width: 100%;
        text-align: center;
    }

    .sp-cronometro-wrapper {
        top: 10px;
        right: 10px;
    }

    .sp-cronometro {
        padding: 10px 15px;
        min-width: 140px;
    }

    .sp-cronometro-tempo {
        font-size: 24px;
    }
}
