/* StorePro Japanese Dashboard - Custom Styles */
/* Color Palette: Neutral Blue (B) - 清潔感と安心感のあるデザイン */

/* Color Variables */
:root {
  /* Primary - Steel Blue */
  --color-primary: #4682B4;
  --color-primary-dark: #3a6d96;
  --color-primary-light: #5a9bd5;

  /* Secondary - Cool Gray */
  --color-secondary: #6b7280;
  --color-secondary-light: #8b9197;

  /* Success - Sage Green */
  --color-success: #5b9a7d;
  --color-success-light: #6dab8f;

  /* Warning - Muted Amber */
  --color-warning: #b5943a;
  --color-warning-light: #c9a84e;

  /* Neutral */
  --color-text-primary: #374151;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;
  --color-bg-primary: #f8fafc;
  --color-bg-secondary: #f1f5f9;
  --color-border: #e5e7eb;

  /* Safe area */
  --safe-area-inset-top: env(safe-area-inset-top);
  --safe-area-inset-bottom: env(safe-area-inset-bottom);
}

/* Body with safe area */
body {
  padding-top: var(--safe-area-inset-top);
  padding-bottom: calc(var(--safe-area-inset-bottom) + 4rem);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
}

/* Bottom navigation fixed */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding-bottom: var(--safe-area-inset-bottom);
  z-index: 50;
  background: white;
  border-top: 1px solid var(--color-border);
}

/* Card styles */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 1rem;
}

.card-hover:active {
  transform: scale(0.98);
  transition: transform 0.1s;
}

/* KPI Card - Primary (Steel Blue) */
.kpi-card {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  border-radius: 1rem;
  padding: 1.25rem;
}

/* KPI Card - Secondary (Cool Gray) */
.kpi-card.secondary {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
}

/* KPI Card - Success (Sage Green) */
.kpi-card.success {
  background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-light) 100%);
}

/* KPI Card - Warning (Muted Amber) */
.kpi-card.warning {
  background: linear-gradient(135deg, var(--color-warning) 0%, var(--color-warning-light) 100%);
}

/* Contact list item */
.contact-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: white;
  border-radius: 0.75rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.contact-item:active {
  background: var(--color-bg-primary);
}

.contact-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
  flex-shrink: 0;
}

/* Tag styles */
.tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-vip {
  background: #fef3c7;
  color: #92400e;
}

.tag-new {
  background: #dbeafe;
  color: #1e5a8c;
}

.tag-regular {
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
}

.btn-secondary {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.btn-success {
  background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-light) 100%);
  color: white;
}

.btn-icon {
  padding: 0.5rem;
  border-radius: 0.5rem;
}

/* Input styles */
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: border-color 0.15s;
}

.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(70, 130, 180, 0.15);
}

/* Loading spinner */
.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  z-index: 100;
  animation: toast-in 0.3s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Activity list */
.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-bg-secondary);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-primary);
  margin-top: 0.5rem;
  flex-shrink: 0;
}

/* Calendar appointment */
.appointment-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: white;
  border-radius: 0.75rem;
  margin-bottom: 0.5rem;
  border-left: 4px solid var(--color-primary);
}

.appointment-time {
  font-weight: 600;
  color: var(--color-primary);
  min-width: 4rem;
}

/* Message bubble */
.message-bubble {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  margin-bottom: 0.5rem;
}

.message-sent {
  background: var(--color-primary);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 0.25rem;
}

.message-received {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border-bottom-left-radius: 0.25rem;
}

/* Pull to refresh indicator */
.pull-indicator {
  text-align: center;
  padding: 1rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 0.5rem;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 1.5rem 1.5rem 0 0;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  padding-bottom: calc(var(--safe-area-inset-bottom) + 1.5rem);
  animation: modal-slide-up 0.3s ease-out;
}

@keyframes modal-slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Header */
.header {
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-title {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text-primary);
}

/* Section heading */
.section-heading {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-confirmed {
  background: rgba(91, 154, 125, 0.15);
  color: var(--color-success);
}

.status-pending {
  background: rgba(181, 148, 58, 0.15);
  color: var(--color-warning);
}

.status-cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

/* AI Advisor */
.quick-question-btn {
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}

.quick-question-btn:hover,
.quick-question-btn:active {
  background: var(--color-primary);
  color: white;
}

/* Chat message bubbles for AI Advisor */
.message-sent {
  background: var(--color-primary);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  border-bottom-right-radius: 0.25rem;
  margin-left: auto;
  max-width: 85%;
}

.message-received {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  border-bottom-left-radius: 0.25rem;
  max-width: 85%;
  white-space: pre-wrap;
  line-height: 1.5;
}
