/* ===== DARK THEME DESIGN TOKENS ===== */
:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a25;
    --bg-input: #16161f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --border: #2a2a3a;
    --accent: #4a9eff;
    --accent-hover: #6cb0ff;
    --radius: 0.625rem;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* p span, div span, li {
    color: var(--text-secondary) !important;
} */

body.modal-open { overflow: hidden; }

/* ===== TOP MENU ===== */
.top-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: transparent;
    padding: 1rem 2rem;
    transition: background 0.3s, backdrop-filter 0.3s;
}

.top-menu.scrolled {
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.menu-content {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.menu-links {
    display: flex;
    gap: 2rem;
}

.menu-link {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.menu-link:hover { opacity: 1; }

.menu-link-icon {
    display: inline-flex;
    align-items: center;
}

/* ===== MOSAIC HEADER ===== */
.site-header {
    position: relative;
    height: 480px;
    overflow: hidden;
}

.mosaic-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 0 0 1.5rem 1.5rem;
    overflow: hidden;
}

.mosaic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
    height: 100%;
}

.mosaic-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
    border-radius: 0 0 1.5rem 1.5rem;
    pointer-events: none;
}

.mosaic-item {
    border-radius: 0.75rem;
    overflow: hidden;
    background: #1a1a2e;
    min-width: 0;
    min-height: 0;
    opacity: 0.4;
    will-change: transform;
    animation: mosaicPulse 4s ease-in-out infinite;
}

.mosaic-item:nth-child(1) { animation-delay: 0s; }
.mosaic-item:nth-child(2) { animation-delay: -0.5s; }
.mosaic-item:nth-child(3) { animation-delay: -1s; }
.mosaic-item:nth-child(4) { animation-delay: -1.5s; }
.mosaic-item:nth-child(5) { animation-delay: -0.3s; }
.mosaic-item:nth-child(6) { animation-delay: -0.8s; }
.mosaic-item:nth-child(7) { animation-delay: -1.3s; }
.mosaic-item:nth-child(8) { animation-delay: -1.8s; }

.mosaic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.3s;
    display: block;
}

.mosaic-item:hover img { opacity: 0.8; }

@keyframes mosaicPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0; }
}

/* ===== HEADER OVERLAY ===== */
.header-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 2rem;
}

.header-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    text-align: center;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    text-shadow: 0 2px 30px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.title-highlight {
    color: var(--accent);
    text-shadow: 0 2px 30px rgba(0,0,0,0.7), 0 0 12px rgba(0,0,0,0.5);
}

.title-sub {
    font-size: 1.75rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 20px rgba(0,0,0,0.7), 0 0 8px rgba(0,0,0,0.5);
}

/* ===== SEARCH ===== */
.search-wrapper {
    width: 100%;
    max-width: 36rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--radius);
    border: 2px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    color: white;
    box-shadow: var(--shadow);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.search-input::placeholder { color: rgba(255,255,255,0.5); }

.search-input:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.15);
}

/* ===== GRADIENT FADE ===== */
.gradient-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--bg-dark) 0%, transparent 100%);
    z-index: 5;
    pointer-events: none;
}

/* ===== SEARCH LOADING ===== */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius);
    animation: fadeIn 0.2s ease;
    width: fit-content;
    margin: 0.5rem auto 0;
}
.search-loading.hidden { display: none; }
.loading-icon-sm { width: 0.875rem; height: 0.875rem; animation: spin 1s linear infinite; display: inline-block; }

.vagas-total {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
    text-shadow: 0 1px 12px rgba(0,0,0,0.6);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== LAYOUT ===== */
main {
    max-width: 48rem;
    margin: -2rem auto 0;
    padding: 0 1rem 4rem;
    position: relative;
    z-index: 20;
}

#vagas-container { width: 100%; }

#results-info {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.sentinel { height: 1px; }

/* ===== CARD ===== */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(74, 158, 255, 0.3);
    transform: translateY(-2px);
}

.card-inner {
    display: flex;
    position: relative;
}

.card-accent {
    width: 4px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--accent) 0%, rgba(74, 158, 255, 0.3) 100%);
}

