/* ==========================================================================
   AI+U USER DASHBOARD & AUTH SYSTEM STYLESHEET (WHITE LIGHT THEME)
   ========================================================================== */

:root {
  --primary-color: #E91B62;
  --primary-glow: rgba(233, 27, 98, 0.15);
  --bg-color: #F8F9FD;
  --card-bg: #FFFFFF;
  --card-border: #E5E7EB;
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --input-bg: #F9FAFB;
  --input-border: #D1D5DB;
  --shadow-color: rgba(0, 0, 0, 0.06);
  
  --font-chinese: 'Noto Sans TC', sans-serif;
  --font-english: 'Outfit', sans-serif;
  
  --transition-normal: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: 0.15s ease;
  
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --border-radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-chinese);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Glow Spheres (Soft Light Gradients) */
.glow-sphere {
  position: fixed;
  border-radius: var(--border-radius-full);
  filter: blur(100px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

.auth-sphere-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(233, 27, 98, 0.08) 0%, rgba(255,255,255,0) 80%);
  top: -10%;
  right: -10%;
}

.auth-sphere-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.06) 0%, rgba(255,255,255,0) 80%);
  bottom: -10%;
  left: -10%;
}

/* ==========================================================================
   AUTHENTICATION PAGES (Login / Register)
   ========================================================================== */

.auth-body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  background-color: #F8F9FD;
  background-attachment: fixed;
}

.auth-container {
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: var(--border-radius-lg);
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.register-card {
  max-width: 600px;
}

.auth-header {
  text-align: center;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-english);
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 20px;
  transition: transform var(--transition-fast);
}

.auth-logo:hover {
  transform: scale(1.02);
}

.auth-logo .logo-img {
  width: 32px;
  height: 32px;
}

.auth-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  transition: color var(--transition-fast);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #F9FAFB;
  border: 1px solid #D1D5DB;
  border-radius: var(--border-radius-md);
  padding: 12px 14px 12px 42px;
  color: #111827;
  font-size: 13.5px;
  outline: none;
  transition: all var(--transition-normal);
}

.form-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E91B62' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 42px;
}

.form-select option {
  background: #FFFFFF;
  color: #111827;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary-color);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(233, 27, 98, 0.12);
}

.form-input:focus + .input-icon {
  color: var(--primary-color);
}

/* Custom Buttons */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
}

.btn-primary {
  background: var(--primary-color);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(233, 27, 98, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 27, 98, 0.35);
  background: #FF2E78;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  color: #111827;
}

.btn-secondary:hover:not(:disabled) {
  background: #E5E7EB;
  transform: translateY(-2px);
}

.btn-submit {
  width: 100%;
  margin-top: 10px;
}

/* Authentication alerts */
.auth-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 500;
}

.error-alert {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #DC2626;
}

.success-alert {
  background: #ECFDF5;
  border: 1px solid #6EE7B7;
  color: #059669;
}

.auth-footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border-top: 1px solid #F3F4F6;
  padding-top: 24px;
}

.auth-footer p {
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.auth-footer a:hover {
  color: #FF5E97;
  text-decoration: underline;
}

.back-link {
  font-size: 12.5px;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
}

.back-link:hover {
  color: #111827 !important;
  text-decoration: none !important;
}

/* ==========================================================================
   USER DASHBOARD LAYOUT
   ========================================================================== */

.dashboard-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar styling */
.sidebar {
  background: #FFFFFF;
  border-right: 1px solid #E5E7EB;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
  box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-english);
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 40px;
}

.sidebar-brand .logo-img {
  width: 32px;
  height: 32px;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.sidebar-link:hover {
  background: #F3F4F6;
  color: #111827;
}

.sidebar-link.active {
  background: rgba(233, 27, 98, 0.08);
  border: 1px solid rgba(233, 27, 98, 0.2);
  color: var(--primary-color);
  font-weight: 700;
}

.sidebar-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  border-top: 1px solid #F3F4F6;
  padding-top: 20px;
}

.user-quick-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-full);
  background: linear-gradient(135deg, var(--primary-color) 0%, #8A2BE2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  color: #FFFFFF;
}

.profile-info {
  overflow: hidden;
}

.profile-info h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-info p {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  width: 100%;
  padding: 10px;
  font-size: 12.5px;
  color: #DC2626;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
}

