@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

:root {
  --bg: #07111e;
  --surface: rgba(10, 19, 34, 0.94);
  --surface-soft: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f4f7fb;
  --muted: #a7b3c8;
  --primary: #66d1ff;
  --primary-strong: #31c2ff;
  --success: #31d67d;
  --danger: #ff6577;
  --warning: #ffcc66;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Cairo", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(70, 155, 255, 0.18), transparent 24%),
    radial-gradient(circle at top left, rgba(0, 221, 255, 0.1), transparent 22%),
    linear-gradient(180deg, #07101c 0%, #08111f 100%);
  min-height: 100vh;
  line-height: 1.75;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 12, 22, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 82px;
  gap: 18px;
}

.brand {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  font-weight: 700;
  transition: 0.2s ease;
}

.nav-link:hover {
  color: #fff;
}

.nav-link.active {
  color: var(--primary);
  font-weight: 900;
  border-bottom-color: var(--primary);
}

.auth-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 800;
  color: #fff;
  transition: 0.2s ease;
}

.user-menu-trigger.active {
  color: var(--primary);
  border-color: rgba(102, 209, 255, 0.35);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 170px;
  background: #0d1728;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: 0.2s ease;
}

.user-menu:hover .user-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.user-dropdown-btn {
  width: 100%;
  border: none;
  background: transparent;
  color: #fff;
  text-align: right;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
}

.user-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Common */

.badge,
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.page-main,
.wishlist-main,
.gifts-main,
.mahdi-main,
.dashboard-main {
  padding: 40px 0 64px;
}

.hero-section {
  padding: 72px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: stretch;
}

