/**
 * @file
 * User Profile & Customer Account Dashboard for Vidhyant-Mart
 * Mobile App & PWA Compatible Responsive Design System
 */

/* ==========================================================================
   USER PROFILE MAIN LAYOUT
   ========================================================================== */

.profile-page {
  padding: 32px 0 64px;
  background: #f8fafc;
  min-height: calc(100vh - 180px);
}

/* ==========================================================================
   PROFILE HERO / HEADER
   ========================================================================== */

.profile-hero {
  background: linear-gradient(135deg, #0D7C66 0%, #085546 60%, #16a34a 100%);
  border-radius: 20px;
  padding: 32px 36px;
  color: #ffffff;
  margin-bottom: 28px;
  box-shadow: 0 15px 30px -10px rgba(13, 124, 102, 0.35);
  position: relative;
  overflow: hidden;
}

.profile-hero::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.profile-hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.profile-hero__user {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-hero__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #ffffff;
  color: #0D7C66;
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border: 3px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  overflow: hidden;
}

.profile-hero__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-hero__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-hero__name {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.3px;
}

.profile-hero__email {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  width: fit-content;
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.profile-hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-hero__btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.profile-hero__btn--light {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
}

.profile-hero__btn--light:hover {
  background: rgba(255, 255, 255, 0.25);
}

.profile-hero__btn--logout {
  background: rgba(239, 68, 68, 0.2);
  color: #ffffff;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.profile-hero__btn--logout:hover {
  background: rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   STATS BAR
   ========================================================================== */

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.profile-stat-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.profile-stat-card:hover {
  transform: translateY(-2px);
  border-color: #0D7C66;
}

.profile-stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-stat-card__icon--green {
  background: #f0fdf4;
  color: #16a34a;
}

.profile-stat-card__icon--teal {
  background: #f0fdfa;
  color: #0D7C66;
}

.profile-stat-card__icon--rose {
  background: #fff1f2;
  color: #f43f5e;
}

.profile-stat-card__icon--amber {
  background: #fffbeb;
  color: #d97706;
}

.profile-stat-card__num {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.profile-stat-card__label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

/* ==========================================================================
   PROFILE CONTENT GRID & SIDEBAR TABS
   ========================================================================== */

.profile-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: flex-start;
}

/* Left Sidebar Menu */
.profile-nav {
  background: #ffffff;
  border-radius: 18px;
  padding: 12px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all 0.2s ease;
}

.profile-nav__item:hover {
  background: #f8fafc;
  color: #0D7C66;
}

.profile-nav__item.active {
  background: #f0fdf4;
  color: #0D7C66;
  font-weight: 700;
}

.profile-nav__item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.profile-nav__item--logout {
  color: #ef4444;
  margin-top: 8px;
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
}

.profile-nav__item--logout:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* ==========================================================================
   TAB PANELS CONTAINER
   ========================================================================== */

.profile-panel {
  display: none;
  background: #ffffff;
  border-radius: 20px;
  padding: 32px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  animation: panelFadeIn 300ms ease;
}

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

@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1.5px solid #f1f5f9;
}

.profile-panel__title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   MY ORDERS CARDS
   ========================================================================== */

.order-cards-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  background: #ffffff;
  transition: all 0.2s ease;
}

.order-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.order-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 14px;
}

.order-card__id {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.order-card__date {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

.order-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
}

.order-card__status--completed,
.order-card__status--delivered {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.order-card__status--processing,
.order-card__status--placed {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.order-card__status--dispatched {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.order-card__status--draft,
.order-card__status--pending {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.order-card__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.order-card__items-count {
  font-size: 13.5px;
  color: #475569;
  font-weight: 500;
}

.order-card__total {
  font-size: 17px;
  font-weight: 800;
  color: #0D7C66;
}

.order-card__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-card__btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.order-card__btn--track {
  background: #0D7C66;
  color: #ffffff;
  border: none;
}

.order-card__btn--track:hover {
  background: #085546;
}

.order-card__btn--outline {
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
}

.order-card__btn--outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* ==========================================================================
   SAVED ADDRESSES CARDS
   ========================================================================== */

.address-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.address-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.2s ease;
  position: relative;
}

.address-card:hover {
  border-color: #0D7C66;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.address-card__tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  display: inline-block;
}

.address-card__name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 4px;
}

.address-card__text {
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.5;
  margin-top: 4px;
}

.address-card__phone {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
  margin-top: 6px;
}

/* Add Address Card */
.address-card--add {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 180px;
  cursor: pointer;
  color: #0D7C66;
}

.address-card--add:hover {
  background: #f0fdf4;
  border-color: #0D7C66;
}

/* ==========================================================================
   MOBILE APP & PWA RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Horizontal Scrollable Tabs for Mobile / PWA */
  .profile-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 6px;
    border-radius: 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .profile-nav::-webkit-scrollbar {
    display: none;
  }

  .profile-nav__item {
    white-space: nowrap;
    flex-shrink: 0;
    width: auto;
    padding: 10px 14px;
    font-size: 13px;
  }

  .profile-nav__item--logout {
    margin-top: 0;
    border-top: none;
    padding-top: 10px;
  }

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

@media (max-width: 600px) {
  .profile-hero {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .profile-hero__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-hero__actions {
    width: 100%;
    justify-content: space-between;
  }

  .profile-hero__btn {
    flex: 1;
    justify-content: center;
  }

  .profile-panel {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .order-card__body {
    flex-direction: column;
    align-items: flex-start;
  }

  .order-card__actions {
    width: 100%;
    margin-top: 10px;
  }

  .order-card__btn {
    flex: 1;
    justify-content: center;
  }
}