.btn-logout:hover {
  background: #FEE2E2;
  transform: none;
}

/* Main Content styling */
.main-content {
  padding: 40px 50px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  background-color: #F8F9FD;
}

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

.dashboard-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
}

.header-meta {
  font-size: 13.5px;
  color: var(--text-muted);
}

.dashboard-section {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

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

/* ==========================================================================
   DASHBOARD CARDS & OVERVIEWS
   ========================================================================== */

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-content h3 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-english);
  color: #111827;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-full);
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  color: var(--primary-color);
}

/* Subscription status specific card */
.status-active .stat-icon {
  color: #059669;
  background: #ECFDF5;
  border-color: #6EE7B7;
}

.status-inactive .stat-icon {
  color: #D97706;
  background: #FFFBEB;
  border-color: #FDE68A;
}

/* ==========================================================================
   SUBSCRIPTION gating / pricing plans
   ========================================================================== */

.section-intro {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 700px;
  margin-bottom: 30px;
}

.plans-deck {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  max-width: 900px;
  margin: 0 auto 50px auto;
}

.plan-card {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: var(--border-radius-lg);
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.plan-card:hover {
  transform: translateY(-5px);
  border-color: #D1D5DB;
}

.plan-card.premium-plan {
  border-color: var(--primary-color);
  box-shadow: 0 10px 30px rgba(233, 27, 98, 0.12);
}

.plan-card.premium-plan::before {
  content: 'RECOMMENDED';
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--primary-color);
  color: #FFFFFF;
  font-family: var(--font-english);
  font-size: 9px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--border-radius-full);
  letter-spacing: 1px;
}

.plan-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 12px;
}

.plan-price {
  font-family: var(--font-english);
  margin-bottom: 24px;
}

.price-currency {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  vertical-align: super;
}

.price-amount {
  font-size: 40px;
  font-weight: 800;
  color: #111827;
}

.price-period {
  font-size: 14px;
  color: var(--text-muted);
  margin-left: 4px;
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
  flex-grow: 1;
}

.plan-features li {
  font-size: 13.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.plan-features li i {
  color: #059669;
  font-size: 14px;
}

.plan-card.premium-plan .plan-features li i {
  color: var(--primary-color);
}

.btn-select-plan {
  width: 100%;
  border: none;
}

/* ==========================================================================
   CHECKOUT MODULE
   ========================================================================== */

.checkout-module {
  max-width: 800px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: var(--border-radius-lg);
  padding: 40px;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
}

.checkout-form-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.checkout-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 10px;
  border-bottom: 1px solid #F3F4F6;
  padding-bottom: 14px;
}

.virtual-card {
  width: 100%;
  max-width: 320px;
  height: 190px;
  border-radius: 15px;
  background: linear-gradient(135deg, #1E293B 0%, #475569 100%);
  padding: 24px;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.virtual-card.premium-card-theme {
  background: linear-gradient(135deg, #E91B62 0%, #8A2BE2 100%);
  box-shadow: 0 10px 25px rgba(233, 27, 98, 0.25);
}

/* ==========================================================================
   TAB: MATCHMAKING HISTORY & CHAT
   ========================================================================== */

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

.history-item {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  transition: transform var(--transition-fast);
}

.history-item:hover {
  transform: translateX(4px);
  border-color: #D1D5DB;
}

.history-meta h4 {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

.history-meta p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Chat Center Layout */
.chat-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: var(--border-radius-lg);
  height: 600px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}

.chat-sidebar {
  border-right: 1px solid #E5E7EB;
  background: #F9FAFB;
}

.chat-room-item {
  padding: 16px;
  border-bottom: 1px solid #F3F4F6;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.chat-room-item:hover {
  background: #F3F4F6;
}

.chat-room-item.active {
  background: #FFFFFF;
  border-left: 3px solid var(--primary-color);
}

.chat-main {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid #E5E7EB;
  font-weight: 700;
  color: #111827;
  background: #FFFFFF;
}

.chat-messages {
  flex-grow: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #F8F9FD;
}

.msg-bubble {
  max-width: 70%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.5;
}

.msg-partner {
  align-self: flex-start;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  color: #111827;
  border-bottom-left-radius: 4px;
}

.msg-me {
  align-self: flex-end;
  background: var(--primary-color);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid #E5E7EB;
  display: flex;
  gap: 12px;
  background: #FFFFFF;
}

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