/* ============================================
   MeetMe – style.css
   ============================================ */


*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; width: 100%; }

:root {
  --pink:       #e8335a;
  --pink-light: #fde8ed;
  --pink-dark:  #c0284a;
  --gray-bg:    #f6f7fb;
  --gray-border:#e4e4e4;
  --text:       #222;
  --text-muted: #888;
  --white:      #fff;
  --green:      #2ecc71;
  --radius:     12px;
  --radius-sm:  8px;
}

body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--gray-bg); color: var(--text); font-size: 15px; }
a { text-decoration: none; color: inherit; }
input, select, textarea, button { font-family: inherit; }

/* -- NAVBAR -- */
.navbar {
  background: var(--white); border-bottom: 1px solid var(--gray-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 60px; position: sticky; top: 0; z-index: 100;
}
.navbar-logo { font-size: 22px; font-weight: 700; color: var(--pink); display: flex; align-items: center; gap: 8px; }
.navbar-links { display: flex; align-items: center; gap: 24px; }
.navbar-links a { font-size: 14px; color: var(--text-muted); transition: color .15s; }
.navbar-links a:hover, .navbar-links a.active { color: var(--pink); font-weight: 600; }
.navbar-auth { display: flex; gap: 10px; align-items: center; }
.nav-username { font-size: 14px; color: var(--text-muted); }
.btn-login { border: 1.5px solid var(--pink); color: var(--pink); background: transparent; border-radius: 20px; padding: 7px 20px; font-size: 13px; cursor: pointer; transition: background .15s; }
.btn-login:hover { background: var(--pink-light); }
.btn-register { background: var(--pink); color: var(--white); border: none; border-radius: 20px; padding: 8px 20px; font-size: 13px; cursor: pointer; transition: background .15s; }
.btn-register:hover { background: var(--pink-dark); }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--pink); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 10px; padding: 0 4px;
  margin-left: 4px; vertical-align: middle;
}

