/**
 * 22 HUES - Account Page Styles
 * Complete styling for the account dashboard
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  --cream: #FAF8F5;
  --cream-dark: #F5F3EF;
  --charcoal: #191919;
  --white: #FFFFFF;
  --gray-light: #E8E6E3;
  --gray-medium: #9A9A9A;
  --gray-dark: #6B6B6B;
  --gold: #A37E2C;
  --gold-light: #B8923F;
  --success: #2D7D46;
  --warning: #D4A017;
  --error: #C0392B;
  --font-heading: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

/* ========================================
   HEADER
   ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-light);
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 30px;
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
  stroke: var(--charcoal);
  fill: none;
  stroke-width: 1.5;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-dark);
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--charcoal);
}

.back-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.header-logo {
  font-family: var(--font-heading);
  font-size: 24px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--charcoal);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--charcoal);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
}

.user-name {
  font-size: 14px;
  color: var(--charcoal);
}

.logout-btn {
  font-size: 13px;
  color: var(--gray-medium);
  padding: 8px 16px;
  border: 1px solid var(--gray-light);
  border-radius: 4px;
  transition: all 0.2s;
}

.logout-btn:hover {
  border-color: var(--charcoal);
  color: var(--charcoal);
}

/* ========================================
   MAIN LAYOUT
   ======================================== */
.account-wrapper {
  display: flex;
  min-height: 100vh;
  padding-top: 70px;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}

.sidebar-overlay.active {
  display: block;
}

.account-sidebar {
  width: 280px;
  background: var(--white);
  border-right: 1px solid var(--gray-light);
  padding: 40px 0;
  position: fixed;
  top: 70px;
  left: 0;
  height: calc(100vh - 70px);
  overflow-y: auto;
  z-index: 160;
  transition: transform 0.3s ease;
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gray-medium);
  padding: 0 30px;
  margin-bottom: 12px;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 30px;
  font-size: 14px;
  color: var(--gray-dark);
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: var(--cream);
  color: var(--charcoal);
}

.sidebar-nav a.active {
  background: var(--cream);
  color: var(--charcoal);
  border-left-color: var(--gold);
  font-weight: 500;
}

.sidebar-nav svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.sidebar-nav a.active svg {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--white);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.account-main {
  flex: 1;
  margin-left: 280px;
  padding: 40px 50px;
  max-width: calc(100% - 280px);
}

.page-header {
  margin-bottom: 40px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: normal;
  color: var(--charcoal);
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--gray-medium);
}

/* ========================================
   DASHBOARD OVERVIEW
   ======================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  padding: 24px;
  border-radius: 8px;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-medium);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--charcoal);
}

.stat-meta {
  font-size: 13px;
  color: var(--gray-medium);
  margin-top: 4px;
}

/* ========================================
   PALETTE CARD (Hero Card)
   ======================================== */
.palette-hero {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 40px;
}

.palette-hero-inner {
  display: flex;
  flex-direction: column;
}

.palette-hero-image {
  position: relative;
  background: var(--charcoal);
  width: 100%;
  min-height: 0;
}

/* GCA landscape banners: show full artwork (letterboxed on dark) */
.palette-hero-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: clamp(200px, 36vw, 320px);
  object-fit: contain;
  object-position: center center;
}

.palette-hero-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--gold);
  color: var(--white);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: 4px;
}

.palette-hero-content {
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
}

.palette-hero-header {
  margin-bottom: 20px;
}

.palette-hero-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: normal;
  color: var(--charcoal);
  margin-bottom: 4px;
}

.palette-hero-subtitle {
  font-size: 14px;
  color: var(--gray-medium);
  font-style: italic;
}

.palette-colors {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}

.palette-color {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
}

.palette-hero-description {
  font-size: 14px;
  color: var(--gray-dark);
  line-height: 1.7;
  margin-bottom: 24px;
  flex: 1;
}

.palette-hero-actions {
  display: flex;
  gap: 12px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  border-radius: 6px;
  transition: all 0.2s;
  cursor: pointer;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--charcoal);
  color: var(--white);
  border: none;
}

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

.btn-secondary {
  background: transparent;
  color: var(--charcoal);
  border: 1px solid var(--gray-light);
}

.btn-secondary:hover {
  border-color: var(--charcoal);
}

/* ========================================
   SECTION CARDS
   ======================================== */
.section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.section-card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  overflow: hidden;
}

.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-light);
}

.section-card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: normal;
  color: var(--charcoal);
}

.section-card-link {
  font-size: 13px;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.section-card-link:hover {
  color: var(--charcoal);
}

.section-card-link svg {
  width: 14px;
  height: 14px;
}

.section-card-body {
  padding: 0;
}

/* Appointment Item */
.appointment-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-light);
  transition: background 0.2s;
}

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

.appointment-item:hover {
  background: var(--cream);
}

.appointment-date {
  text-align: center;
  min-width: 50px;
}

.appointment-day {
  font-family: var(--font-heading);
  font-size: 24px;
  color: var(--charcoal);
  line-height: 1;
}

.appointment-month {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-medium);
}

.appointment-details {
  flex: 1;
}

