/* =============================================================================
   ESTILOS GERAIS
   ============================================================================= */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

h2, h3 {
    color: #34495e;
}

/* =============================================================================
   COMPONENTES DE EVENTOS
   ============================================================================= */

.eventos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.evento-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
    transition: transform 0.2s, box-shadow 0.2s;
}

.evento-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.evento-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.evento-header h2, .evento-header h3 {
    margin: 0;
    flex: 1;
}

.evento-data {
    color: #666;
    font-weight: 500;
    margin-bottom: 10px;
}

.evento-descricao {
    color: #777;
    margin-bottom: 20px;
    line-height: 1.5;
}

.evento-actions {
    margin-top: 15px;
}

/* =============================================================================
   FORMULÁRIOS
   ============================================================================= */

.form-container {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin: 20px 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input {
    width: auto;
    transform: scale(1.2);
}

.form-actions {
    margin-top: 25px;
    text-align: center;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

/* =============================================================================
   BOTÕES
   ============================================================================= */

.btn {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-success {
    background: #32bd6d;
}

.btn-success:hover {
    background: #219a52;
}

.btn-warning {
    background: #f39c12;
    color: #2c3e50;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: #e74c3c;
}

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

.btn-info {
    background: #17a2b8;
}

.btn-info:hover {
    background: #138496;
}

.btn-certificado {
    background: #28a745;
}

.btn-certificado:hover {
    background: #218838;
}

.btn-pdf {
    background: #dc3545;
}

.btn-pdf:hover {
    background: #c82333;
}

.btn-primary {
    background: #3498db;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-disabled {
    background: #95a5a6 !important;
    cursor: not-allowed;
}

.btn-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* =============================================================================
   PÁGINAS DE CONFIRMAÇÃO E SUCESSO
   ============================================================================= */

.success-container, .error-container {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.success-icon, .error-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.next-steps {
    background: #e8f5e8;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
}

.next-steps ul {
    margin: 10px 0;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #7f8c8d;
    text-decoration: none;
}

.back-link a:hover {
    color: #34495e;
}

/* =============================================================================
   ÁREA ADMINISTRATIVA
   ============================================================================= */

.admin-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.admin-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #3498db;
    transition: transform 0.3s, box-shadow 0.3s;
}

.admin-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.admin-card h2 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.4em;
}

.admin-card p {
    color: #7f8c8d;
    margin-bottom: 25px;
    font-size: 1.1em;
}

.admin-actions {
    margin: 25px 0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.acoes-certificados {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-links {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

/* =============================================================================
   STATUS E INDICADORES
   ============================================================================= */

.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-ativo {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-inativo {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.badge-full {
    background: #e74c3c;
    color: white;
}

/* =============================================================================
   ESTATÍSTICAS
   ============================================================================= */

.stats-bar {
    display: flex;
    gap: 30px;
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    justify-content: center;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
}

.stat-full {
    color: #e74c3c;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
}

/* =============================================================================
   TABELAS
   ============================================================================= */

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* =============================================================================
   ESTADOS VAZIOS
   ============================================================================= */

.empty-state {
    text-align: center;
    padding: 50px;
    color: #7f8c8d;
}

.no-data {
    text-align: center;
    padding: 50px;
    color: #6c757d;
    font-style: italic;
    font-size: 1.1em;
}

/* =============================================================================
   FORMULÁRIOS DE EVENTOS (ADMIN)
   ============================================================================= */

.evento-form {
    background: white;
    padding: 35px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 700px;
    margin: 20px auto;
}

/* =============================================================================
   COMPONENTES DE BUSCA
   ============================================================================= */

.busca-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin: 25px 0;
    border-left: 4px solid #3498db;
}

.busca-form {
    margin-bottom: 0;
}

.busca-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.busca-input {
    flex: 1;
    min-width: 300px;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.busca-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.busca-input::placeholder {
    color: #6c757d;
    opacity: 0.8;
}

.btn-busca {
    background: #3498db;
    white-space: nowrap;
}

.btn-busca:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-limpar {
    background: #6c757d;
    white-space: nowrap;
}

.btn-limpar:hover {
    background: #545b62;
}

.busca-dica {
    margin-top: 8px;
    color: #6c757d;
}

.busca-dica small {
    font-size: 12px;
    opacity: 0.8;
}

/* =============================================================================
   ADMIN ACCESS
   ============================================================================= */

.admin-access {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.admin-access a {
    color: #7f8c8d;
    text-decoration: none;
}

.admin-access a:hover {
    color: #34495e;
}

/* =============================================================================
   RESPONSIVIDADE
   ============================================================================= */

@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    .eventos-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-menu {
        grid-template-columns: 1fr;
    }
    
    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .acoes-certificados {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .busca-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .busca-input {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .btn-busca, .btn-limpar {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .data-table {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .evento-form {
        padding: 20px;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}

/* =============================================================================
   ANIMAÇÕES
   ============================================================================= */

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

.container {
    animation: fadeIn 0.5s ease-out;
}

.evento-card, .admin-card {
    animation: fadeIn 0.6s ease-out;
}

.evento-admin {
    background: white;
    padding: 25px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #3498db;
}

.evento-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.evento-inativo {
    opacity: 0.7;
    background-color: #f8f9fa;
    border-left-color: #95a5a6;
}

.evento-info {
    flex: 1;
    min-width: 300px;
}

.evento-info h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 15px;
}

.evento-info p {
    margin: 8px 0;
    color: #555;
    line-height: 1.5;
}

.evento-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
}

.evento-actions .btn {
    text-align: center;
    white-space: nowrap;
}

/* Estados de resultados */
.no-results {
    text-align: center;
    padding: 50px 30px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.no-results h3 {
    color: #6c757d;
    margin-bottom: 15px;
}

.no-results p {
    color: #6c757d;
    margin-bottom: 15px;
}

.no-results ul {
    text-align: left;
    display: inline-block;
    margin: 15px 0;
    color: #6c757d;
}

.no-results li {
    margin: 8px 0;
}

/* Estatísticas */
.estatisticas {
    background: #e8f5e8;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 25px;
    border-left: 4px solid #28a745;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.estatisticas p {
    margin: 0;
    color: #155724;
    font-weight: 500;
}

.estatisticas .status {
    margin: 0 5px;
    padding: 4px 10px;
}

/* Responsividade para a nova interface */
@media (max-width: 768px) {
    .evento-admin {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }
    
    .evento-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .evento-actions .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .estatisticas {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .estatisticas .status {
        margin: 2px 5px 2px 0;
    }
}

@media (max-width: 480px) {
    .evento-actions {
        flex-direction: column;
    }
    
    .evento-actions .btn {
        width: 100%;
    }
}

/* =============================================================================
   ESTILOS PARA PÁGINA DE NÃO INSCRITO
   ============================================================================= */

.info-box {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #2196f3;
    text-align: left;
}

.info-box h3 {
    margin-top: 0;
    color: #1565c0;
}

.info-box ol {
    margin: 10px 0;
    padding-left: 20px;
}

.info-box li {
    margin: 8px 0;
    color: #555;
}

/* Estilos para os novos campos do formulário */
small {
    font-size: 12px;
    color: #666;
}

.form-group small {
    display: block;
    margin-top: 5px;
}

/* Melhorar responsividade da tabela com novos campos */
@media (max-width: 768px) {
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
}

/* Estilos para o processo unificado */
.btn-large {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
}

.form-help {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 10px;
    font-style: italic;
}

.error-box {
    background: #f8d7da;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #dc3545;
    text-align: center;
}

.info-box h3 {
    margin-top: 0;
    color: #155724;
}

/* =============================================================================
   ESTILOS PARA SELECT2
   ============================================================================= */
/* Estilos melhorados para o Select2 sem placeholder */
.select2-container--default .select2-selection--single {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    height: 48px;
    padding: 10px;
    background: white;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 26px;
    padding-left: 0;
    color: #495057;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #6c757d;
}

/* Quando não há seleção, deixa mais discreto */
.select2-container--default .select2-selection--empty .select2-selection__rendered {
    color: #6c757d;
}

/* Foco no campo */
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Container de busca mais compacto */
.busca-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #3498db;
}

.busca-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

/* Ajuste para o grupo de busca ficar alinhado */
.busca-group .select2-container {
    flex: 1;
}

/* Dica de busca */
.busca-dica {
    margin-top: 8px;
    text-align: center;
}

.busca-dica small {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* =============================================================================
   ESTILOS PARA BUSCA COM AUTOCOMPLETE
   ============================================================================= */

.busca-input-autocomplete {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    min-width: 300px;
}

.busca-input-autocomplete:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.busca-input-autocomplete::placeholder {
    color: #6c757d;
    opacity: 0.8;
}

.sugestoes-container {
    position: absolute;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
    width: calc(100% - 130px);
}

.sugestoes-lista {
    padding: 8px 0;
}

.sugestao-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s;
}

.sugestao-item:hover {
    background-color: #f8f9fa;
}

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

.sugestao-nome {
    font-weight: bold;
    margin-bottom: 4px;
    color: #2c3e50;
}

.sugestao-detalhes {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.sugestao-data {
    font-style: italic;
}

.sugestao-status {
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Container de busca melhorado */
.busca-container {
    position: relative;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #3498db;
}

.busca-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}

.busca-dica {
    margin-top: 8px;
    text-align: center;
}

.busca-dica small {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Responsividade */
@media (max-width: 768px) {
    .busca-input-autocomplete {
        min-width: auto;
        width: 100%;
    }
    
    .busca-group {
        flex-direction: column;
    }
    
    .sugestoes-container {
        width: 100%;
        position: relative;
        margin-top: 10px;
    }
}

/* =============================================================================
   ESTILOS PARA INSCRIÇÃO ADMINISTRATIVA
   ============================================================================= */

.admin-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-header h1 {
    margin-bottom: 0;
    border-bottom: none;
}

.evento-info-card {
    background: #e8f5e8;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #28a745;
}

.evento-info-card h2 {
    margin-top: 0;
    color: #155724;
}

.evento-detalhes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.admin-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.admin-warning h3 {
    color: #856404;
    margin-top: 0;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    color: #212529;
}

/* Responsividade */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .evento-detalhes {
        grid-template-columns: 1fr;
    }
}

/* Versão com largura fixa mínima */
.btn-row .btn {
    flex: 1;
    min-width: 180px; /* Largura mínima igual para todos */
    max-width: 200px; /* Largura máxima opcional */
    text-align: center;
    white-space: nowrap;
    font-size: 14px;
    padding: 10px 8px;
}

/* Estilos para os botões copiadores */
.btn-copiar-link {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-copiar-link:disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

/* Efeito de ripple opcional */
.btn-copiar-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-copiar-link:active::after {
    width: 100px;
    height: 100px;
}

/* Feedback visual durante a cópia */
.btn-copiar-link.copiando {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    transform: scale(0.95);
}
