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

/* styles.css - Estilos gerais do site */
:root {
    --primary-color: #ff4b7b;
    --primary-dark: #e63e6c;
    --accent-color: #ff8a5c;
    --secondary-color: #1f2430;
    --bg-color: #f4f5f8;
    --card-color: #ffffff;
    --text-color: #23262f;
    --muted-color: #6b7280;
    --font-main: "Poppins", "Helvetica Neue", sans-serif;
    --gradient-brand: linear-gradient(135deg, #ff4b7b 0%, #ff8a5c 100%);
    --shadow-soft: 0 8px 24px rgba(31, 36, 48, .08);
    --shadow-card: 0 16px 40px rgba(31, 36, 48, .14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image:
        radial-gradient(1100px 420px at 8% -12%, rgba(255, 75, 123, .10), transparent 62%),
        radial-gradient(950px 380px at 108% 6%, rgba(52, 152, 219, .08), transparent 60%);
    background-repeat: no-repeat;
    padding-bottom: 76px;
    -webkit-font-smoothing: antialiased;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { color: var(--primary-color); }
h2, h3 { color: var(--secondary-color); letter-spacing: -.2px; }
.mt { margin-top: 1rem; }

/* Header */
.header { background: linear-gradient(135deg, #1f2430 0%, #2c3e50 100%); color: #fff; padding: .9rem 0; position: sticky; top: 0; z-index: 45; box-shadow: 0 6px 20px rgba(31, 36, 48, .18); }
.header .container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.logo { font-size: 1.5rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: .55rem; white-space: nowrap; }
.logo i { color: var(--primary-color); }
.header-usuario { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.nav-user { color: #fff; opacity: .85; font-size: .92rem; }
.sair-topo { color: #fff; opacity: .8; font-size: .88rem; text-decoration: none; }
.sair-topo:hover { opacity: 1; text-decoration: underline; }
.avatar-link img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, .7); display: block; transition: border-color .2s ease, transform .2s ease; }
.avatar-link:hover img { border-color: #fff; transform: scale(1.05); }

/* Menu inferior estilo app */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .97); border-top: 1px solid #eceef3; display: flex; justify-content: space-around; align-items: center; padding: .45rem 0 calc(.45rem + env(safe-area-inset-bottom)); z-index: 40; box-shadow: 0 -6px 24px rgba(31, 36, 48, .08); }
.tab { display: flex; flex-direction: column; align-items: center; gap: .15rem; color: #9aa0a6; text-decoration: none; font-size: .7rem; font-weight: 500; padding: .2rem .7rem; border-radius: 12px; transition: color .2s ease; }
.tab i { font-size: 1.25rem; }
.tab:hover { color: #5c6470; }
.tab.active { color: var(--primary-color); }
.tab.active i { filter: drop-shadow(0 3px 6px rgba(255, 75, 123, .35)); }

/* Botões */
.btn-primary { display: inline-block; background: var(--gradient-brand); color: #fff; padding: .8rem 1.5rem; border: none; border-radius: 10px; cursor: pointer; text-decoration: none; text-align: center; font-size: .98rem; font-weight: 600; box-shadow: 0 8px 20px rgba(255, 75, 123, .28); transition: transform .15s ease, box-shadow .15s ease; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(255, 75, 123, .36); }
.btn-primary:active { transform: translateY(0) scale(.98); }
.btn-secondary { display: inline-block; background: var(--secondary-color); color: #fff; padding: .6rem 1.1rem; border: none; border-radius: 10px; cursor: pointer; text-decoration: none; text-align: center; font-size: .93rem; font-weight: 500; transition: background .15s ease, transform .15s ease; }
.btn-secondary:hover { background: #2c3e50; transform: translateY(-1px); }

/* Baralho (Home) */
.swipe-main { padding: 2.2rem 0; }
.swipe-wrap { display: flex; gap: 2rem; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.deck-area { width: 360px; max-width: 100%; }
.deck-card { position: relative; background: var(--card-color); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-card); animation: entrar .35s ease; }
@keyframes entrar { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.deck-card > img { width: 100%; height: 480px; object-fit: cover; display: block; }
.deck-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.2rem 1.4rem 1.3rem; background: linear-gradient(transparent, rgba(15, 17, 24, .88)); color: #fff; }
.deck-info h2 { font-size: 1.6rem; color: #fff; margin-bottom: .2rem; }
.deck-info p { opacity: .92; font-size: .95rem; }
.deck-info .distancia { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); padding: .25rem .6rem; border-radius: 999px; margin-top: .55rem; backdrop-filter: blur(4px); }
.deck-card.vazio > img, .deck-card.vazio .deck-info { display: none; }
.deck-vazio { display: none; padding: 3rem 2rem; text-align: center; }
.deck-card.vazio .deck-vazio { display: block; }
.deck-vazio h3 { margin-bottom: .6rem; }
.deck-vazio p { color: var(--muted-color); margin-bottom: 1rem; }
.deck-acoes { display: flex; gap: 1.1rem; justify-content: center; margin-top: 1.3rem; }
.btn-acao { width: 64px; height: 64px; border-radius: 50%; border: none; font-size: 1.45rem; cursor: pointer; background: #fff; box-shadow: 0 8px 22px rgba(31, 36, 48, .16); display: flex; align-items: center; justify-content: center; transition: transform .15s ease, box-shadow .15s ease; }
.btn-acao:hover:not(:disabled) { transform: scale(1.1) translateY(-2px); box-shadow: 0 12px 26px rgba(31, 36, 48, .22); }
.btn-acao:active:not(:disabled) { transform: scale(.96); }
.btn-acao:disabled { opacity: .4; cursor: default; }
.btn-nao { color: #e74c3c; }
.btn-sim { background: var(--gradient-brand); color: #fff; }
.btn-super { color: #3b82f6; }

/* Painel lateral */
.lateral { width: 300px; max-width: 100%; background: var(--card-color); border-radius: 16px; padding: 1.5rem; box-shadow: var(--shadow-soft); border-top: 4px solid var(--primary-color); }
.lateral h3 { margin-bottom: .5rem; font-size: 1.05rem; }
.lateral p { color: var(--muted-color); margin-bottom: .6rem; font-size: .92rem; }
.lateral hr { border: none; border-top: 1px solid #eceef3; margin: 1.2rem 0; }
.lateral .btn-primary, .lateral .btn-secondary { display: block; width: 100%; }

/* Espaço para anúncio */
.ad-slot { margin-top: 1.3rem; min-height: 250px; border: 2px dashed #d9dde5; border-radius: 14px; display: flex; align-items: center; justify-content: center; text-align: center; color: #9aa0a6; font-size: .75rem; letter-spacing: 1.2px; text-transform: uppercase; background: #fbfbfd; padding: 1rem; }

/* Modal de match */
.match-modal { position: fixed; inset: 0; background: rgba(15, 17, 24, .68); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem; }
.match-modal[hidden] { display: none; }
.match-box { background: var(--card-color); border-radius: 20px; padding: 2rem; text-align: center; width: 100%; max-width: 380px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); animation: entrar .3s ease; }
.match-box h2 { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 2.1rem; margin-bottom: .8rem; }
.match-box img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin: .4rem 0 1rem; border: 4px solid #fff; box-shadow: 0 0 0 4px rgba(255, 75, 123, .2); }
.match-box p { margin-bottom: 1.2rem; color: var(--muted-color); }
.match-box p strong { color: var(--text-color); }
.match-box .btn-primary, .match-box .btn-secondary { display: block; width: 100%; margin-top: .6rem; }

/* Formulários (Login/Registro/Preferências/Edição) */
.login-section, .registro-section, .prefs-section { padding: 2.2rem 0; }
.login-section .container, .registro-section .container, .prefs-section .container { max-width: 520px; }
.login-section h2, .registro-section h2, .prefs-section h2 { margin-bottom: 1rem; }
#login-form, #registro-form, #prefs-form { background: var(--card-color); padding: 1.6rem; border-radius: 16px; box-shadow: var(--shadow-soft); }
#login-form label, #registro-form label, #prefs-form label, #editar-form label { display: block; margin: .9rem 0 .35rem; font-weight: 600; font-size: .9rem; }
#login-form input, #registro-form input, #registro-form select, #registro-form textarea,
#prefs-form input, #prefs-form select { width: 100%; padding: .65rem .8rem; border: 1px solid #d9dde5; border-radius: 10px; font-family: inherit; font-size: 1rem; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(255, 75, 123, .14); }
#prefs-form input[type="range"] { padding: 0; border: none; appearance: none; -webkit-appearance: none; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--primary-color), var(--accent-color)); cursor: pointer; box-shadow: none; }
#prefs-form input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--primary-color); box-shadow: 0 2px 8px rgba(0, 0, 0, .22); cursor: pointer; }
#prefs-form input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--primary-color); box-shadow: 0 2px 8px rgba(0, 0, 0, .22); cursor: pointer; }
#login-form .btn-primary, #registro-form .btn-primary, #prefs-form .btn-primary { margin-top: 1.1rem; width: 100%; }
#prefs-form .btn-secondary { width: 100%; }
.aviso-sessao { background: #fff3cd; border: 1px solid #ffe08a; padding: .8rem; border-radius: 10px; margin-bottom: 1rem; font-size: .92rem; }
.aviso-sessao a { color: var(--primary-color); font-weight: 600; }

/* Perfil */
.perfil-section { padding: 2.2rem 0; }
.perfil-section h2 { margin-bottom: 1rem; }
.perfil-card { background: linear-gradient(180deg, rgba(255, 75, 123, .07), rgba(255, 255, 255, 0) 45%), var(--card-color); border-radius: 16px; padding: 1.8rem 1.5rem; text-align: center; margin-bottom: 2rem; box-shadow: var(--shadow-soft); }
.perfil-card img { width: 150px; height: 150px; object-fit: cover; border-radius: 50%; margin-bottom: .6rem; border: 4px solid #fff; box-shadow: 0 0 0 4px rgba(255, 75, 123, .18); }
.perfil-acoes { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: .9rem; }
.perfil-section .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.perfil-section .card { background: var(--card-color); border-radius: 14px; overflow: hidden; text-align: center; padding-bottom: 1rem; box-shadow: var(--shadow-soft); }
.perfil-section .card img { width: 100%; height: 220px; object-fit: cover; transition: transform .25s ease; }
.perfil-section .card:hover img { transform: scale(1.04); }
.card-foto { position: relative; }
.card-foto .remover-foto { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(15, 17, 24, .62); color: #fff; cursor: pointer; font-size: .9rem; transition: background .15s ease; }
.card-foto .remover-foto:hover { background: rgba(15, 17, 24, .9); }
.fotos-vazio { color: var(--muted-color); font-size: .92rem; }
.editar-card { background: var(--card-color); border-radius: 16px; padding: 1.6rem; margin-bottom: 2rem; box-shadow: var(--shadow-soft); }
.editar-card h3 { margin-bottom: .5rem; }
#editar-form input[type="text"], #editar-form textarea { width: 100%; padding: .65rem .8rem; border: 1px solid #d9dde5; border-radius: 10px; font-family: inherit; font-size: 1rem; transition: border-color .15s ease, box-shadow .15s ease; }
#editar-form input[type="file"] { display: block; margin-top: .3rem; font-size: .9rem; }
#editar-form small { display: block; color: var(--muted-color); margin-top: .35rem; font-size: .8rem; }
#editar-form .btn-primary { margin-top: 1rem; width: 100%; }
#editar-form .btn-secondary { margin-top: .5rem; width: 100%; }
.preview-fotos { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; }
.preview-item { position: relative; }
.preview-item img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; display: block; box-shadow: 0 4px 12px rgba(31, 36, 48, .15); }
.preview-remover { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: #e74c3c; color: #fff; cursor: pointer; font-size: .85rem; line-height: 1; }

/* Chat */
.chat-section { padding: 2.2rem 0; }
.chat-section h2 { margin-bottom: 1rem; }
.chat-window { background: var(--card-color); border-radius: 16px; min-height: 520px; display: grid; grid-template-columns: 280px 1fr; overflow: hidden; box-shadow: var(--shadow-soft); }
.lista-conversas { border-right: 1px solid #eceef3; overflow-y: auto; max-height: 640px; }
.conversa-item { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; cursor: pointer; border-bottom: 1px solid #f4f5f8; border-left: 3px solid transparent; transition: background .15s ease; }
.conversa-item:hover { background: #fafafc; }
.conversa-item.ativa { background: #fff0f5; border-left-color: var(--primary-color); }
.conversa-item img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(31, 36, 48, .12); }
.conversa-item strong { display: block; font-size: .93rem; font-weight: 600; }
.conversa-item span { font-size: .78rem; color: var(--muted-color); }
.chat-vazio-lista { padding: 1rem; color: var(--muted-color); font-size: .9rem; }
.janela-mensagem { display: flex; flex-direction: column; min-height: 520px; background: linear-gradient(180deg, #fbfbfd 0%, #ffffff 100%); }
.janela-cabecalho { padding: .8rem 1rem; border-bottom: 1px solid #eceef3; display: flex; align-items: center; gap: .6rem; background: #fff; }
.janela-cabecalho img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.mensagens { flex: 1; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; overflow-y: auto; max-height: 430px; }
.msg { max-width: 72%; padding: .6rem .9rem; border-radius: 16px; font-size: .95rem; word-wrap: break-word; box-shadow: 0 2px 8px rgba(31, 36, 48, .06); }
.msg.eu { align-self: flex-end; background: var(--gradient-brand); color: #fff; border-bottom-right-radius: 6px; }
.msg.ele { align-self: flex-start; background: #fff; border: 1px solid #eceef3; border-bottom-left-radius: 6px; }
.msg-hora { display: block; font-size: .68rem; opacity: .7; margin-top: .2rem; }
.chat-form { display: flex; gap: .5rem; padding: .8rem; border-top: 1px solid #eceef3; background: #fff; }
.chat-form input { flex: 1; padding: .7rem 1rem; border: 1px solid #d9dde5; border-radius: 999px; font-family: inherit; font-size: .98rem; transition: border-color .15s ease, box-shadow .15s ease; }
.chat-form button { width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--gradient-brand); color: #fff; cursor: pointer; font-size: 1rem; box-shadow: 0 6px 16px rgba(255, 75, 123, .3); transition: transform .15s ease; }
.chat-form button:hover { transform: scale(1.06); }
.chat-form button:active { transform: scale(.95); }
.chat-vazio { padding: 2rem; text-align: center; color: var(--muted-color); }

/* Footer */
.footer { background: var(--secondary-color); color: #fff; padding: 1.2rem 0; margin-top: 2rem; }
.footer .container { display: flex; justify-content: space-between; align-items: center; }
.footer p { margin: .5rem 0; font-size: .88rem; opacity: .85; }
.footer a { color: #fff; text-decoration: none; opacity: .85; }
.footer a:hover { opacity: 1; text-decoration: underline; }

@media (max-width: 768px) {
    .swipe-wrap { flex-direction: column; align-items: center; }
    .deck-area, .lateral { width: 100%; max-width: 380px; }
    .deck-card > img { height: 420px; }
    .chat-window { grid-template-columns: 1fr; }
    .lista-conversas { border-right: none; border-bottom: 1px solid #eceef3; max-height: 200px; }
    .perfil-section .grid { grid-template-columns: 1fr; }
    .footer .container { flex-direction: column; text-align: center; }
    .tab { font-size: .62rem; padding: .2rem .45rem; }
    .header-usuario { gap: .6rem; }
    .nav-user { display: none; }
}
