/* profile.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #5B21B6;
  --primary-light: #7C3AED;
  --primary-dark: #4C1D95;
  --secondary: #F97316;
  --secondary-light: #FB923C;
  --text-dark: #111827;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --white: #FFFFFF;
  --bg-page: #F8FAFC;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #DC2626;
  --border-light: #E5E7EB;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --transition: all 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-page);
  color: var(--text-dark);
  overflow-x: hidden;
}

.app-container {
  max-width: 500px;
  margin: 0 auto;
  background: var(--bg-page);
  min-height: 100vh;
  padding-bottom: 24px;
}

/* Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
}

.back-btn, .settings-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  font-size: 1.2rem;
  color: var(--text-dark);
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition);
}

.back-btn:hover, .settings-btn:hover {
  background: var(--bg-page);
}

/* Profile Section */
.profile-section {
  padding: 20px;
}

.profile-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.profile-avatar {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 16px;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
}

.change-photo-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: var(--primary);
  border: 2px solid var(--white);
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.change-photo-btn:hover {
  background: var(--primary-light);
  transform: scale(1.05);
}

.profile-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.profile-phone {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-email {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-member {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 8px 0 16px;
}

.edit-profile-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 60px;
  padding: 10px 24px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.edit-profile-btn:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* Verification Section */
.verification-section {
  padding: 0 20px 16px;
}

.verification-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.verification-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.verification-status i {
  color: var(--success);
  font-size: 1.3rem;
}

.verification-status.warning i {
  color: var(--warning);
}

.verification-status.error i {
  color: var(--error);
}

.verification-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.benefit-item i {
  color: var(--primary);
  width: 16px;
}

.verify-btn {
  width: 100%;
  background: var(--secondary);
  color: var(--white);
  border: none;
  border-radius: 60px;
  padding: 10px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.verify-btn:hover {
  background: var(--secondary-light);
  transform: translateY(-2px);
}

/* Search */
.search-container {
  padding: 0 20px 12px;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 60px;
  padding: 0 16px;
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.search-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.1);
}

.search-input-wrapper i {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-input-wrapper input {
  flex: 1;
  padding: 10px 10px;
  border: none;
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  background: transparent;
}

.clear-search {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* Sections Container */
.sections-container {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Section Card */
.section-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-card h3 i {
  color: var(--primary);
  width: 20px;
}

.add-btn {
  background: rgba(91, 33, 182, 0.1);
  border: none;
  border-radius: 40px;
  padding: 6px 14px;
  color: var(--primary);
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.add-btn:hover {
  background: var(--primary);
  color: var(--white);
}

.section-description {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Locations List */
.locations-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.location-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.location-item:hover {
  background: var(--border-light);
}

.location-item i {
  color: var(--primary);
  width: 20px;
}

.location-item .loc-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
}

.location-item .loc-address {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.location-item .loc-actions {
  display: flex;
  gap: 6px;
}

.location-item .loc-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.location-item .loc-actions button:hover {
  color: var(--primary);
}

.location-item .loc-actions .delete-btn:hover {
  color: var(--error);
}

/* Contacts List */
.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.contact-item:hover {
  background: var(--border-light);
}

.contact-item .contact-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.contact-item .contact-info {
  flex: 1;
}

.contact-item .contact-name {
  font-size: 0.8rem;
  font-weight: 600;
}

.contact-item .contact-phone {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.contact-item .contact-relationship {
  font-size: 0.6rem;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 2px 8px;
  border-radius: 20px;
}

.contact-item .contact-actions {
  display: flex;
  gap: 6px;
}

.contact-item .contact-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.contact-item .contact-actions button:hover {
  color: var(--primary);
}

.contact-item .contact-actions .delete-btn:hover {
  color: var(--error);
}

/* Grid Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.grid-card {
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.grid-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.grid-card i {
  font-size: 1.3rem;
  color: var(--primary);
  display: block;
  margin-bottom: 6px;
}

.grid-card span {
  font-size: 0.7rem;
  font-weight: 500;
}

/* List Items */
.list-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius-sm);
}

.list-item:hover {
  background: var(--bg-page);
}

.list-item i:first-child {
  color: var(--primary);
  width: 20px;
  font-size: 0.9rem;
}

.list-item span {
  flex: 1;
  font-size: 0.8rem;
}

.list-item i:last-child {
  color: var(--text-light);
  font-size: 0.7rem;
}

/* Payment Options */
.payment-options {
  display: flex;
  gap: 12px;
}

.payment-option {
  flex: 1;
  background: var(--bg-page);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.payment-option i {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.payment-option span {
  font-size: 0.8rem;
  font-weight: 500;
}

.payment-option.selected {
  border-color: var(--primary);
  background: rgba(91, 33, 182, 0.05);
}

.payment-option.selected i,
.payment-option.selected span {
  color: var(--primary);
}

.payment-option .check-icon {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--primary);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.6rem;
  display: none;
}

.payment-option.selected .check-icon {
  display: flex;
}

/* App Info */
.app-info {
  text-align: center;
}

.app-version {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.app-version i {
  color: var(--primary);
}

/* Logout Section */
.logout-section {
  text-align: center;
}

.logout-btn {
  width: 100%;
  background: var(--error);
  color: var(--white);
  border: none;
  border-radius: 60px;
  padding: 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.logout-btn:hover {
  background: #B91C1C;
  transform: translateY(-2px);
}

.delete-account-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.delete-account-link:hover {
  color: var(--error);
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 380px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 2;
}

.modal-header h3 {
  font-size: 1rem;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.1);
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
}

.modal-btn {
  flex: 1;
  padding: 10px;
  border-radius: 40px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border-light);
  background: var(--white);
}

.modal-btn.save-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
}

.modal-btn.save-btn:hover {
  background: var(--primary-light);
}

.modal-btn.cancel-btn:hover {
  border-color: var(--error);
  color: var(--error);
}

.modal-btn.confirm-delete {
  background: var(--error);
  color: var(--white);
  border: none;
}

.modal-btn.confirm-delete:hover {
  background: #B91C1C;
}

.delete-modal-content .modal-body {
  text-align: center;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
  .verification-benefits {
    grid-template-columns: 1fr;
  }
  
  .grid-cards {
    grid-template-columns: 1fr 1fr;
  }
  
  .payment-options {
    flex-direction: column;
  }
}
/* Locked note */
.locked-note {
  margin-top: 10px;
  font-size: 0.7rem;
  color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

/* Toggle switches */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.toggle-row:last-of-type { border-bottom: none; }
.toggle-label { font-size: 0.85rem; font-weight: 600; }
.toggle-desc { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border-light); transition: var(--transition); border-radius: 40px;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: var(--white); transition: var(--transition); border-radius: 50%;
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.privacy-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.download-data-btn, .delete-data-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.download-data-btn { background: rgba(91, 33, 182, 0.08); color: var(--primary); border: 1px solid transparent; }
.download-data-btn:hover { background: rgba(91, 33, 182, 0.15); }
.delete-data-btn { background: rgba(220, 38, 38, 0.08); color: var(--error); border: 1px solid transparent; }
.delete-data-btn:hover { background: rgba(220, 38, 38, 0.15); }

/* Legal pages */
.legal-content {
  padding: 20px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-dark);
}
.legal-content h2 { font-size: 1rem; margin: 20px 0 8px; color: var(--primary); }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p { margin-bottom: 10px; color: var(--text-muted); }
.legal-updated { font-size: 0.7rem; color: var(--text-light); padding: 0 20px 10px; }