.hero-content h1 {
  margin: 16px 0 18px;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.hero-content h1 span {
  color: var(--primary);
}

.hero-text {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
  margin: 0 0 28px;
}

.hero-actions,
.cta-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.mini-feature-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.mini-feature-card,
.info-card,
.panel-card,
.auth-card,
.glass-card,
.wishlist-user-card,
.modal-card,
.cta-box {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.mini-feature-card,
.info-card {
  padding: 18px;
}

.mini-feature-card strong,
.info-card h3 {
  display: block;
  margin-bottom: 8px;
}

.mini-feature-card span,
.info-card p {
  color: var(--muted);
}

.hero-search-card,
.wishlist-search-box,
.panel-card,
.auth-card,
.modal-card,
.cta-box {
  padding: 28px;
}

.card-head h2,
.panel-head h2,
.auth-card-head h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.25;
}

.card-head p,
.panel-head p,
.auth-card-head p,
.muted-text {
  margin: 0;
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 14px;
}

.top-space {
  margin-top: 24px;
}

.top-space-section {
  margin-top: 24px;
}

label {
  font-weight: 800;
  font-size: 0.98rem;
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  border-radius: 14px;
  padding: 15px 16px;
  transition: 0.2s ease;
}

input::placeholder {
  color: #6a7790;
}

input:focus {
  outline: none;
  border-color: rgba(102, 209, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(102, 209, 255, 0.1);
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #06101d;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-danger {
  background: rgba(255, 101, 119, 0.16);
  color: #ffb4bf;
  border: 1px solid rgba(255, 101, 119, 0.28);
}

.small-btn {
  padding: 10px 14px;
  font-size: 0.92rem;
}

.full-width {
  width: 100%;
}

.form-message {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 800;
}

.form-message.success {
  background: rgba(49, 214, 125, 0.12);
  border: 1px solid rgba(49, 214, 125, 0.22);
  color: #99efbb;
}

.form-message.error {
  background: rgba(255, 101, 119, 0.12);
  border: 1px solid rgba(255, 101, 119, 0.22);
  color: #ffbac4;
}

.form-message.warning {
  background: rgba(255, 204, 102, 0.12);
  border: 1px solid rgba(255, 204, 102, 0.22);
  color: #ffd98d;
}

.empty-state {
  padding: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

/* Search note */

.search-note {
  margin-top: 16px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-note code {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding: 4px 8px;
  border-radius: 10px;
  direction: ltr;
}

/* Auth */

.auth-layout {
  min-height: calc(100vh - 82px);
  display: grid;
  grid-template-columns: 1fr 0.95fr;
}

.auth-side {
  display: flex;
  align-items: center;
  padding: 46px clamp(24px, 5vw, 74px);
}

.auth-side-content {
  max-width: 620px;
}

.auth-side-content h1 {
  margin: 16px 0;
  font-size: clamp(2.1rem, 4vw, 3.7rem);
  line-height: 1.2;
}

.auth-side-content p {
  color: var(--muted);
}

.auth-points {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.auth-point {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
}

.auth-point strong {
  display: block;
  margin-bottom: 6px;
}

.auth-point span {
  color: var(--muted);
}

.auth-card-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 42px 24px;
}

.auth-card {
  width: min(100%, 540px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: #fff;
  border-radius: 14px;
  padding: 13px 14px;
  font-weight: 900;
  cursor: pointer;
}

.auth-tab.active {
  background: rgba(102, 209, 255, 0.12);
  color: var(--primary);
  border-color: rgba(102, 209, 255, 0.28);
}

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: block;
}

.confirm-box {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.top-gap-btn {
  margin-top: 12px;
}

.password-rules {
  background: rgba(255, 204, 102, 0.08);
  border: 1px solid rgba(255, 204, 102, 0.18);
  color: #ffe3a5;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.92rem;
}

.password-rules ul {
  margin: 0;
  padding-right: 18px;
}

/* Pages */

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 10px 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.page-subtitle {
  color: var(--muted);
  margin: 0;
}

.stat-pill {
  min-width: 220px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
}

.stat-pill span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-pill strong {
  display: block;
  overflow-wrap: anywhere;
}

.search-inline-form {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
}

.gifts-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.gift-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  overflow: hidden;
}

.gift-card-image {
  height: 240px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow: hidden;
}

.gift-card-image img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.no-image-box {
  color: #7b8494;
  font-weight: 700;
}

.gift-card-body {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.gift-card-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  min-height: 56px;
}

.gift-card-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.gift-card-description {
  color: #d5dbe7;
  font-size: 0.94rem;
  line-height: 1.7;
  min-height: 48px;
}

.gift-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.chat-box {
  min-height: 360px;
  max-height: 460px;
  overflow: auto;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  display: grid;
  gap: 14px;
}

.chat-message {
  display: flex;
}

.chat-message.user {
  justify-content: flex-start;
}

.chat-message.bot {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(85%, 680px);
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.8;
}

.chat-message.user .chat-bubble {
  background: rgba(255, 255, 255, 0.05);
}

.chat-message.bot .chat-bubble {
  background: rgba(102, 209, 255, 0.12);
  border: 1px solid rgba(102, 209, 255, 0.22);
}

.chat-form {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
}

.chat-suggestions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip-btn {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 18, 0.72);
}

.modal-card {
  position: relative;
  width: min(100%, 520px);
  margin: 10vh auto 0;
  z-index: 2;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.modal-head h3 {
  margin: 0;
  font-size: 1.4rem;
}

.modal-close-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

.wishlist-user-card {
  padding: 20px 24px;
}

.cta-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 36px;
}

/* Responsive */

@media (max-width: 1100px) {
  .hero-grid,
  .auth-layout,
  .mini-feature-grid,
  .info-grid,
  .page-header,
  .cta-box {
    grid-template-columns: 1fr;
    display: grid;
  }
}

@media (max-width: 780px) {
  .container {
    width: min(var(--container), calc(100% - 24px));
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav-links {
    width: 100%;
  }

  .hero-section {
    padding-top: 42px;
  }

  .hero-content h1 {
    font-size: 2.3rem;
  }

  .search-inline-form,
  .chat-form {
    grid-template-columns: 1fr;
  }

  .gifts-head {
    flex-direction: column;
    align-items: stretch;
  }

  .user-dropdown {
    left: auto;
    right: 0;
  }
}

.dashboard-profile-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}

.dashboard-avatar-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.profile-avatar-button {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  padding: 0;
  transition: 0.2s ease;
}

.profile-avatar-button:hover {
  transform: translateY(-2px);
  border-color: rgba(91, 192, 248, 0.65);
  box-shadow: 0 0 0 6px rgba(91, 192, 248, 0.08);
}

.profile-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a7b3c8;
  font-weight: 800;
  font-size: 1rem;
}

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.32);
  color: #fff;
  display: flex;
  align-items: end;
  justify-content: center;
  padding-bottom: 18px;
  opacity: 0;
  transition: 0.2s ease;
  font-weight: 700;
}

.profile-avatar-button:hover .profile-avatar-overlay {
  opacity: 1;
}

.profile-avatar-note {
  color: #8fa3c2;
  font-size: 0.95rem;
  margin: 0;
}

.dashboard-form-side textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: #fff;
  border-radius: 14px;
  padding: 15px 16px;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

.dashboard-form-side textarea::placeholder {
  color: #7f90ab;
  opacity: 1;
}

@media (max-width: 900px) {
  .dashboard-profile-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-avatar-side {
    justify-self: center;
  }
}

/* People search cards */

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.person-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.person-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.person-card-avatar {
  width: 86px;
  height: 86px;
  border-radius: 18px;
  overflow: hidden;
  flex: 0 0 86px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.person-card-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-card-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.8rem;
  font-weight: 900;
}

.person-card-meta h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.person-card-bio {
  margin: 0;
  color: #d5dbe7;
  line-height: 1.8;
  min-height: 48px;
}

/* Fix user dropdown hover gap */

.user-menu {
  padding-bottom: 12px;
  margin-bottom: -12px;
}

.user-dropdown {
  top: 100%;
  margin-top: 8px;
}