/* ==========================================================
   NexaMatch — style.css (v2)
   Fundo aurora animado, menu com ícones, glassmorphism.
   Mantém todas as classes e IDs do HTML/JS originais.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;700&display=swap');

/* ---------- Variáveis ---------- */
:root {
    --bg-color: #060713;
    --card-bg: rgba(20, 24, 46, 0.62);
    --surface-solid: #0e1226;

    --text-main: #f1f2ff;
    --text-muted: #a3abcc;

    --cyan: #2de2f5;
    --violet: #8b5cf6;
    --pink: #ff4fa3;
    --gold: #ffc857;

    --grad-brand: linear-gradient(135deg, #2de2f5 0%, #8b5cf6 55%, #ff4fa3 100%);
    --grad-soft: linear-gradient(135deg, rgba(45, 226, 245, 0.16), rgba(139, 92, 246, 0.16));

    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.18);
    --shadow-lg: 0 24px 50px -18px rgba(0, 0, 0, 0.75);
    --glow-violet: 0 0 34px rgba(139, 92, 246, 0.35);

    --radius: 1.4rem;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
}

/* ---------- Reset ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
}

html {
    scroll-behavior: smooth;
}

/* ---------- Fundo (aurora animada) ---------- */
body {
    min-height: 100vh;
    color: var(--text-main);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* Manchas de luz que se movem devagar */
body::before {
    content: "";
    position: fixed;
    inset: -15%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(34rem 34rem at 15% 20%, rgba(139, 92, 246, 0.50), transparent 62%),
        radial-gradient(30rem 30rem at 85% 12%, rgba(45, 226, 245, 0.36), transparent 62%),
        radial-gradient(36rem 36rem at 78% 88%, rgba(255, 79, 163, 0.34), transparent 62%),
        radial-gradient(28rem 28rem at 8% 92%, rgba(45, 226, 245, 0.22), transparent 62%);
    animation: aurora 26s ease-in-out infinite alternate;
}

/* Vinheta suave (sem grade/quadrados) */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 45%, rgba(4, 5, 14, 0.55) 100%);
}

@keyframes aurora {
    0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
    50%  { transform: translate3d(2%, -3%, 0) scale(1.08) rotate(3deg); }
    100% { transform: translate3d(-3%, 2%, 0) scale(1.15) rotate(-3deg); }
}

::selection {
    background: rgba(139, 92, 246, 0.5);
    color: #fff;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--violet), var(--cyan));
    border-radius: 10px;
    border: 2px solid var(--bg-color);
}

/* ---------- Header (só a logo; o menu é flutuante) ---------- */
header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    padding: 1.35rem 2rem;
    background: transparent;
}

/* Logo com ícone de coração */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.logo::before {
    content: "";
    width: 2.1rem;
    height: 2.1rem;
    flex: none;
    border-radius: 0.7rem;
    background:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 2.7 5 6 5c2.1 0 3.5 1.2 4.4 2.5l1.6 2 1.6-2C14.5 6.2 15.9 5 18 5c3.3 0 5.1 3.4 3.6 6.8C19.5 16.4 12 21 12 21z'/></svg>") center / 58% no-repeat,
        var(--grad-brand);
    box-shadow: 0 6px 20px -4px rgba(139, 92, 246, 0.8);
    transform: rotate(-6deg);
    transition: transform 0.3s;
}

.logo:hover::before {
    transform: rotate(6deg) scale(1.08);
}

.logo span {
    margin-left: -0.45rem;
    background: none;
    -webkit-text-fill-color: var(--text-main);
    color: var(--text-main);
    font-weight: 500;
}

/* ---------- Menu flutuante ---------- */
nav {
    position: fixed;
    top: 0.95rem;
    right: 2rem;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.3rem;
    background: rgba(14, 17, 40, 0.65);
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 18px 40px -10px rgba(0, 0, 0, 0.8), 0 0 30px rgba(139, 92, 246, 0.18);
}

nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.6rem 1.1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 999px;
    transition: color 0.25s, background 0.25s, box-shadow 0.3s, transform 0.2s;
}

/* Ícones (herdam a cor do texto) */
nav a::before {
    content: "";
    width: 1.1rem;
    height: 1.1rem;
    flex: none;
    background-color: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
    transition: transform 0.25s;
}

