/* ========================================
   PESQUISA DE SATISFAÇÃO - FRONTEND CSS
   ======================================== */

/* Container Principal */
.ps-container {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ps-header {
    text-align: center;
    margin-bottom: 30px;
}

.ps-titulo {
    color: var(--ps-cor, #004401);
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px;
}

.ps-subtitulo {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* Mensagens */
.ps-mensagem {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
}

.ps-mensagem.ps-sucesso {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ps-mensagem.ps-erro {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* CPF Section */
.ps-cpf-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.ps-cpf-input {
    flex: 1;
    min-width: 250px;
}

.ps-cpf-input label {
    display: block;
    font-weight: 600;
    color: var(--ps-cor, #004401);
    margin-bottom: 8px;
    font-size: 15px;
}

.ps-cpf-input input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 18px;
    font-family: monospace;
    transition: border-color 0.3s;
}

.ps-cpf-input input:focus {
    outline: none;
    border-color: var(--ps-cor, #004401);
}

.ps-cpf-info {
    flex: 2;
    min-width: 300px;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.ps-cpf-info strong {
    color: #333;
}

/* Legenda */
.ps-legenda {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
}

.ps-legenda-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
}

.ps-icon {
    font-size: 22px;
}

.ps-icon-1 { color: #dc3545; }
.ps-icon-2 { color: #fd7e14; }
.ps-icon-3 { color: #6c757d; }
.ps-icon-4 { color: #28a745; }
.ps-icon-5 { color: #198754; }

/* Perguntas */
.ps-perguntas {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.ps-pergunta-row {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.ps-pergunta-row:last-child {
    border-bottom: none;
}

.ps-pergunta-row:nth-child(even) {
    background: #fafafa;
}

.ps-pergunta-texto {
    flex: 1;
    padding-right: 20px;
    font-size: 15px;
    color: #333;
    line-height: 1.5;
}

.ps-pergunta-opcoes {
    display: flex;
    gap: 8px;
}

.ps-opcao {
    cursor: pointer;
}

.ps-opcao input {
    display: none;
}

.ps-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 24px;
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    background: #fff;
    transition: all 0.2s ease;
    color: #ccc;
}

.ps-opcao:hover .ps-icon-btn {
    transform: scale(1.1);
}

.ps-opcao:hover .ps-icon-1 { border-color: #dc3545; color: #dc3545; }
.ps-opcao:hover .ps-icon-2 { border-color: #fd7e14; color: #fd7e14; }
.ps-opcao:hover .ps-icon-3 { border-color: #6c757d; color: #6c757d; }
.ps-opcao:hover .ps-icon-4 { border-color: #28a745; color: #28a745; }
.ps-opcao:hover .ps-icon-5 { border-color: #198754; color: #198754; }

.ps-opcao input:checked + .ps-icon-btn {
    transform: scale(1.15);
}

.ps-opcao input:checked + .ps-icon-1 { 
    border-color: #dc3545; 
    background: #dc3545; 
    color: #fff; 
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}
.ps-opcao input:checked + .ps-icon-2 { 
    border-color: #fd7e14; 
    background: #fd7e14; 
    color: #fff; 
    box-shadow: 0 4px 15px rgba(253, 126, 20, 0.4);
}
.ps-opcao input:checked + .ps-icon-3 { 
    border-color: #6c757d; 
    background: #6c757d; 
    color: #fff; 
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}
.ps-opcao input:checked + .ps-icon-4 { 
    border-color: #28a745; 
    background: #28a745; 
    color: #fff; 
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}
.ps-opcao input:checked + .ps-icon-5 { 
    border-color: #198754; 
    background: #198754; 
    color: #fff; 
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.4);
}

/* Sugestão */
.ps-sugestao {
    margin-top: 25px;
}

.ps-sugestao label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 15px;
}

.ps-sugestao textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.ps-sugestao textarea:focus {
    outline: none;
    border-color: var(--ps-cor, #004401);
}

/* LGPD */
.ps-lgpd {
    margin-top: 25px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    border-left: 4px solid var(--ps-cor, #004401);
}

.ps-lgpd p {
    margin: 0;
}

.ps-lgpd i {
    margin-right: 8px;
    color: var(--ps-cor, #004401);
}

/* Botão Submit */
.ps-submit {
    margin-top: 30px;
    text-align: center;
}

.ps-btn-enviar {
    display: inline-block;
    padding: 15px 50px;
    background: var(--ps-cor, #004401);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.ps-btn-enviar i {
    margin-right: 8px;
}

.ps-btn-enviar:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 68, 1, 0.3);
}

.ps-btn-enviar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========================================
   RELATÓRIOS
   ======================================== */
.ps-relatorios {
    text-align: center;
}

.ps-rel-titulo {
    color: var(--ps-cor, #004401);
    font-size: 20px;
    margin: 0 0 20px;
}

.ps-rel-btn {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 0 auto 15px;
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.ps-rel-btn-atual {
    background: var(--ps-cor, #004401);
    color: #fff;
}

.ps-rel-btn-atual:hover {
    opacity: 0.9;
}

.ps-rel-btn-anterior {
    background: #fff;
    color: var(--ps-cor, #004401);
    border: 2px solid var(--ps-cor, #004401);
}

.ps-rel-btn-anterior:hover {
    background: var(--ps-cor, #004401);
    color: #fff;
}

.ps-rel-icon {
    margin-right: 8px;
}

.ps-rel-anteriores-titulo {
    font-size: 14px;
    color: #666;
    margin: 25px 0 15px;
}

/* ========================================
   MODAL
   ======================================== */
.ps-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
}

.ps-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.ps-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ps-modal-fechar {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.ps-modal-fechar:hover {
    color: #333;
}

.ps-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #eee;
}

.ps-modal-header h3 {
    margin: 0 0 5px;
    font-size: 24px;
    color: #333;
}

.ps-modal-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.ps-modal-loading {
    padding: 50px;
    text-align: center;
}

.ps-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #004401;
    border-radius: 50%;
    animation: ps-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes ps-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ps-modal-body {
    padding: 25px 30px;
}

.ps-modal-resumo {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.ps-modal-stat {
    flex: 1;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.ps-modal-stat-numero {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: #004401;
}

.ps-modal-stat-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.ps-modal-tabela h4 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #333;
}

.ps-modal-tabela table {
    width: 100%;
    border-collapse: collapse;
}

.ps-modal-tabela th,
.ps-modal-tabela td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ps-modal-tabela th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
    color: #666;
}

.ps-modal-tabela td {
    font-size: 14px;
}

.ps-modal-grafico {
    margin-top: 30px;
}

/* Exportação */
.ps-modal-exportar {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.ps-modal-exportar h4 {
    margin: 0 0 15px;
    font-size: 14px;
    color: #666;
}

.ps-modal-exportar h4 i {
    margin-right: 8px;
}

.ps-modal-exportar-btns {
    display: flex;
    gap: 15px;
}

.ps-export-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ps-export-pdf {
    background: #dc3545;
    color: #fff;
}

.ps-export-pdf:hover {
    background: #c82333;
}

.ps-export-csv {
    background: #28a745;
    color: #fff;
}

.ps-export-csv:hover {
    background: #218838;
}

/* ========================================
   GRÁFICO
   ======================================== */
.ps-grafico-container {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.ps-grafico-titulo {
    margin: 0 0 15px;
    font-size: 16px;
    color: #333;
    text-align: center;
}

.ps-grafico-wrapper {
    position: relative;
}

/* ========================================
   RESPONSIVO
   ======================================== */
@media (max-width: 768px) {
    .ps-pergunta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .ps-pergunta-texto {
        padding-right: 0;
    }

    .ps-pergunta-opcoes {
        width: 100%;
        justify-content: space-between;
    }

    .ps-icon-btn {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .ps-cpf-section {
        flex-direction: column;
    }

    .ps-legenda {
        gap: 12px;
    }

    .ps-legenda-item {
        font-size: 11px;
    }

    .ps-modal-resumo {
        flex-direction: column;
    }
}