/* -- HERO -- */
.hero { background: linear-gradient(135deg, #e8335a 0%, #ff6b6b 100%); padding: 60px 28px 50px; text-align: center; }
.hero h1 { color: #fff; font-size: 36px; font-weight: 700; margin-bottom: 14px; }
.hero p { color: rgba(255,255,255,.88); font-size: 17px; margin-bottom: 32px; }
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-hero-main { background: #fff; color: var(--pink); border: none; border-radius: 30px; padding: 13px 32px; font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .1s; }
.btn-hero-main:hover { transform: scale(1.03); }
.btn-hero-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.7); border-radius: 30px; padding: 13px 32px; font-size: 15px; cursor: pointer; }
.btn-hero-outline:hover { border-color: #fff; }

/* -- STATS -- */
.stats { background: var(--white); display: flex; border-bottom: 1px solid var(--gray-border); }
.stat-item { flex: 1; padding: 16px 12px; text-align: center; border-right: 1px solid var(--gray-border); }
.stat-item:last-child { border-right: none; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--pink); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* -- SEARCHBAR -- */
.searchbar { background: var(--white); padding: 14px 28px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--gray-border); }
.searchbar select, .searchbar input[type="text"] { border: 1px solid var(--gray-border); border-radius: var(--radius-sm); padding: 9px 14px; font-size: 14px; color: var(--text); background: var(--gray-bg); outline: none; }
.searchbar select:focus, .searchbar input:focus { border-color: var(--pink); }
.searchbar input[type="text"] { flex: 1; min-width: 160px; }
.btn-search { background: var(--pink); color: #fff; border: none; border-radius: var(--radius-sm); padding: 9px 22px; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.btn-search:hover { background: var(--pink-dark); }

/* -- LAYOUT -- */
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 250px); }
.profil-page { max-width: 860px; margin: 32px auto; padding: 0 20px; min-height: calc(100vh - 200px); }
.matches-page, .auth-page { min-height: calc(100vh - 200px); }

/* -- SIDEBAR -- */
.sidebar { background: var(--white); border-right: 1px solid var(--gray-border); padding: 22px 18px; }
.sidebar-title { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: .7px; text-transform: uppercase; margin-bottom: 16px; }
.filter-group { margin-bottom: 20px; }
.filter-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.filter-group select { width: 100%; border: 1px solid var(--gray-border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; color: var(--text); background: var(--gray-bg); outline: none; }
.filter-group select:focus { border-color: var(--pink); }
.filter-group input[type="range"] { width: 100%; accent-color: var(--pink); margin-top: 4px; }
.range-display { font-size: 12px; color: var(--text-muted); text-align: right; margin-top: 2px; }
.btn-filter { width: 100%; background: var(--pink); color: #fff; border: none; border-radius: var(--radius-sm); padding: 10px; font-size: 14px; cursor: pointer; margin-top: 6px; }
.btn-filter:hover { background: var(--pink-dark); }
.sidebar-divider { border: none; border-top: 1px solid var(--gray-border); margin: 20px 0; }
.online-users { display: flex; flex-direction: column; gap: 12px; }
.online-user { display: flex; align-items: center; gap: 10px; }
.avatar-sm { width: 38px; height: 38px; border-radius: 50%; background: var(--pink-light); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; overflow: hidden; }
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.online-user-info .name { font-size: 13px; font-weight: 600; }
.online-user-info .time { font-size: 11px; color: var(--text-muted); }
.online-badge { width: 9px; height: 9px; background: var(--green); border-radius: 50%; border: 2px solid #fff; margin-left: auto; flex-shrink: 0; }

/* -- PROFILE CARDS -- */
.profiles { padding: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; align-content: start; }
.profile-card { background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .15s; cursor: pointer; }
.profile-card:hover { box-shadow: 0 6px 24px rgba(232,51,90,.12); transform: translateY(-2px); }
.card-photo { height: 170px; position: relative; overflow: hidden; background: var(--pink-light); display: flex; align-items: center; justify-content: center; font-size: 56px; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.online-dot { position: absolute; top: 10px; right: 10px; width: 11px; height: 11px; background: var(--green); border-radius: 50%; border: 2px solid #fff; }
.new-badge { position: absolute; top: 10px; left: 10px; background: var(--pink); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.card-body { padding: 13px 14px 14px; }
.card-name { font-size: 15px; font-weight: 700; }
.card-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.card-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11px; background: var(--pink-light); color: var(--pink); border-radius: 10px; padding: 2px 9px; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; }
.btn-like { flex: 1; background: var(--pink); color: #fff; border: none; border-radius: 20px; padding: 7px 0; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; }
.btn-like:hover { background: var(--pink-dark); }
.btn-msg { flex: 1; background: var(--gray-bg); color: var(--text); border: 1px solid var(--gray-border); border-radius: 20px; padding: 7px 0; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; }
.btn-msg:hover { background: #ececec; }

/* -- PAGINATION -- */
.pagination { display: flex; justify-content: center; gap: 8px; padding: 24px; grid-column: 1 / -1; }
.page-btn { border: 1px solid var(--gray-border); background: var(--white); color: var(--text); border-radius: var(--radius-sm); padding: 7px 14px; font-size: 14px; cursor: pointer; }
.page-btn:hover, .page-btn.active { background: var(--pink); color: #fff; border-color: var(--pink); }

/* -- AUTH FORMS -- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-box { background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 420px; }
.auth-box h1 { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.auth-box .subtitle { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; border: 1px solid var(--gray-border); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 14px; color: var(--text); background: var(--gray-bg); outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--pink); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn-submit { width: 100%; background: var(--pink); color: #fff; border: none; border-radius: 25px; padding: 12px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 8px; }
.btn-submit:hover { background: var(--pink-dark); }
.auth-link { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.auth-link a { color: var(--pink); font-weight: 600; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; }
.alert-error { background: #fde8ed; color: #c0284a; border: 1px solid #f5b8c8; }
.alert-success { background: #e8fdf0; color: #1a7a3c; border: 1px solid #a0e0bc; }

/* -- PROFIL -- */
.profil-page { max-width: 860px; margin: 32px auto; padding: 0 20px; }
.profil-header { background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius); padding: 28px; display: flex; gap: 28px; align-items: flex-start; margin-bottom: 20px; }
.profil-foto { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 3px solid var(--pink-light); flex-shrink: 0; }
.profil-foto-placeholder { width: 110px; height: 110px; border-radius: 50%; background: var(--pink-light); display: flex; align-items: center; justify-content: center; font-size: 48px; flex-shrink: 0; }
.profil-info h2 { font-size: 24px; font-weight: 700; }
.profil-info .meta { color: var(--text-muted); font-size: 14px; margin-top: 6px; }
.profil-info .bio { margin-top: 10px; font-size: 15px; }
.profil-info .tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.profil-edit-btn { margin-top: 14px; background: var(--pink); color: #fff; border: none; border-radius: 20px; padding: 8px 22px; font-size: 14px; cursor: pointer; }
.profil-section { background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.profil-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; border-bottom: 1px solid var(--gray-border); padding-bottom: 10px; }
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.foto-item { height: 120px; border-radius: var(--radius-sm); overflow: hidden; background: var(--pink-light); display: flex; align-items: center; justify-content: center; font-size: 32px; cursor: pointer; }
.foto-item img { width: 100%; height: 100%; object-fit: cover; }
.foto-add { border: 2px dashed var(--gray-border); color: var(--text-muted); font-size: 28px; }
.foto-add:hover { border-color: var(--pink); color: var(--pink); }

/* -- CHAT -- */
body:has(.chat-page) footer { display: none; }
body:has(.chat-page) { overflow: hidden; }

.chat-page {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.chat-list {
  background: var(--white);
  border-right: 1px solid var(--gray-border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.chat-list-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--gray-border);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.chat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--gray-border);
  cursor: pointer; transition: background .1s;
}
.chat-item:hover, .chat-item.active { background: var(--pink-light); }
.chat-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--gray-bg); display: flex; align-items: center;
  justify-content: center; font-size: 22px; flex-shrink: 0;
  overflow: hidden; position: relative;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-item-info .name { font-size: 14px; font-weight: 700; }
.chat-item-info .preview {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px;
}
.chat-item-time { font-size: 11px; color: var(--text-muted); margin-left: auto; flex-shrink: 0; }
.unread-badge {
  background: var(--pink); color: #fff; border-radius: 50%;
  width: 18px; height: 18px; font-size: 10px;
  display: flex; align-items: center; justify-content: center; margin-left: auto;
}

.chat-window {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--gray-bg);
}
.chat-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-border);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.chat-header .name { font-size: 16px; font-weight: 700; }
.chat-header .status { font-size: 12px; color: var(--green); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.message { max-width: 65%; }
.message.me { align-self: flex-end; }
.message.them { align-self: flex-start; }
.message-bubble { padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.5; }
.message.me .message-bubble { background: var(--pink); color: #fff; border-bottom-right-radius: 4px; }
.message.them .message-bubble { background: var(--white); color: var(--text); border: 1px solid var(--gray-border); border-bottom-left-radius: 4px; }
.message-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-align: right; }

.chat-input-bar {
  flex-shrink: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-border);
  padding: 14px 20px;
  display: flex; gap: 10px; align-items: center;
}
.chat-input {
  flex: 1; border: 1px solid var(--gray-border);
  border-radius: 25px; padding: 10px 18px;
  font-size: 14px; outline: none; background: var(--gray-bg);
}
.chat-input:focus { border-color: var(--pink); }
.btn-send {
  background: var(--pink); color: #fff; border: none;
  border-radius: 50%; width: 42px; height: 42px;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-send:hover { background: var(--pink-dark); }

/* -- MATCHES -- */
.matches-page { max-width: 960px; margin: 32px auto; padding: 0 20px; }
.matches-page h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.matches-page .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.matches-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.match-card { background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius); overflow: hidden; text-align: center; cursor: pointer; transition: transform .15s; }
.match-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(232,51,90,.12); }
.match-photo { height: 150px; background: var(--pink-light); display: flex; align-items: center; justify-content: center; font-size: 52px; overflow: hidden; }
.match-photo img { width: 100%; height: 100%; object-fit: cover; }
.match-info { padding: 12px; }
.match-name { font-size: 14px; font-weight: 700; }
.match-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.match-btn { display: block; margin: 10px auto 0; background: var(--pink); color: #fff; border: none; border-radius: 20px; padding: 6px 18px; font-size: 13px; cursor: pointer; }
.match-btn:hover { background: var(--pink-dark); }
.no-matches { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.no-matches i { font-size: 48px; color: var(--pink-light); display: block; margin-bottom: 16px; }

/* -- FOOTER -- */
footer { background: #222; color: #aaa; padding: 30px 28px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; font-size: 13px; }
.footer-logo { color: var(--pink); font-weight: 700; font-size: 18px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: #aaa; }
.footer-links a:hover { color: #fff; }

/* -- RESPONSIVE -- */
@media (max-width: 900px) {
  .chat-page { grid-template-columns: 1fr; }
  .chat-list { display: none; }
}
.nav-mobile-only { display: none; }

@media (max-width: 768px) {
  .layout { display: flex; flex-direction: column; }
  .sidebar { display: block; width: 100%; border-right: none; border-bottom: 1px solid #e4e4e4; padding: 16px; }
  .navbar { flex-wrap: wrap; padding: 0 16px; position: relative; }
  .navbar-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid #e4e4e4;
    background: #fff;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
  }
  .navbar-links.open { display: flex; }
  .navbar-links a { padding: 14px 20px; font-size: 15px; border-bottom: 1px solid #f0f0f0; color: #222; }
  .navbar-links a.active { color: #e8335a; font-weight: 600; }
  .nav-mobile-only { display: block; }
  .navbar-auth { display: none; }
  .hero h1 { font-size: 24px; }
  .stats { flex-wrap: wrap; }
  .stat-item { min-width: 50%; }
  .profil-header { flex-direction: column; align-items: center; text-align: center; }
  .profil-section { padding: 16px; }
  .profil-page { padding: 0 12px; }
  .form-row { grid-template-columns: 1fr; }
  .matches-page { padding: 0 12px; }
}