/* ═════════════════════════════════════════════════════════════════════ */
/* Settings Panel Redesign — Production Theme & Toggle System (v2.52.00) */
/* ═════════════════════════════════════════════════════════════════════ */

:root {
  --bg-page: #070a12;
  
  /* Text */
  --text-title: #ffffff;
  --text-sub: #94a3b8;
  --text-placeholder: #52637a;
  
  /* Accent Colors */
  --cyan-glow: #06b6d4;
  --sky-glow: #38bdf8;
  --teal-glow: #34d399;
  --purple-glow: #a855f7;
  --indigo-glow: #6366f1;
  
  --radius-card: 18px;
  --radius-input: 8px;
  --radius-pill: 9999px;
  
  --font-family: 'SF Pro Display', 'Outfit', 'Inter', -apple-system, sans-serif;
}

/* ───────────────────────────────────────────────────────────────────── */
/* Dynamic Outer Border: 1.2px Collapsed vs 3.6px (3x Thicker) Expanded   */
/* ───────────────────────────────────────────────────────────────────── */

.gradient-card {
  position: relative;
  border-radius: var(--radius-card);
  padding: 14px 16px;
  border: 1.2px solid transparent;
  scroll-margin-top: 70px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  transition: border-width 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease;
}

/* Expanded State: 3.6px Thicker Border (3x) + Neon Glow */
.gradient-card:not(.collapsed) {
  border-width: 3.6px;
}

/* Card 1: AI OCR Engine — Cyan / Sky Blue to Purple Line */
.card-ai-ocr {
  background: 
    radial-gradient(circle at 10% 15%, rgba(56, 189, 248, 0.18) 0%, transparent 55%) padding-box,
    radial-gradient(circle at 90% 85%, rgba(168, 85, 247, 0.18) 0%, transparent 55%) padding-box,
    linear-gradient(rgba(14, 22, 38, 0.9), rgba(14, 22, 38, 0.9)) padding-box,
    linear-gradient(135deg, #38bdf8 0%, #06b6d4 35%, #8b5cf6 70%, #a855f7 100%) border-box;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.card-ai-ocr:not(.collapsed) {
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35), 0 0 30px rgba(168, 85, 247, 0.2);
}

/* Card 2: Receipt Sharing — Emerald Green / Teal to Purple Line */
.card-workspace {
  background: 
    radial-gradient(circle at 10% 15%, rgba(52, 211, 153, 0.22) 0%, transparent 55%) padding-box,
    radial-gradient(circle at 90% 85%, rgba(168, 85, 247, 0.2) 0%, transparent 55%) padding-box,
    linear-gradient(rgba(14, 22, 38, 0.9), rgba(14, 22, 38, 0.9)) padding-box,
    linear-gradient(135deg, #34d399 0%, #06b6d4 40%, #8b5cf6 75%, #a855f7 100%) border-box;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.card-workspace:not(.collapsed) {
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.35), 0 0 30px rgba(168, 85, 247, 0.2);
}

/* Card 3: Weekly Digest — Emerald to Indigo/Purple Line */
.card-digest {
  background: 
    radial-gradient(circle at 10% 15%, rgba(52, 211, 153, 0.18) 0%, transparent 55%) padding-box,
    radial-gradient(circle at 90% 85%, rgba(99, 102, 241, 0.2) 0%, transparent 55%) padding-box,
    linear-gradient(rgba(14, 22, 38, 0.9), rgba(14, 22, 38, 0.9)) padding-box,
    linear-gradient(135deg, #34d399 0%, #6366f1 65%, #a855f7 100%) border-box;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.card-digest:not(.collapsed) {
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.3), 0 0 30px rgba(99, 102, 241, 0.2);
}

/* Card 4: Display & Language — Cyan/Teal to Purple Line */
.card-display,
.card-language {
  background: 
    radial-gradient(circle at 10% 15%, rgba(6, 182, 212, 0.18) 0%, transparent 55%) padding-box,
    radial-gradient(circle at 90% 85%, rgba(168, 85, 247, 0.22) 0%, transparent 55%) padding-box,
    linear-gradient(rgba(14, 22, 38, 0.9), rgba(14, 22, 38, 0.9)) padding-box,
    linear-gradient(135deg, #06b6d4 0%, #a855f7 100%) border-box;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.card-display:not(.collapsed),
.card-language:not(.collapsed) {
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35), 0 0 30px rgba(168, 85, 247, 0.2);
}

/* ───────────────────────────────────────────────────────────────────── */
/* 2-Column Grid Layout: Dynamic Sizing                                  */
/* ───────────────────────────────────────────────────────────────────── */

.card-grid-layout {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: start;
  min-width: 0;
  width: 100%;
  transition: grid-template-columns 0.35s ease;
}

.gradient-card.collapsed .card-grid-layout {
  grid-template-columns: 28px 1fr;
  gap: 8px;
}

.card-icon-col {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 2px;
}

/* Icon Sizing: 36px Expanded vs 24px Collapsed */
.card-icon-lucide {
  width: 36px;
  height: 36px;
  stroke-width: 2;
  color: #ffffff;
  transition: width 0.35s ease, height 0.35s ease;
}

.gradient-card.collapsed .card-icon-lucide {
  width: 24px;
  height: 24px;
}

.card-main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

/* Header Toggle Row */
.card-header-toggle {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  cursor: pointer;
  user-select: none;
  padding: 0;
  width: 100%;
}

/* Title Sizing: 1.3rem Expanded vs 0.91rem Collapsed */
.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: font-size 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  line-height: 1.2;
  word-break: break-word;
}

