/* =====================================================
   AnonymousX — Global Stylesheet
   Theme: Blue-Purple  |  Mobile-first  |  FA icons
   ===================================================== */

/* --- Variables ---------------------------------------- */
:root {
  --primary:       #5b21b6;
  --primary-light: #7c3aed;
  --primary-dark:  #3b0764;
  --accent:        #2563eb;
  --accent-light:  #3b82f6;
  --surface:       #0f0a1e;
  --surface-2:     #1a1030;
  --surface-3:     #251945;
  --border:        rgba(124,58,237,.25);
  --text:          #e2d9f3;
  --text-muted:    #9c8fbb;
  --success:       #10b981;
  --danger:        #ef4444;
  --warning:       #f59e0b;
  --card-shadow:   0 4px 32px rgba(91,33,182,.2);
  --radius:        14px;
  --radius-sm:     8px;
  --transition:    .2s ease;
  --font-body:     'Segoe UI', system-ui, sans-serif;
}

/* --- Reset -------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(91,33,182,.35) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(37,99,235,.15) 0%, transparent 60%);
}
main { flex: 1; }
a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* --- Typography --------------------------------------- */
h1,h2,h3,h4 { font-weight: 700; line-height: 1.2; color: #fff; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.8rem); }
h3 { font-size: 1.1rem; }
p  { color: var(--text-muted); }

/* --- Site Header -------------------------------------- */
.site-header {
  background: rgba(15,10,30,.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  padding: .9rem 1.2rem;
  display: flex; align-items: center; gap: 1rem;
}
.logo {
  font-size: 1.2rem; font-weight: 800;
  color: #fff; text-decoration: none;
  display: flex; align-items: center; gap: .5rem;
}
.logo i { color: var(--primary-light); }
.main-nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.main-nav a {
  padding: .45rem .8rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  color: var(--text-muted); transition: all var(--transition);
  display: flex; align-items: center; gap: .4rem;
}
.main-nav a:hover, .main-nav a.active {
  background: var(--surface-3); color: #fff;
}
.nav-toggle {
  display: none; background: none; border: none;
  color: var(--text); font-size: 1.2rem; cursor: pointer; margin-left: auto;
}

/* --- Site Footer -------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(15,10,30,.6);
  margin-top: 3rem;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 1.5rem 1.2rem;
  display: flex; flex-wrap: wrap; gap: .5rem;
  justify-content: space-between; align-items: center;
  font-size: .8rem; color: var(--text-muted);
}
.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--primary-light); }

/* --- Page Wrapper ------------------------------------- */
.page { max-width: 1100px; margin: 0 auto; padding: 2rem 1.2rem; }
.page--narrow { max-width: 480px; }
.page--medium { max-width: 720px; }

/* --- Hero --------------------------------------------- */
.hero {
  text-align: center; padding: 4rem 1.2rem 3rem;
}
.hero h1 { margin-bottom: 1rem; }
.hero p  { font-size: 1.05rem; max-width: 520px; margin: 0 auto 2rem; }
.hero-badge {
  display: inline-block; margin-bottom: 1.5rem;
  background: rgba(124,58,237,.2); border: 1px solid var(--border);
  padding: .3rem .9rem; border-radius: 99px;
  font-size: .78rem; color: var(--primary-light); letter-spacing: .04em;
}

/* --- Cards -------------------------------------------- */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}
.card + .card { margin-top: 1rem; }
.card__title {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-muted); margin-bottom: .5rem;
}
.card__value {
  font-size: 1.8rem; font-weight: 800; color: #fff;
}