nav a:nth-child(1) { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><polygon points='16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76'/></svg>"); }
nav a:nth-child(2) { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/></svg>"); }
nav a:nth-child(3) { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/></svg>"); }
nav a:nth-child(4) { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>"); }

nav a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

nav a:hover::before {
    transform: translateY(-2px) scale(1.1);
}

nav a.active {
    color: #fff;
    background: var(--grad-brand);
    box-shadow: 0 6px 22px -4px rgba(139, 92, 246, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

nav a:active {
    transform: scale(0.96);
}

/* ---------- Conteúdo principal ---------- */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.75rem 2rem 4rem;
}

.page-content {
    animation: pageIn 0.45s ease-out;
}

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

.page-content h1 {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3.2vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.15;
    background: linear-gradient(90deg, #ffffff 0%, #d4c8ff 55%, #7ee9f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* barrinha de destaque embaixo do título */
.page-content h1::after {
    content: "";
    display: block;
    width: 3.2rem;
    height: 4px;
    margin-top: 0.7rem;
    border-radius: 4px;
    background: var(--grad-brand);
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.7);
}

/* Estados vazios */
.page-content > p {
    display: inline-block;
    margin-top: 1.5rem !important;
    padding: 1.1rem 1.5rem;
    background: var(--card-bg);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ---------- Controles ---------- */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.4rem;
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--card-bg);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%23a3abcc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    color: var(--text-main);
    border: 1px solid var(--border-strong);
    padding: 0.7rem 2.6rem 0.7rem 1.2rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.25s, box-shadow 0.25s;
}

select:hover { border-color: rgba(255, 255, 255, 0.3); }

select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(45, 226, 245, 0.2);
}

select option {
    background: var(--surface-solid);
    color: var(--text-main);
}

/* ---------- Grid e Cards ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.9rem;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-lg);
    transition: transform 0.35s cubic-bezier(.2, .8, .2, 1), box-shadow 0.35s;
    animation: cardIn 0.55s ease-out backwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.19s; }
.card:nth-child(4) { animation-delay: 0.26s; }
.card:nth-child(n+5) { animation-delay: 0.32s; }

@keyframes cardIn {
    from { opacity: 0; transform: translateY(22px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Borda em gradiente no hover */
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1.5px;
    border-radius: inherit;
    background: var(--grad-brand);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
    z-index: 2;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg), var(--glow-violet);
}

.card:hover::before { opacity: 1; }

.card-image-wrapper {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: var(--surface-solid);
}

.card-image-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(6, 7, 19, 0.9) 0%, rgba(6, 7, 19, 0) 50%),
        linear-gradient(135deg, rgba(139, 92, 246, 0.12), transparent 40%);
    pointer-events: none;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.card:hover img { transform: scale(1.09); }

.location-tag {
    position: absolute;
    z-index: 1;
    bottom: 12px;
    left: 12px;
    background: rgba(10, 12, 30, 0.55);
    color: var(--gold);
    padding: 0.32rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.location-tag::before { content: "📍 "; }

.card-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.4rem;
}

.card-info h2 {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
}

.card-info h2 span {
    color: var(--cyan);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
}

.card-info p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.3rem;
    height: 2.6rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ---------- Botões ---------- */
.actions {
    display: flex;
    gap: 0.6rem;
    margin-top: auto;
}

.btn-view {
    flex: 1;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    border: 1px solid var(--border-strong);
    padding: 0.7rem;
    border-radius: 0.9rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.25s, border-color 0.25s, transform 0.15s;
}

.btn-view:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.32);
}

.btn-view:active,
.btn-like:active { transform: scale(0.95); }

.btn-like {
    background: var(--grad-soft);
    border: 1px solid rgba(45, 226, 245, 0.38);
    color: var(--cyan);
    padding: 0.7rem 1.15rem;
    border-radius: 0.9rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.25s;
}

.btn-like:hover {
    background: var(--grad-brand);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 22px -4px rgba(255, 79, 163, 0.65);
    transform: translateY(-2px);
}

.btn-like.liked {
    background: linear-gradient(135deg, #ffc857, #ff9f43);
    border-color: transparent;
    color: #1a1204;
    box-shadow: 0 8px 22px -4px rgba(255, 200, 87, 0.6);
    cursor: not-allowed;
    transform: none;
    animation: pop 0.4s ease;
}

@keyframes pop {
    0%   { transform: scale(0.85); }
    60%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 1rem;
    background: rgba(4, 5, 16, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 1.5rem;
    background: linear-gradient(160deg, rgba(30, 34, 66, 0.96), rgba(12, 14, 34, 0.96));
    border: 1px solid var(--border-strong);
    border-radius: 1.75rem;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9), var(--glow-violet);
    animation: modalFadeIn 0.35s cubic-bezier(.2, .8, .2, 1);
}

.modal-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 2px;
    background: var(--grad-brand);
    border-radius: 0 0 4px 4px;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    z-index: 2;
    width: 2.3rem;
    height: 2.3rem;
    display: grid;
    place-items: center;
    background: rgba(6, 7, 19, 0.6);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: var(--text-main);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background 0.25s, transform 0.25s, border-color 0.25s;
}

.modal-close:hover {
    background: var(--pink);
    border-color: transparent;
    transform: rotate(90deg);
}

.modal-body-img {
    display: block;
    width: 100%;
    height: 360px;
    object-fit: cover;
    border-radius: 1.2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

/* ---------- Acessibilidade ---------- */
a:focus-visible,
button:focus-visible,
select:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- Responsivo ---------- */
/* No celular o menu flutuante vai para a parte de baixo, estilo app */
@media (max-width: 860px) {
    header {
        justify-content: center;
        padding: 1.1rem 1rem;
    }

    nav {
        top: auto;
        right: 0.75rem;
        left: 0.75rem;
        bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
        padding: 0.35rem;
        background: rgba(14, 17, 40, 0.8);
    }

    nav a {
        flex: 1;
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.55rem 0.25rem;
        font-size: 0.68rem;
        text-align: center;
    }

    nav a::before {
        width: 1.25rem;
        height: 1.25rem;
    }

    main {
        padding: 1.25rem 1rem 7rem;
    }

    .controls {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .card-image-wrapper { height: 310px; }

    .modal-body-img { height: 300px; }
}
