/* Custom Google Font: Outfit & Playfair Display */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,400&display=swap');

:root {
  /* Color Palette - Logo-matched Premium Theme */
  --primary-rose: #6392D0; /* Logo Blue */
  --primary-rose-dark: #4a75ad;
  --primary-rose-light: #eaf1fb;
  --gold-accent: #9BB096; /* Logo Green */
  --gold-dark: #7b9476;
  --bg-cream: #FAF7DD; /* Logo Cream */
  --card-bg: rgba(255, 255, 255, 0.9);
  --glass-bg: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(99, 146, 208, 0.15);
  --text-charcoal: #2c332b;
  --text-muted: #6e786d;
  --success-green: #8cb39c;
  --danger-coral: #df8a82;
  --info-blue: #8faec4;
  --card-shadow: 0 8px 32px 0 rgba(99, 146, 208, 0.06);
  --input-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.01);
  --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #f3eed8;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 146, 208, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(155, 176, 150, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(140, 179, 156, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-charcoal);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* App Container - Mobile Frame styling on desktop/tablet, full screen on mobile */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--bg-cream);
  box-shadow: 0 10px 40px rgba(44, 37, 35, 0.12);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  border-right: 1px solid rgba(255, 255, 255, 0.3);
}

@media (min-width: 481px) {
  .app-container {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    margin: 0;
    overflow-y: hidden;
    position: relative;
  }
}

/* Header Component */
header {
  padding: 24px 20px 16px 20px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title-container h1 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-charcoal);
  background: linear-gradient(135deg, var(--text-charcoal) 30%, var(--primary-rose-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-title-container p {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 500;
}

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

.btn-icon {
  background: var(--primary-rose-light);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--primary-rose-dark);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-icon:hover {
  transform: scale(1.05);
  background: var(--primary-rose);
  color: white;
}

/* Content Area */
main {
  flex: 1;
  padding: 16px 20px 100px 20px;
  overflow-y: auto;
}

@media (min-width: 481px) {
  main {
    height: calc(100dvh - 81px - 80px); /* Subtract header and navbar heights */
    height: calc(100vh - 81px - 80px);
    overflow-y: auto;
  }
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
  z-index: 100;
}

@media (max-width: 480px) {
  .bottom-nav {
    position: fixed;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  transition: var(--transition-smooth);
  border: none;
  background: none;
  cursor: pointer;
  width: 60px;
  height: 60px;
  border-radius: 16px;
}

.nav-item i {
  font-size: 20px;
  margin-bottom: 4px;
  transition: var(--transition-smooth);
}

.nav-item.active {
  color: var(--primary-rose-dark);
  background: var(--primary-rose-light);
}

.nav-item.active i {
  transform: translateY(-2px);
}

/* Reusable Card Styles */
.card {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--card-shadow);
  transition: var(--transition-smooth);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px 0 rgba(184, 133, 123, 0.12);
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title-row h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-charcoal);
}

/* Quick Metrics Row */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-charcoal);
}

.metric-value.income {
  color: var(--success-green);
}

.metric-value.expense {
  color: var(--danger-coral);
}

/* Forms & Inputs styling */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-charcoal);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(184, 133, 123, 0.25);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-charcoal);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

.form-control:focus {
  border-color: var(--primary-rose-dark);
  box-shadow: 0 0 0 3px rgba(229, 179, 168, 0.25);
}

/* Buttons */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-rose) 0%, var(--primary-rose-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(229, 179, 168, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(229, 179, 168, 0.5);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-charcoal);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.9);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* Tabs Panel visibility toggler */
.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease;
}

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

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

/* Modals */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(44, 37, 35, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: flex-end;
  z-index: 1000;
  animation: fadeInModal 0.3s ease;
}

@media (max-width: 480px) {
  .modal-overlay {
    position: fixed;
  }
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  width: 100%;
  background: var(--bg-cream);
  border-top-left-radius: var(--border-radius-lg);
  border-top-right-radius: var(--border-radius-lg);
  padding: 24px 20px;
  max-height: 85%;
  overflow-y: auto;
  box-shadow: 0 -8px 32px rgba(44, 37, 35, 0.15);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

.modal-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
}

/* Notification Toast */
.toast-container {
  position: absolute;
  top: 90px;
  left: 20px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 480px) {
  .toast-container {
    position: fixed;
  }
}

.toast {
  background: rgba(255, 255, 255, 0.95);
  border-left: 4px solid var(--primary-rose-dark);
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  box-shadow: 0 4px 16px rgba(44, 37, 35, 0.08);
  font-size: 13px;
  color: var(--text-charcoal);
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideInRight 0.3s ease;
  backdrop-filter: blur(10px);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Emotional check-in styles */
.mood-selector {
  display: flex;
  justify-content: space-between;
  margin: 16px 0;
}

.mood-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 24px;
  padding: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 54px;
  height: 54px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mood-btn:hover {
  transform: scale(1.15);
  background: var(--primary-rose-light);
}

.mood-btn.selected {
  background: var(--primary-rose);
  border-color: var(--primary-rose-dark);
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(229, 179, 168, 0.4);
}

/* Social Media Card */
.strategy-result {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 16px;
  border-radius: var(--border-radius-md);
  margin-top: 16px;
  font-size: 14px;
}

.strategy-result h4 {
  margin-bottom: 8px;
  color: var(--primary-rose-dark);
  font-weight: 600;
}

.strategy-result p {
  white-space: pre-wrap;
  color: var(--text-charcoal);
  line-height: 1.5;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(184, 133, 123, 0.3);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(184, 133, 123, 0.5);
}

/* Inventory & List items styling */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--border-radius-md);
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: var(--transition-smooth);
}

.list-item:hover {
  background: rgba(255, 255, 255, 0.95);
}

.list-item-details h4 {
  font-size: 14px;
  font-weight: 600;
}

.list-item-details p {
  font-size: 12px;
  color: var(--text-muted);
}

.list-item-action {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success { background: rgba(140, 179, 156, 0.2); color: #436d55; }
.badge-danger { background: rgba(223, 138, 130, 0.2); color: #9c3f35; }
.badge-info { background: rgba(143, 174, 196, 0.2); color: #3b5f75; }
.badge-warning { background: rgba(212, 163, 115, 0.2); color: #875c2e; }

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 40px;
  margin-bottom: 12px;
  color: var(--primary-rose);
}

/* SVG Chart Style */
.svg-chart {
  width: 100%;
  height: 120px;
}
.chart-bar {
  fill: var(--primary-rose);
  rx: 4;
  transition: var(--transition-smooth);
}
.chart-bar:hover {
  fill: var(--primary-rose-dark);
}
.chart-label {
  fill: var(--text-muted);
  font-size: 10px;
  text-anchor: middle;
}

/* Interactive checkbox list */
.goal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(184, 133, 123, 0.1);
}

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

.goal-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-rose-dark);
}

.goal-text.completed {
  text-decoration: line-through;
  color: var(--text-muted);
}

