/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0f0f13;
  --bg-secondary: #1a1a24;
  --bg-card: #22222e;
  --bg-card-hover: #2a2a38;
  --text-primary: #f0f0f5;
  --text-secondary: #9999aa;
  --accent-primary: #6c5ce7;
  --accent-secondary: #a29bfe;
  --accent-red: #ff6b6b;
  --accent-green: #43e97b;
  --accent-blue: #4facfe;
  --accent-pink: #f093fb;
  --accent-orange: #fca311;
  --border-color: #2a2a3a;
  --sidebar-width: 260px;
  --instagram-gradient: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

body {
  font-family: 'Noto Sans JP', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent-secondary); text-decoration: none; }
h1, h2, h3, h4 { font-weight: 700; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #666; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.3rem;
  font-weight: 900;
}

.logo i {
  color: var(--accent-red);
  font-size: 1.5rem;
}

.nav-menu {
  list-style: none;
  padding: 12px 8px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  margin-bottom: 2px;
  font-size: 0.9rem;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-primary);
  color: white;
}

.nav-item i {
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.restaurant-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.restaurant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.restaurant-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.restaurant-plan {
  font-size: 0.7rem;
  color: var(--accent-orange);
}

/* ===== Main Content ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.notification-bell {
  position: relative;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.notification-bell .badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--accent-red);
  color: white;
  font-size: 0.6rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--accent-green);
  background: rgba(67, 233, 123, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ===== Pages ===== */
.page {
  display: none;
  padding: 32px;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

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

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border-color);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 900;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.stat-change {
  font-size: 0.75rem;
  margin-top: 2px;
}

.stat-change.positive { color: var(--accent-green); }
.stat-change.negative { color: var(--accent-red); }

/* ===== AI Insight Card ===== */
.ai-insight-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent-primary);
  margin-bottom: 28px;
  overflow: hidden;
}

.ai-insight-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(108, 92, 231, 0.1);
  border-bottom: 1px solid var(--border-color);
}

.ai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.ai-insight-header h3 {
  font-size: 0.95rem;
}

.timestamp {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ai-insight-body {
  padding: 20px;
}

.ai-insight-body p {
  margin-bottom: 12px;
  line-height: 1.7;
  font-size: 0.9rem;
}

/* ===== Section Header ===== */
.section-header {
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 1.2rem;
}

/* ===== Posts Performance ===== */
.posts-performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.post-perf-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: transform 0.2s;
}

.post-perf-card:hover {
  transform: translateY(-2px);
}

.post-perf-image {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  position: relative;
}

.post-type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
}

.post-perf-info {
  padding: 16px;
}

.post-perf-info h4 {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.post-perf-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.post-perf-stats i {
  margin-right: 4px;
  color: var(--accent-red);
}

.post-perf-bar {
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--instagram-gradient);
  transition: width 1s ease;
}

.perf-score {
  font-size: 0.75rem;
  color: var(--accent-green);
}

