/**
 * Sistema de Consultas - Câmara Municipal de Rio Brilhante
 * Estilos modernos e responsivos
 */

/* Reset e configurações base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    position: relative;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.header-content .nav-links {
    margin-left: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 300px;
}

.logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.logo-text h1 {
    font-size: 2rem;
    margin: 0;
    font-weight: 600;
    line-height: 1.2;
}

.logo-text p {
    font-size: 1rem;
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-weight: 400;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.nav-links li {
    margin: 0;
}

.nav-links li a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links li a:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-links li a::after {
    content: "↗";
    font-size: 0.9rem;
    opacity: 0.8;
}


/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.card-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Formulários */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control:invalid {
    border-color: var(--danger-color);
}

/* Botões */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, var(--secondary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #229954 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #229954 0%, var(--success-color) 100%);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c0392b 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, var(--danger-color) 100%);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline:hover {
    background: var(--secondary-color);
    color: white;
}

/* Tabelas */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--light-color);
    font-weight: 600;
    color: var(--primary-color);
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

/* Alertas */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--success-color);
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: var(--warning-color);
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: var(--secondary-color);
    color: #0c5460;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Paginação */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 0.5rem;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.pagination .current {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Main Content */
.main-content {
    width: 100%;
    position: relative;
    overflow-x: hidden;
}

/* Resultados da Busca */
.results-section {
    margin-top: 2rem;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.results-count {
    color: var(--text-light);
    font-size: 1.1rem;
    margin: 0;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-item {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: var(--transition);
    border-left: 4px solid var(--secondary-color);
}

.result-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.result-number {
    background: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1.1rem;
}

.result-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-light);
}

.result-meta span {
    background: var(--light-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: 500;
}

.result-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.result-description {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Estado vazio */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.empty-state-icon {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Mensagem de erro */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #f5c6cb;
    margin-top: 1rem;
}

.error-message ul {
    margin: 0;
    padding-left: 1.5rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .logo {
        min-width: auto;
        justify-content: center;
    }
    
    .logo-text h1 {
        font-size: 1.8rem;
    }
    
    .nav-links {
        justify-content: center;
        gap: 1rem;
    }
    
    .nav-links li a {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .results-title {
        font-size: 1.5rem;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .result-meta {
        gap: 0.5rem;
    }
    
    .result-meta span {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
    
    .result-title {
        font-size: 1.1rem;
    }
    
    .result-description {
        font-size: 0.9rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .form-control {
        padding: 10px 12px;
    }
}

/* Animações */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Utilitários */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Acessibilidade */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible para acessibilidade */
.btn:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Sistema de Abas */
.tabs-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
    width: 100%;
    position: relative;
}

.tabs-nav {
    display: flex;
    background: var(--light-color);
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
}

.tab-btn.active {
    background: white;
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

.tab-btn svg {
    width: 20px;
    height: 20px;
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* Responsividade para abas */
@media (max-width: 768px) {
    .tabs-nav {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid var(--border-color);
        border-right: none;
    }
    
    .tab-btn.active {
        border-bottom-color: var(--border-color);
        border-right: 3px solid var(--secondary-color);
    }
    
    .tab-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .tab-btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .tab-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .tab-content {
        padding: 1rem;
    }
}

/* Correções de Layout */
html {
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

/* Garantir que não há overflow horizontal */
body, html {
    max-width: 100%;
    overflow-x: hidden;
}

/* Print styles */
@media print {
    .header,
    .footer,
    .btn,
    .tabs-nav {
        display: none;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        background: white;
    }
}
