/* ===========================
   STYLE.CSS - ProfileShare App
   Thiết kế: Hiện đại, sáng sủa
   =========================== */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

/* ── CSS Variables ── */
:root {
  --primary: #4361ee;
  --primary-light: #e8ecff;
  --primary-dark: #2d47c8;
  --accent: #f72585;
  --success: #06d6a0;
  --warning: #ffd166;
  --danger: #ef476f;
  --zalo-blue: #0068FF;

  --bg: #f0f4ff;
  --surface: #ffffff;
  --surface-2: #f8f9fe;
  --border: #e2e8f8;

  --text-1: #1a1f3c;
  --text-2: #4a5280;
  --text-3: #8892b0;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(67,97,238,0.08);
  --shadow-md: 0 4px 20px rgba(67,97,238,0.12);
  --shadow-lg: 0 8px 40px rgba(67,97,238,0.16);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header / Navbar ── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.nav-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ── Page Header ── */
.page-header {
  padding: 40px 0 24px;
}

.page-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 6px;
}

.page-subtitle {
  color: var(--text-3);
  font-size: 0.95rem;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body {
  padding: 24px;
}

/* ── Form Styles ── */
.form-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  padding: 32px;
  margin-bottom: 24px;
}

.form-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-title .icon {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.form-label .required {
  color: var(--accent);
  margin-left: 3px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text-1);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}

.form-control::placeholder {
  color: var(--text-3);
}

/* ── Address Section ── */
.address-tabs {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 16px;
  border: 1.5px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-md) - 4px);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ── Location Button ── */
.location-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--primary-light);
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  justify-content: center;
}

.location-btn:hover {
  background: var(--primary);
  color: white;
}

.location-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.location-result {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f0fff8;
  border: 1.5px solid #06d6a0;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: #065f46;
  display: none;
  align-items: center;
  gap: 8px;
}

.location-result.show {
  display: flex;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(67,97,238,0.35);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67,97,238,0.4);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 14px rgba(6,214,160,0.35);
}

.btn-success:hover {
  background: #05b88a;
  transform: translateY(-2px);
}

.btn-zalo {
  background: var(--zalo-blue);
  color: white;
  box-shadow: 0 4px 14px rgba(0,104,255,0.35);
}

.btn-zalo:hover {
  background: #0055d4;
  transform: translateY(-2px);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}

.btn-danger:hover {
  background: #fff0f3;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

/* ── Profile Grid / Cards List ── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.profile-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.profile-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--primary);
}

.profile-card-header {
  background: linear-gradient(135deg, var(--primary), #7b5ea7);
  padding: 20px 20px 30px;
  position: relative;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  border: 3px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

.profile-card-name {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: white;
  margin-top: 10px;
}

.profile-card-id {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
  font-family: monospace;
}

.profile-card-body {
  padding: 20px;
  margin-top: -12px;
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
}

.profile-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-2);
}

.profile-info-row:last-of-type {
  border-bottom: none;
}

.profile-info-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.profile-info-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card-actions {
  padding: 16px 20px;
  display: flex;
  gap: 8px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-3);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 8px;
}

/* ── Profile Page ── */
.profile-page {
  min-height: 100vh;
  background: var(--bg);
}

.profile-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #7b5ea7 100%);
  padding: 48px 20px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.profile-avatar-lg {
  width: 96px;
  height: 96px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  border: 4px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  margin: 0 auto 16px;
  position: relative;
  z-index: 1;
}

.profile-hero-name {
  font-family: 'Nunito', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: white;
  position: relative;
  z-index: 1;
}

.profile-hero-id {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.profile-content {
  max-width: 600px;
  margin: -40px auto 0;
  padding: 0 20px 40px;
  position: relative;
}

.info-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item:hover {
  background: var(--surface-2);
}

.info-item-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.info-item-icon.blue { background: #e8ecff; }
.info-item-icon.green { background: #e8fff8; }
.info-item-icon.orange { background: #fff3e8; }

.info-item-content {
  flex: 1;
}

.info-item-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.info-item-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-1);
}

.info-item-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
}

.info-item-link:hover {
  text-decoration: underline;
}

/* ── Action Buttons Grid ── */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Toast Notification ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-1);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ── Stats Bar ── */
.stats-bar {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-family: 'Nunito', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-3);
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }

/* ── Section Title ── */
.section-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Back Link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 24px;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.back-link:hover {
  color: white;
}

/* ── Not Found ── */
.not-found {
  text-align: center;
  padding: 80px 20px;
}

.not-found-emoji {
  font-size: 4rem;
  margin-bottom: 16px;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.4s cubic-bezier(0.4,0,0.2,1) forwards;
}

/* ── Responsive Mobile ── */
@media (max-width: 640px) {
  .form-card {
    padding: 20px;
  }

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

  .action-grid,
  .share-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 1.4rem;
  }

  .profile-hero-name {
    font-size: 1.6rem;
  }

  .stats-bar {
    justify-content: space-around;
  }

  .address-tabs {
    flex-direction: column;
  }
}
