/* JapanCart - Premium Design System */

:root {
  --japan-red: #C8102E;
  --japan-red-light: #e8192e;
  --japan-red-dark: #a00d25;
  --japan-dark: #0a0a0a;
  --font-primary: 'Inter', 'Noto Sans JP', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  color: #111827;
  background: #fff;
  line-height: 1.6;
}

/* ─── Buttons ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--japan-red);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--japan-red-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(200, 16, 46, 0.3);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: #111827;
  border: 1.5px solid #e5e7eb;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* ─── Form Inputs ─── */
.input-field {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font-primary);
  color: #111827;
  background: white;
  transition: all 0.2s;
  outline: none;
  -webkit-appearance: none;
}

.input-field:focus {
  border-color: var(--japan-red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}

.input-field::placeholder {
  color: #9ca3af;
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

/* ─── Cards ─── */
.card {
  background: white;
  border: 1.5px solid #f3f4f6;
  border-radius: 16px;
  padding: 24px;
  transition: all 0.2s;
}

.card:hover {
  border-color: #e5e7eb;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.card-elevated {
  background: white;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  padding: 28px;
}

/* ─── Status Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-red { background: #fef2f2; color: #b91c1c; }
.badge-yellow { background: #fffbeb; color: #92400e; }
.badge-green { background: #f0fdf4; color: #15803d; }
.badge-blue { background: #eff6ff; color: #1d4ed8; }
.badge-purple { background: #f5f3ff; color: #6d28d9; }
.badge-gray { background: #f9fafb; color: #6b7280; }
.badge-orange { background: #fff7ed; color: #c2410c; }

/* ─── Navigation ─── */
#main-header {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#main-header.scrolled {
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

/* ─── Hero Section ─── */
.hero-gradient {
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #fff8f9 40%,
    #ffffff 70%,
    #fafafa 100%
  );
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff1f3;
  color: var(--japan-red);
  border: 1px solid #fecdd3;
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ─── Japan Pattern Background ─── */
.japan-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C8102E' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ─── Store Logos ─── */
.store-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1.5px solid #f3f4f6;
  border-radius: 14px;
  padding: 16px 20px;
  transition: all 0.2s;
  color: #6b7280;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  min-height: 70px;
}

.store-logo:hover {
  border-color: #e5e7eb;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  color: var(--japan-red);
  transform: translateY(-2px);
}

/* ─── How It Works Timeline ─── */
.step-connector {
  width: 2px;
  background: linear-gradient(to bottom, var(--japan-red), #fecdd3);
  margin-left: 24px;
  height: 40px;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.step-number-active {
  background: var(--japan-red);
  color: white;
  box-shadow: 0 4px 16px rgba(200, 16, 46, 0.3);
}

.step-number-inactive {
  background: #f9fafb;
  color: #9ca3af;
  border: 2px solid #f3f4f6;
}

/* ─── Pricing Cards ─── */
.pricing-card {
  border-radius: 20px;
  padding: 32px;
  position: relative;
  transition: all 0.3s;
}

.pricing-card-default {
  background: white;
  border: 1.5px solid #e5e7eb;
}

.pricing-card-featured {
  background: var(--japan-red);
  color: white;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
}

/* ─── Rewards / Rank ─── */
.rank-card {
  border-radius: 16px;
  padding: 20px;
  border: 1.5px solid transparent;
  transition: all 0.2s;
}

.rank-regular { background: linear-gradient(135deg, #f9fafb, #f3f4f6); border-color: #e5e7eb; }
.rank-silver  { background: linear-gradient(135deg, #f8fafc, #e2e8f0); border-color: #cbd5e1; }
.rank-gold    { background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #fde68a; }
.rank-platinum { background: linear-gradient(135deg, #f5f3ff, #ede9fe); border-color: #c4b5fd; }

/* ─── Dashboard Sidebar ─── */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  transition: all 0.15s;
}

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

.sidebar-link.active {
  background: #fff1f3;
  color: var(--japan-red);
}

.sidebar-link .icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

/* ─── Package Card ─── */
.package-card {
  border: 1.5px solid #f3f4f6;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s;
}

.package-card:hover {
  border-color: #e5e7eb;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.package-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f9fafb;
}

.package-photo-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #f9fafb, #f3f4f6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #9ca3af;
}

/* ─── Notification Dot ─── */
.notif-dot {
  width: 8px;
  height: 8px;
  background: var(--japan-red);
  border-radius: 50%;
  position: absolute;
  top: -2px;
  right: -2px;
}

/* ─── Progress Bar ─── */
.progress-bar {
  height: 6px;
  background: #f3f4f6;
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--japan-red), var(--japan-red-light));
  border-radius: 100px;
  transition: width 1s ease;
}

/* ─── Section Headings ─── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--japan-red);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: #0a0a0a;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 18px;
  color: #6b7280;
  font-weight: 400;
  line-height: 1.6;
  margin-top: 12px;
  max-width: 560px;
}

/* ─── Table ─── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1.5px solid #f3f4f6;
  background: #fafafa;
}

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid #f9fafb;
  color: #374151;
}

.data-table tr:hover td {
  background: #fafafa;
}

/* ─── Alert ─── */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  transform: scale(0.95) translateY(16px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open .modal-content {
  transform: scale(1) translateY(0);
}

/* ─── Animations ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.2); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }

/* ─── Shipping Comparison Table ─── */
.shipping-row-ems    { border-left: 3px solid #6b7280; }
.shipping-row-dhl    { border-left: 3px solid #E8B500; }
.shipping-row-fedex  { border-left: 3px solid #4D148C; }

/* ─── Floating action button ─── */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 40;
  text-decoration: none;
  transition: all 0.2s;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 32px rgba(37, 211, 102, 0.5);
}

/* ─── Admin Specific ─── */
.admin-sidebar {
  width: 256px;
  flex-shrink: 0;
  background: #0a0a0a;
  min-height: 100vh;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #9ca3af;
  text-decoration: none;
  transition: all 0.15s;
}

.admin-nav-link:hover {
  color: white;
  background: rgba(255,255,255,0.08);
}

.admin-nav-link.active {
  color: white;
  background: var(--japan-red);
}

/* ─── Responsive Helpers ─── */
@media (max-width: 768px) {
  .section-title { font-size: 28px; }
  .section-subtitle { font-size: 16px; }

  .hide-mobile { display: none !important; }
  
  .modal-content {
    padding: 24px 20px;
    border-radius: 16px;
  }
}

/* ─── Dark mode (minimal) ─── */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] body {
    background: #0a0a0a;
    color: #f9fafb;
  }
}

/* ─── Custom Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f9fafb; }
::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: #d1d5db; }

/* ─── Link defaults ─── */
a { text-decoration: none; color: inherit; }

/* ─── Japan decorative element ─── */
.japan-divider {
  display: flex;
  align-items: center;
  gap: 16px;
}

.japan-divider::before,
.japan-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #f3f4f6;
}

/* ─── Feature highlight ─── */
.feature-icon {
  width: 48px;
  height: 48px;
  background: #fff1f3;
  color: var(--japan-red);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* ─── Tooltip ─── */
.tooltip {
  position: relative;
}

.tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: white;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 50;
}

/* ─── Loading spinner ─── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Section spacing ─── */
.section {
  padding: 80px 0;
}

@media (max-width: 768px) {
  .section { padding: 60px 0; }
}

/* ─── CMS Article ─── */
.article-content h1 { font-size: 32px; font-weight: 700; margin-bottom: 16px; }
.article-content h2 { font-size: 24px; font-weight: 600; margin: 32px 0 12px; }
.article-content h3 { font-size: 18px; font-weight: 600; margin: 24px 0 10px; }
.article-content p  { margin-bottom: 16px; color: #374151; line-height: 1.75; }
.article-content ul { margin: 12px 0 16px 24px; }
.article-content li { margin-bottom: 8px; color: #374151; }
.article-content a  { color: var(--japan-red); text-decoration: underline; }

/* ─── Trust badges ─── */
.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
}

.trust-badge .check {
  width: 18px;
  height: 18px;
  background: #f0fdf4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #15803d;
  font-size: 10px;
  flex-shrink: 0;
}
