/* 
 * Estilos Globais - Sistema de Pesquisas
 * Arquivo CSS principal para toda a aplicação
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

body {
    background-color: #f5f5f5;
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: 32px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

p {
    margin-bottom: 1rem;
}

a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #764ba2;
}

/* Botões */
button, .btn, input[type="submit"], input[type="button"] {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

button:hover, .btn:hover, input[type="submit"]:hover, input[type="button"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

button:active, .btn:active, input[type="submit"]:active, input[type="button"]:active {
    transform: translateY(0);
}

/* Formulários */
input, textarea, select {
    font-family: inherit;
    font-size: 14px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: all 0.3s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

/* Tabelas */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background-color: #f9f9f9;
    border-bottom: 2px solid #eee;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
}

td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

tbody tr:hover {
    background-color: #f9f9f9;
}

/* Mensagens */
.mensagem, .alerta, .erro, .sucesso, .info {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.erro {
    background-color: #fee;
    color: #c33;
    border-left-color: #c33;
}

.sucesso {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #155724;
}

.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left-color: #0c5460;
}

.alerta {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: #856404;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 0;
}

.card-footer {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 15px;
}

/* Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.col {
    flex: 1;
}

/* Utilidades */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.gap-3 { gap: 30px; }

/* Responsivo */
@media (max-width: 768px) {
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .row {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 13px;
    }
    
    th, td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 20px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    button, .btn, input[type="submit"], input[type="button"] {
        width: 100%;
    }
    
    input, textarea, select {
        width: 100%;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Scrollbar customizada */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Print styles */
@media print {
    .sidebar, .btn-logout, .export-buttons, .btn-voltar {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .main-content {
        padding: 0;
    }
}
