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

html,
body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

p.filter-description {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: .5rem;
    margin-top: -1rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    flex: 1;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fbbf24;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.dashboard-title {
    font-size: 1.2rem;
    font-weight: 600;
}

/* TABS de busca */
.tabs-header {
  display: flex;
  border-bottom: 2px solid #ddd;
  margin-bottom: 14px;
}

.tab-btn {
  background: #f5f5f5;
  border: none;
  color: #333;
  padding: 12px 24px;
  cursor: pointer;
  outline: none;
  font-size: 16px;
}

.tab-btn.active {
  background: #fff;
  border-bottom: 2px solid #3399ff;
  font-weight: bold;
}

.tabs-content .tab-content {
  display: none;
}

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


/* Big Numbers Section */
.big-numbers {
    padding: 1rem;
    background: white;
    margin: 2rem 0;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.number-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
}

.number-card h3 {
    color: #1e40af;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.number-card .big-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #059669;
    margin: 0.5rem 0;
}

.info-icon {
    cursor: help;
    color: #6b7280;
    font-size: 1rem;
}

.tooltip {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 5px;
    font-size: 0.8rem;
    max-width: 250px;
    z-index: 1000;
    display: none;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

/* SISU Specific Styles */
.regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.region-item {
    background: white;
    padding: .5rem 0;
    border-radius: 5px;
    border-left: 4px solid #059669;
    text-align: center;
}

.region-item .region-name {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.region-item .region-vagas {
    font-size: 1.1rem;
    font-weight: bold;
    color: #059669;
}

.lei-vagas {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
}

.lei-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.lei-item {
    background: white;
    padding: 0.75rem;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.lei-item .lei-code {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.lei-item .lei-number {
    font-size: 1.1rem;
    font-weight: bold;
    color: #f59e0b;
}

/* Filters Section */
.filters {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin: 2rem 0;
}

.filters h3 {
    margin-bottom: 1.5rem;
    color: #1e40af;
}

.filters-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-search {
    flex: 2;
    min-width: 300px;
}

.filter-select {
    flex: 1;
    min-width: 150px;
}

.filter-search input,
.filter-select select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 1rem;
}

.filter-search input:focus,
.filter-select select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.submit-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    white-space: nowrap;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-icon {
    font-size: 1.1rem;
}

/* Personal Search Styles */
.personal-search-container {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-top: 1rem;
}

.course-multiselect-container {
    margin-bottom: 2rem;
}

.course-multiselect-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.multiselect-wrapper {
    position: relative;
    width: 100%;
}

.multiselect-input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    min-height: 48px;
}

.multiselect-input:hover {
    border-color: #3b82f6;
}

.multiselect-arrow {
    transition: transform 0.3s ease;
    color: #6b7280;
}

.multiselect-arrow.open {
    transform: rotate(180deg);
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.multiselect-dropdown.open {
    display: block;
}

.multiselect-search {
    padding: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.multiselect-search input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    font-size: 0.9rem;
}

.multiselect-options {
    max-height: 200px;
    overflow-y: auto;
}

.multiselect-option {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.multiselect-option:hover {
    background-color: #f3f4f6;
}

.multiselect-option input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.multiselect-option.hidden {
    display: none;
}

.enem-scores-container {
    margin-bottom: 2rem;
}

.enem-scores-container h4 {
    color: #1e40af;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

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

.score-input {
    display: flex;
    flex-direction: column;
}

.score-input label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.score-input input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 1rem;
    background: white;
}

.score-input input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.personal-search-button {
    text-align: center;
}

.personal-btn {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    white-space: nowrap;
}

.personal-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.personal-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.selected-courses-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.selected-course-tag {
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.remove-course {
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
}

.remove-course:hover {
    color: #fbbf24;
}

/* Results Table */
.results {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin: 2rem 0;
    overflow: hidden;
    display: none;
}

.results h3 {
    padding: 1.5rem;
    margin: 0;
    background: #f8fafc;
    color: #1e40af;
    border-bottom: 1px solid #e5e7eb;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

tr:hover {
    background: #f9fafb;
    cursor: pointer;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.lightbox-content {
    background-color: white;
    margin: 2% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.close:hover {
    color: #000;
}

.lightbox h2 {
    color: #1e40af;
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-item {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 5px;
    border-left: 4px solid #3b82f6;
}

.info-label {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.info-value {
    font-weight: 600;
    color: #1e40af;
}

.notas-table {
    margin: 2rem 0;
}

.notas-table h4 {
    color: #1e40af;
    margin-bottom: 1rem;
}

.vagas-lei-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
    margin-top: 2rem;
}

.vagas-lei-box h4 {
    color: #92400e;
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-search,
    .filter-select {
        flex: none;
        min-width: auto;
    }

    .submit-btn {
        align-self: center;
        margin-top: 1rem;
    }

    .lightbox-content {
        width: 95%;
        margin: 5% auto;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .nav-menu {
        order: 2;
    }

    .dashboard-title {
        order: 1;
        margin-top: 1rem;
    }

    .numbers-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .big-number {
        font-size: 2rem !important;
    }

    .lightbox-content {
        width: 98%;
        margin: 2% auto;
        padding: 1rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .scores-grid {
        grid-template-columns: 1fr;
    }

    .multiselect-dropdown {
        max-height: 250px;
    }

    .personal-search-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .big-numbers,
    .filters,
    .results {
        margin: 1rem 0;
        padding: 1rem;
    }

    th,
    td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .filters-row {
        gap: 0.5rem;
    }

    .submit-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .regions-grid,
    .lei-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Autocomplete Styles */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.autocomplete-suggestions.show {
    display: block;
}

.autocomplete-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: #f3f4f6;
}

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

.autocomplete-item .item-title {
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 0.25rem;
}

.autocomplete-item .item-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
}

.autocomplete-loading {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

.autocomplete-no-results {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}