.card-body {
    flex: 1;
    padding: 1.25rem 1.5rem;
    min-width: 0;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.card-header-info { min-width: 0; flex: 1; }

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.125rem;
}

.card-company {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.625rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    border-radius: 9999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-remote {
    background-color: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.badge-hybrid {
    background-color: rgba(74, 158, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(74, 158, 255, 0.25);
}

.badge-on-site {
    background-color: rgba(251, 191, 36, 0.1);
    color: #fbb024;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

/* ===== INFO ROW & BLOCKS ===== */
.card-info-row {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

.card-info-block {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-input);
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid var(--border);
    min-width: 0;
}

.card-info-icon { width: 1rem; height: 1rem; flex-shrink: 0; color: var(--accent); opacity: 0.8; }

.card-info-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== RESUMO ===== */
.card-resumo {
    font-size: 0.875rem;
    line-height: 1.625;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== CARD FOOTER ===== */
.card-footer {
    display: flex;
    align-items: center;
    padding-top: 0.875rem;
    border-top: 1px solid var(--border);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    height: 2.25rem;
    padding: 0 1rem;
    border-radius: calc(var(--radius) - 2px);
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: all 0.15s;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-icon { width: 1rem; height: 1rem; flex-shrink: 0; }

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
    background-color: transparent;
    color: var(--accent);
    border-color: rgba(74, 158, 255, 0.2);
    box-shadow: none;
}

.btn-ghost:hover { background-color: rgba(74, 158, 255, 0.06); }

.btn-lg { height: 2.75rem; padding: 0 1.5rem; font-size: 1rem; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.hidden { display: none; }

.modal-content {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 48rem;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    line-height: 1.3;
}

.modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    flex-shrink: 0;
    margin-left: 1rem;
}

.modal-close:hover { background-color: var(--bg-input); color: var(--text-primary); }

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.modal-body a { color: var(--accent); text-decoration: underline; }
.modal-body ul, .modal-body ol { padding-left: 1.5rem; margin: 0.5rem 0; }
.modal-body li { margin-bottom: 0.25rem; }
.modal-body p { margin-bottom: 0.75rem; }
.modal-body strong { font-weight: 600; color: var(--text-primary); }

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    background-color: var(--bg-input);
}

.modal-footer.hidden { display: none; }

/* ===== LOADING ===== */
.loading {
    text-align: center;
    padding: 0.75rem 1.25rem;
    color: var(--accent);
    font-size: 0.875rem;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius);
    width: fit-content;
    margin: 0 auto;
}
.loading.hidden { display: none; }
.loading-icon { width: 1.25rem; height: 1.25rem; margin-right: 0.5rem; vertical-align: text-bottom; animation: spin 1s linear infinite; display: inline-block; }

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

/* ===== RESPONSIVE ===== */
@media (max-width: 40rem) {
    .top-menu { padding: 0.75rem 1rem; }
    .site-header { height: 440px; }
    .header-title { font-size: 2.25rem; }
    .title-sub { font-size: 1.25rem; }
    .mosaic-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 1fr); }
    .menu-links { gap: 1rem; }
    .search-input { padding: 0.875rem 1rem; font-size: 0.9375rem; }
    .card-body { padding: 1rem 1.25rem; }
    .card-title { font-size: 1rem; }
    .card-header { flex-direction: column; gap: 0.5rem; }
    .card-info-row { flex-direction: column; gap: 0.5rem; }
    .card-info-text { white-space: normal; }
    .card-footer { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .modal-content { max-width: calc(100vw - 2rem); }
    .modal-header { padding: 1rem; }
    .modal-body { padding: 1rem; }
    .modal-footer { padding: 1rem; }
}

@media (max-width: 30rem) {
    .site-header { height: 380px; }
    .header-title { font-size: 1.75rem; }
    .title-sub { font-size: 1.125rem; }
    .header-overlay { padding: 1rem; }
    .mosaic-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 1fr); gap: 0.25rem; padding: 0.25rem; }
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 50;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s, transform 0.3s;
}

.back-to-top.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.back-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}