.gradient-card.collapsed .card-title {
  font-size: 0.91rem;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-top: 2px;
  font-weight: 400;
  line-height: 1.3;
  transition: font-size 0.35s ease, opacity 0.35s ease;
  word-break: break-word;
}

.gradient-card.collapsed .card-subtitle {
  font-size: 0.75rem;
}

.chevron-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  font-size: 0.7rem;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.3, 1) 0.1s, background 0.2s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.card-header-toggle:hover .chevron-icon {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.gradient-card.collapsed .chevron-icon {
  transform: rotate(-90deg);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ───────────────────────────────────────────────────────────────────── */
/* Card Body Animation                                                   */
/* ───────────────────────────────────────────────────────────────────── */

.card-body-content {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: max-height 1.2s cubic-bezier(0.25, 1, 0.3, 1) 0.1s, opacity 0.8s cubic-bezier(0.25, 1, 0.3, 1) 0.1s, margin 0.6s ease;
  max-height: 1000px;
  opacity: 1;
  overflow: hidden;
  width: 100%;
}

.gradient-card.collapsed .card-body-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
  transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, margin 0.25s ease;
}

/* Form Controls & Inputs */
.field-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-sub);
  word-break: break-word;
}

.custom-select,
.text-input,
.api-key-input {
  width: 100%;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-input);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-title);
  font-size: 0.85rem;
  font-family: var(--font-family);
  outline: none;
  box-sizing: border-box;
}

.custom-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.text-input::placeholder {
  color: var(--text-placeholder);
}

.api-key-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.badge-connected {
  padding: 4px 10px;
  border-radius: var(--radius-input);
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
  margin-top: 2px;
}

/* ───────────────────────────────────────────────────────────────────── */
/* Apple Pill Toggle Switches — Guaranteed Rendering                     */
/* ───────────────────────────────────────────────────────────────────── */

.toggle-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 4px 0 !important;
  width: 100% !important;
}

.toggle-title {
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  color: var(--text-title) !important;
  flex: 1 !important;
}

.mock-switch {
  position: relative !important;
  display: inline-block !important;
  width: 44px !important;
  height: 24px !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.mock-switch input {
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
  margin: 0 !important;
}

.mock-slider {
  position: absolute !important;
  cursor: pointer !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  background-color: rgba(255, 255, 255, 0.18) !important;
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-radius: 24px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.mock-slider:before {
  position: absolute !important;
  content: "" !important;
  height: 18px !important;
  width: 18px !important;
  left: 2px !important;
  bottom: 2px !important;
  background-color: #ffffff !important;
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) !important;
}

.mock-switch input:checked + .mock-slider {
  background-color: #34d399 !important;
  border-color: #34d399 !important;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.4) !important;
}

.mock-switch input:checked + .mock-slider:before {
  transform: translateX(20px) !important;
}

/* ───────────────────────────────────────────────────────────────────── */
/* Glass Pill Buttons                                                    */
/* ───────────────────────────────────────────────────────────────────── */

.glass-btn,
.btn-glass-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 6px 14px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1.2px solid rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  font-family: var(--font-family) !important;
  cursor: pointer !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  width: auto;
}

.glass-btn:hover,
.btn-glass-pill:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3) !important;
}

.btn-full-width {
  width: 100% !important;
}

.btn-save-pill {
  width: 100%;
  padding: 10px 20px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #34d399 0%, #06b6d4 100%);
  color: #070a12;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(52, 211, 153, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-save-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(52, 211, 153, 0.45);
}

/* ───────────────────────────────────────────────────────────────────── */
/* Member Avatars Row & Destinations                                     */
/* ───────────────────────────────────────────────────────────────────── */

.members-row {
  display: flex;
  align-items: center;
  margin-top: 8px;
  padding: 4px 0;
  flex-wrap: wrap;
}

.avatar-wrapper {
  position: relative;
  margin-right: -10px;
  cursor: pointer;
  transition: transform 0.2s ease, z-index 0.2s ease;
}

.avatar-wrapper:hover {
  transform: scale(1.18);
  z-index: 10;
}

.member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(14, 22, 38, 0.95);
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  background-color: #1e293b;
}

.avatar-remove-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #0f172a;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.avatar-wrapper:hover .avatar-remove-badge {
  opacity: 1;
}

.destination-card-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  color: var(--text-title);
  transition: background 0.2s ease;
}

.destination-card-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.badge-active-status {
  color: #34d399;
  font-weight: 600;
  font-size: 0.78rem;
}