.appointment-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 2px;
}

.appointment-meta {
  font-size: 13px;
  color: var(--gray-medium);
}

.appointment-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 4px;
}

.status-confirmed {
  background: rgba(45, 125, 70, 0.1);
  color: var(--success);
}

.status-pending {
  background: rgba(212, 160, 23, 0.1);
  color: var(--warning);
}

.status-completed {
  background: var(--cream-dark);
  color: var(--gray-medium);
}

/* Order Item */
.order-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-light);
  transition: background 0.2s;
}

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

.order-item:hover {
  background: var(--cream);
}

.order-image {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--gray-light);
}

.order-details {
  flex: 1;
}

.order-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 2px;
}

.order-meta {
  font-size: 13px;
  color: var(--gray-medium);
}

.order-price {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--charcoal);
}

/* ========================================
   RECOMMENDED PRODUCTS
   ======================================== */
.recommendations {
  margin-top: 40px;
}

.recommendations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.recommendations-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: normal;
  color: var(--charcoal);
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.product-image {
  aspect-ratio: 1;
  background: var(--cream-dark);
  position: relative;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-match {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--gold);
  color: var(--white);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 3px;
}

.product-info {
  padding: 16px;
}

.product-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 4px;
}

.product-category {
  font-size: 12px;
  color: var(--gray-medium);
  margin-bottom: 8px;
}

.product-price {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--charcoal);
}

/* ========================================
   WALLET GRID
   ======================================== */
.wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.wallet-card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
}

.wallet-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.wallet-card-image {
  aspect-ratio: 4/3;
  position: relative;
}

.wallet-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wallet-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.7));
  display: flex;
  align-items: flex-end;
  padding: 20px;
}

.wallet-card-title {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--white);
}

.wallet-card-body {
  padding: 20px;
}

.wallet-card-meta {
  font-size: 13px;
  color: var(--gray-medium);
  margin-bottom: 16px;
}

.wallet-card-actions {
  display: flex;
  gap: 8px;
}

.wallet-card .btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 12px;
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */
.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

/* ========================================
   SETTINGS
   ======================================== */
.settings-section {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  margin-bottom: 24px;
}

.settings-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-light);
}

.settings-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: normal;
  margin-bottom: 4px;
}

.settings-description {
  font-size: 13px;
  color: var(--gray-medium);
}

.settings-body {
  padding: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  border: 1px solid var(--gray-light);
  border-radius: 6px;
  transition: border-color 0.2s;
  background: var(--white);
}

.form-input:focus {
  outline: none;
  border-color: var(--charcoal);
}

/* ========================================
   APPLE BUSINESS CHAT BUTTON
   ======================================== */
.apple-chat-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

.apple-chat-btn {
  width: 50px;
  height: 44px;
  background: #1a1a1a;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  position: relative;
  border-radius: 22px 22px 4px 22px;
}

.apple-chat-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.chat-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.chat-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.chat-logo {
  position: absolute;
  font-family: var(--font-heading);
  font-size: 16px;
  color: #fff;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.apple-chat-btn.show-logo .chat-dots {
  opacity: 0;
  transform: scale(0.8);
}

.apple-chat-btn.show-logo .chat-logo {
  opacity: 1;
  transform: scale(1);
}

.chat-dot {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .recommendations-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .wallet-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: flex;
  }

  .header-left {
    gap: 16px;
  }

  .header-left .header-logo {
    flex: 0 0 auto !important;
    justify-content: flex-start !important;
  }

  .account-sidebar {
    position: fixed;
    left: -280px;
    z-index: 200;
    transition: left 0.3s ease;
  }
  
  .account-sidebar.open {
    left: 0;
  }
  
  .account-main {
    margin-left: 0;
    max-width: 100%;
    padding: 30px 24px;
  }
  
  .palette-hero-image img {
    max-height: clamp(180px, 50vw, 260px);
  }
  
  .section-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header {
    height: 56px;
  }

  .header-inner {
    padding: 0 16px;
    gap: 0 !important;
  }

  .header-left {
    gap: 12px;
    flex: 0 1 auto;
  }

  /* Override the global logo styles from functions.php that stretch and
     center the logo inside .header-left on mobile. On the account page
     the logo should sit naturally next to the hamburger. */
  .header-left .header-logo {
    flex: 0 0 auto !important;
    max-width: none !important;
    justify-content: flex-start !important;
  }

  .header-left .header-logo .tt-logo--small {
    font-size: 13px !important;
  }

  .mobile-menu-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  .mobile-menu-btn svg {
    width: 20px;
    height: 20px;
  }

  .header-right {
    flex-shrink: 0;
  }

  .back-link {
    display: none;
  }

  .user-name {
    display: none;
  }

  .logout-btn {
    font-size: 12px;
    padding: 6px 12px;
    white-space: nowrap;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .recommendations-grid {
    grid-template-columns: 1fr;
  }
  
  .wallet-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .apple-chat-container {
    bottom: 20px;
    right: 20px;
  }

  .apple-chat-btn {
    width: 44px;
    height: 38px;
    border-radius: 19px 19px 3px 19px;
  }
}