/* --- Stat Grid ---------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1rem;
  text-align: center;
}
.stat-card i { font-size: 1.4rem; color: var(--primary-light); margin-bottom: .5rem; }
.stat-card .val { font-size: 1.5rem; font-weight: 800; color: #fff; }
.stat-card .lbl { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }

/* --- Forms -------------------------------------------- */
.form-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--card-shadow);
}
.form-wrap h2 { margin-bottom: 1.5rem; text-align: center; }
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block; font-size: .82rem;
  color: var(--text-muted); margin-bottom: .4rem; font-weight: 500;
}
input[type=text], input[type=email], input[type=password],
input[type=tel], input[type=file], select, textarea {
  width: 100%; background: var(--surface-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: .75rem 1rem;
  font-size: .95rem; font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(124,58,237,.2);
}
select option { background: var(--surface-2); }
textarea { resize: vertical; min-height: 100px; }
input[type=file] { cursor: pointer; padding: .55rem .8rem; }

/* --- Buttons ------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; padding: .75rem 1.5rem;
  border-radius: var(--radius-sm); font-size: .95rem; font-weight: 600;
  border: none; cursor: pointer; transition: all var(--transition);
  text-decoration: none; font-family: inherit;
}
.btn--primary {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  color: #fff;
}
.btn--primary:hover { opacity: .9; transform: translateY(-1px); color: #fff; }
.btn--outline {
  background: transparent;
  border: 1px solid var(--border); color: var(--text);
}
.btn--outline:hover { background: var(--surface-3); color: #fff; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { opacity: .85; }
.btn--success { background: var(--success); color: #fff; }
.btn--sm { padding: .45rem 1rem; font-size: .82rem; }
.btn--full { width: 100%; }
.btn-group { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }

/* --- Alerts ------------------------------------------- */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: .6rem;
  font-size: .9rem;
}
.alert--success { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }
.alert--error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.alert--info    { background: rgba(37,99,235,.12);  border: 1px solid rgba(37,99,235,.3);  color: #93c5fd; }

/* --- Tables ------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th {
  background: var(--surface-3); color: var(--text-muted);
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  padding: .75rem 1rem; text-align: left; white-space: nowrap;
}
tbody td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border); color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(124,58,237,.05); }

/* --- Badges ------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .6rem; border-radius: 99px;
  font-size: .72rem; font-weight: 600;
}
.badge--green  { background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.3); }
.badge--red    { background: rgba(239,68,68,.15);  color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.badge--purple { background: rgba(124,58,237,.15); color: #c4b5fd; border: 1px solid rgba(124,58,237,.3); }
.badge--blue   { background: rgba(37,99,235,.15);  color: #93c5fd; border: 1px solid rgba(37,99,235,.3); }

/* --- Profile pic -------------------------------------- */
.avatar {
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--primary-light);
}
.avatar--sm  { width: 36px; height: 36px; }
.avatar--md  { width: 64px; height: 64px; }
.avatar--lg  { width: 96px; height: 96px; }

/* --- Message cards ------------------------------------ */
.msg-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  margin-bottom: .85rem;
  transition: border-color var(--transition);
}
.msg-card:hover { border-color: var(--primary-light); }
.msg-card__meta {
  font-size: .75rem; color: var(--text-muted);
  margin-bottom: .6rem;
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.msg-card__body { color: var(--text); font-size: .95rem; line-height: 1.6; }
.msg-card__img  { margin-top: .75rem; border-radius: var(--radius-sm); max-height: 300px; object-fit: contain; }

/* --- Share box ---------------------------------------- */
.share-box {
  background: var(--surface-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  display: flex; align-items: center; gap: .75rem;
  margin: 1rem 0;
}
.share-box input {
  flex: 1; background: none; border: none;
  color: var(--text-muted); font-size: .85rem;
  outline: none; padding: 0;
}
.share-box .btn { flex-shrink: 0; }

/* --- Pagination --------------------------------------- */
.pagination {
  display: flex; flex-wrap: wrap; gap: .4rem;
  justify-content: center; margin-top: 2rem;
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); transition: all var(--transition);
}
.pagination a:hover, .pagination span.current {
  background: var(--primary-light); border-color: var(--primary-light); color: #fff;
}

/* --- Divider ------------------------------------------ */
.divider {
  border: none; border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* --- Send page profile preview ------------------------ */
.send-profile {
  text-align: center; padding: 2rem 1rem;
}
.send-profile .avatar { margin: 0 auto 1rem; }
.send-profile h2 { margin-bottom: .25rem; }
.send-profile p  { font-size: .9rem; }

/* --- Admin sidebar ------------------------------------ */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 1.5rem 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar .logo { padding: 0 1.2rem 1.5rem; }
.admin-sidebar nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .7rem 1.2rem; color: var(--text-muted);
  font-size: .88rem; font-weight: 500;
  transition: all var(--transition);
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  background: var(--surface-3); color: #fff;
  border-left: 3px solid var(--primary-light);
}
.admin-main { flex: 1; padding: 2rem; overflow-x: hidden; }
.admin-topbar {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 2rem;
}

/* --- Responsive --------------------------------------- */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none; flex-direction: column;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    gap: .25rem;
  }
  .main-nav.open { display: flex; }
  .main-nav a { width: 100%; justify-content: flex-start; }
  .admin-sidebar { display: none; }
  .admin-main { padding: 1rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .btn-group { flex-direction: column; }
}

/* --- Utility ------------------------------------------ */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning{ color: var(--warning); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: .5rem; }
.d-flex { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none; }