/* ===== Analysis Page ===== */
.analysis-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.analysis-source-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.source-tag {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.source-tag.active {
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
  background: rgba(108, 92, 231, 0.1);
}

/* Analysis Progress */
.analysis-progress {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.3;
  transition: opacity 0.5s;
  font-size: 0.8rem;
}

.progress-step.active {
  opacity: 1;
}

.progress-step.done {
  opacity: 1;
}

.progress-step.done .step-icon {
  background: var(--accent-green);
}

.step-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.progress-bar-container {
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--instagram-gradient);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Ranking */
.menu-ranking {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
}

.menu-ranking > h3 {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

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

.ranking-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: transform 0.2s;
}

.ranking-item:hover {
  transform: translateX(4px);
}

.rank {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.rank.gold { background: linear-gradient(135deg, #f9ca24, #f0932b); color: #1a1a24; }
.rank.silver { background: linear-gradient(135deg, #dfe6e9, #b2bec3); color: #1a1a24; }
.rank.bronze { background: linear-gradient(135deg, #e17055, #d63031); color: white; }

.menu-visual {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.menu-info {
  flex: 1;
}

.menu-info h4 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.menu-metrics {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.metric-label {
  width: 85px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.metric-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

.metric-value {
  width: 28px;
  text-align: right;
  font-weight: 700;
}

.menu-tags {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.menu-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-secondary);
}

.menu-tag.hot {
  background: rgba(255, 107, 107, 0.15);
  color: var(--accent-red);
}

.menu-score {
  text-align: center;
  flex-shrink: 0;
}

.score-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-circle span {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--accent-green);
}

.menu-score small {
  font-size: 0.65rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 4px;
}

/* ===== Suggestion Page ===== */
.suggest-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.suggest-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: transform 0.2s;
}

.suggest-card:hover {
  transform: translateY(-2px);
}

.suggest-card.priority-high {
  border-color: var(--accent-red);
}

.suggest-priority {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(0,0,0,0.2);
}

.priority-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.priority-badge.high { background: var(--accent-red); color: white; }
.priority-badge.medium { background: var(--accent-primary); color: white; }
.priority-badge.ugc { background: var(--accent-green); color: #1a1a24; }

.suggest-timing {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.suggest-content {
  padding: 20px;
}

.suggest-type {
  font-size: 0.8rem;
  color: var(--accent-blue);
  margin-bottom: 8px;
}

.suggest-content h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.suggest-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.suggest-reason {
  background: rgba(108, 92, 231, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
}

.reason-header {
  font-size: 0.8rem;
  color: var(--accent-secondary);
  font-weight: 600;
  margin-bottom: 8px;
}

.suggest-reason ul {
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.suggest-reason li {
  padding: 2px 0;
}

.suggest-reason li::before {
  content: "→ ";
  color: var(--accent-green);
}

.suggest-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.suggest-tags span {
  padding: 4px 10px;
  background: var(--bg-primary);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--accent-blue);
}

.suggest-preview {
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.suggest-preview h4 {
  font-size: 0.85rem;
  margin-bottom: 10px;
  color: var(--accent-secondary);
}

.caption-preview {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-line;
}

.suggest-actions {
  display: flex;
  gap: 10px;
  padding: 0 20px 20px;
  flex-wrap: wrap;
}

.expected-performance {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border-color);
}

.expected-performance h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.perf-predictions {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.pred {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.pred strong {
  color: var(--text-primary);
}

.pred i {
  color: var(--accent-secondary);
}

/* ===== Buttons ===== */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background: #5a4bd1;
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: var(--bg-card);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
}

.btn-instagram {
  background: var(--instagram-gradient);
  color: white;
  font-size: 1rem;
  padding: 14px 28px;
}

.btn-instagram:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(225, 48, 108, 0.4);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.75rem;
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

/* ===== Image Generation Page ===== */
.generate-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
}

.generate-sidebar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
  height: fit-content;
}

.generate-sidebar h3 {
  margin-bottom: 20px;
  font-size: 1rem;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-select, .form-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
}

.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.style-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.style-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.style-option:hover {
  border-color: var(--border-color);
}

.style-option.active {
  border-color: var(--accent-primary);
  background: rgba(108, 92, 231, 0.1);
}

.style-preview {
  width: 100%;
  height: 48px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.style-option span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.aspect-options {
  display: flex;
  gap: 8px;
}

.aspect-btn {
  flex: 1;
  padding: 8px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.aspect-btn.active {
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
  background: rgba(108, 92, 231, 0.1);
}

.generate-canvas {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
}

.canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.canvas-actions {
  display: flex;
  gap: 6px;
}

.canvas-area {
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.canvas-placeholder {
  text-align: center;
  color: var(--text-secondary);
}

.canvas-placeholder i {
  margin-bottom: 16px;
  opacity: 0.3;
}

/* Generated Image Mock */
.generated-image {
  width: 100%;
  padding: 24px;
}

.gen-image-mock {
  max-width: 400px;
  margin: 0 auto;
}

.mock-image-bg {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #1a0a0a, #4a1a1a, #1a0a0a);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.mock-flame-effect {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: radial-gradient(ellipse at bottom, rgba(255, 107, 107, 0.3), rgba(255, 165, 0, 0.15), transparent);
  animation: flicker 2s infinite alternate;
}

@keyframes flicker {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

.mock-meat-icon {
  color: #ff6b6b;
  z-index: 1;
  filter: drop-shadow(0 0 20px rgba(255, 107, 107, 0.5));
}

.mock-overlay-text {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 1.5rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.mock-logo {
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  font-weight: 700;
}

.gen-variations {
  margin-top: 16px;
}

.gen-variations h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.variation-grid {
  display: flex;
  gap: 10px;
}

.variation-item {
  flex: 1;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.2s;
}

.variation-item.active {
  border-color: var(--accent-primary);
}

.var-mock {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  border-radius: 6px;
}

/* Generation Progress */
.gen-progress {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 19, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.gen-progress-content {
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

.gen-progress-bar {
  width: 200px;
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
  margin: 12px auto;
}

.gen-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--instagram-gradient);
  border-radius: 2px;
  transition: width 0.3s;
}

/* ===== Customer Page ===== */
.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

.customer-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
}

.customer-card.full-width {
  grid-column: 1 / -1;
}

.card-header-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 16px;
}

.customer-card > h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.customer-card > p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Photo Spots */
.photo-spot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.photo-spot-item {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
}

.spot-visual {
  height: 100px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 12px;
  position: relative;
}

.spot-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
}

.photo-spot-item h4 {
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.photo-spot-item p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

.spot-stats {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--accent-secondary);
}

/* QR System */
.qr-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.qr-step {
  text-align: center;
  position: relative;
}

.qr-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  margin: 0 auto 8px;
}

.qr-step-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 1.2rem;
  color: var(--accent-secondary);
}

.qr-step p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.qr-arrow {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.qr-preview-container {
  text-align: center;
}

.qr-mockup {
  display: inline-block;
  margin-bottom: 16px;
}

.qr-card-design {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  width: 220px;
  text-align: center;
  color: #333;
}

.qr-card-header {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.qr-code-placeholder {
  color: #333;
  margin-bottom: 12px;
}

.qr-card-footer p {
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.qr-reward {
  font-size: 1rem !important;
  font-weight: 700;
  color: #e84393;
}

/* Photo Guide */
.photo-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.guide-item {
  text-align: center;
}

.guide-visual {
  position: relative;
  margin-bottom: 10px;
}

.guide-do {
  font-size: 0.65rem;
  color: var(--accent-green);
  font-weight: 700;
  margin-bottom: 6px;
}

.guide-img {
  height: 100px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.guide-item h4 {
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.guide-item p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Staff Manual */
.staff-manual {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.manual-scenario {
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border-color);
}

.scenario-timing {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.scenario-script {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 10px;
  background: rgba(108, 92, 231, 0.05);
  border-radius: 6px;
  border-left: 3px solid var(--accent-primary);
  margin-bottom: 10px;
}

.scenario-effect {
  font-size: 0.8rem;
  color: var(--accent-green);
}

/* ===== Schedule Page ===== */
.schedule-calendar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
  margin-bottom: 28px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-header {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 8px;
  font-weight: 600;
}

.cal-day {
  text-align: center;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.cal-day:hover {
  background: var(--bg-card-hover);
}

.cal-day.other {
  color: var(--text-secondary);
  opacity: 0.3;
}

.cal-day.today {
  background: var(--accent-primary);
  color: white;
  font-weight: 700;
}

.cal-day.scheduled {
  border: 1px dashed var(--accent-secondary);
}

.cal-day.has-post {
  padding-bottom: 20px;
}

.cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.cal-day .cal-dot:nth-child(2) {
  left: calc(50% + 10px);
}

.cal-dot.feed { background: var(--accent-blue); }
.cal-dot.reel { background: var(--accent-red); }
.cal-dot.story { background: var(--accent-orange); }

.calendar-legend {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.calendar-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-legend .cal-dot {
  position: static;
  transform: none;
}

/* Upcoming Posts */
.upcoming-posts h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upcoming-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s;
}

.upcoming-item:hover {
  transform: translateX(4px);
}

.upcoming-date {
  text-align: center;
  background: var(--bg-primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  min-width: 60px;
}

.date-day {
  font-size: 1.4rem;
  font-weight: 900;
}

.date-month {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.upcoming-info {
  flex: 1;
}

.post-type {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 4px;
}

.post-type.reel { background: rgba(255,107,107,0.15); color: var(--accent-red); }
.post-type.feed { background: rgba(79,172,254,0.15); color: var(--accent-blue); }
.post-type.story { background: rgba(252,163,17,0.15); color: var(--accent-orange); }

.upcoming-info h4 {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.upcoming-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.status-badge {
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.status-badge.ready { background: rgba(67,233,123,0.15); color: var(--accent-green); }
.status-badge.progress { background: rgba(108,92,231,0.15); color: var(--accent-secondary); }
.status-badge.pending { background: rgba(252,163,17,0.15); color: var(--accent-orange); }
.status-badge.draft { background: rgba(153,153,170,0.15); color: var(--text-secondary); }

/* ===== Post Management Page ===== */
.post-manager {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

.post-preview-section h3, .post-settings-section h3 {
  font-size: 1rem;
  margin-bottom: 16px;
}

/* Phone Mockup */
.phone-mockup {
  display: flex;
  justify-content: center;
}

.phone-frame {
  width: 320px;
  background: #000;
  border-radius: 36px;
  padding: 12px;
  border: 3px solid #333;
}

.phone-notch {
  width: 120px;
  height: 28px;
  background: #000;
  margin: 0 auto 8px;
  border-radius: 0 0 16px 16px;
  border: 2px solid #222;
}

.phone-screen {
  background: #fafafa;
  border-radius: 24px;
  overflow: hidden;
}

.insta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: white;
}

.insta-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.insta-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.insta-username {
  font-size: 0.8rem;
  font-weight: 600;
  color: #262626;
}

.insta-header i {
  color: #262626;
}

.insta-image {
  aspect-ratio: 1;
  overflow: hidden;
}

.mock-insta-post {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a0a0a, #4a1a1a, #1a0a0a);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  color: white;
}

.mock-flame-bg {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: radial-gradient(ellipse at bottom, rgba(255, 107, 107, 0.4), transparent);
}

.mock-insta-post .mock-text-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 1.2rem;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.mock-insta-post .fa-drumstick-bite {
  filter: drop-shadow(0 0 20px rgba(255, 107, 107, 0.6));
  z-index: 1;
}

.insta-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: white;
}

.insta-left-actions {
  display: flex;
  gap: 14px;
}

.insta-actions i {
  font-size: 1.2rem;
  color: #262626;
  cursor: pointer;
}

.insta-likes {
  padding: 0 12px 6px;
  font-size: 0.8rem;
  color: #262626;
  background: white;
}

.insta-caption {
  padding: 0 12px 14px;
  font-size: 0.8rem;
  color: #262626;
  line-height: 1.4;
  background: white;
}

/* Post Settings */
.post-settings-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
}

.form-textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
  line-height: 1.6;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Hashtag Analysis */
.hashtag-analysis {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.hashtag-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: var(--bg-primary);
  border-radius: 6px;
}

.hashtag-item span {
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 120px;
  color: var(--accent-blue);
}

.hashtag-item.great span {
  color: var(--accent-green);
}

.hashtag-metric {
  flex: 1;
}

.hashtag-metric small {
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

.mini-bar {
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
}

.mini-fill {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 2px;
}

.hashtag-item.great .mini-fill {
  background: var(--accent-green);
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Timing Options */
.timing-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.timing-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.timing-option:hover {
  border-color: var(--accent-primary);
}

.timing-option.active {
  border-color: var(--accent-primary);
  background: rgba(108, 92, 231, 0.1);
}

.timing-option i {
  font-size: 1.2rem;
  color: var(--accent-secondary);
}

.timing-option span {
  font-size: 0.8rem;
  font-weight: 600;
}

.timing-option small {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.post-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
}

.success-animation {
  margin-bottom: 20px;
}

.success-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin: 0 auto;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.success-modal h2 {
  margin-bottom: 8px;
}

.success-modal p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.success-details {
  text-align: left;
  margin-bottom: 24px;
}

.success-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.success-item i {
  color: var(--accent-green);
  width: 20px;
  text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .generate-layout {
    grid-template-columns: 1fr;
  }
  .post-manager {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .menu-toggle {
    display: block;
  }
  .page {
    padding: 16px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .posts-performance-grid {
    grid-template-columns: 1fr;
  }
  .customer-grid {
    grid-template-columns: 1fr;
  }
  .ranking-item {
    flex-wrap: wrap;
  }
  .timing-options {
    grid-template-columns: 1fr;
  }
  .qr-flow {
    flex-direction: column;
  }
  .qr-arrow {
    transform: rotate(90deg);
  }
}

/* ===== Animation for Approved Posts ===== */
.suggest-card.approved {
  border-color: var(--accent-green);
  position: relative;
}

.suggest-card.approved::after {
  content: "承認済み";
  position: absolute;
  top: 12px;
  right: 20px;
  background: var(--accent-green);
  color: #1a1a24;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ===== Loading Shimmer ===== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
