:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a24;
  --bg-card-hover: #22222e;
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #555566;
  --accent: #f4a7b9;
  --accent-light: #fcd5df;
  --accent-dark: #d4879a;
  --success: #7dcea0;
  --border: #2a2a3a;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* ===== LOGIN ===== */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #15151f 100%);
}

.login-container {
  text-align: center;
  padding: 3rem;
}

.login-header {
  margin-bottom: 2.5rem;
}

.login-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.login-header h1 {
  font-size: 2.5rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 280px;
  margin: 0 auto;
}

#login-form input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  text-align: center;
  transition: all 0.2s;
}

#login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244, 167, 185, 0.15);
}

#login-form button {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none;
  padding: 1rem;
  border-radius: 12px;
  color: var(--bg-primary);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#login-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(244, 167, 185, 0.3);
}

#login-error {
  color: #ff6b6b;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* ===== TICKER ===== */
.ticker-wrap {
  background: linear-gradient(90deg, #0d0d12 0%, #12121a 50%, #0d0d12 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 200;
}

.ticker {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0;
  animation: none;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  border-right: 1px solid var(--border);
  min-width: fit-content;
}

.ticker-item:last-child {
  border-right: none;
}

.ticker-icon {
  font-size: 1.1rem;
}

.ticker-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.ticker-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.ticker-change {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

/* Sakura ticker */
.ticker-item.sakura .ticker-value { color: #f4a7b9; }
.ticker-item.sakura .ticker-change { 
  background: rgba(244, 167, 185, 0.2); 
  color: #f4a7b9; 
}

/* Weather ticker */
.ticker-item.weather .ticker-value { color: #7dcea0; }
.ticker-item.weather .ticker-change { 
  background: rgba(125, 206, 160, 0.2); 
  color: #7dcea0; 
}

/* Fuji ticker */
.ticker-item.fuji .ticker-value { color: #87ceeb; }
.ticker-item.fuji .ticker-change.good { 
  background: rgba(125, 206, 160, 0.2); 
  color: #7dcea0; 
}
.ticker-item.fuji .ticker-change.medium { 
  background: rgba(255, 184, 107, 0.2); 
  color: #ffb86b; 
}
.ticker-item.fuji .ticker-change.poor { 
  background: rgba(255, 107, 107, 0.2); 
  color: #ff6b6b; 
}

/* Forecast ticker */
.ticker-item.forecast .ticker-value { color: #b4a7f4; }
.ticker-item.forecast .ticker-change { 
  background: rgba(180, 167, 244, 0.2); 
  color: #b4a7f4; 
}

@media (max-width: 800px) {
  .ticker {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .ticker-item {
    padding: 0.6rem 1rem;
  }
  
  .ticker-label {
    display: none;
  }
}

/* ===== HEADER ===== */
header {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
  padding: 1.5rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.flag {
  font-size: 2.5rem;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.subtitle {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
}

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

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex;
  gap: 1rem;
  padding: 0 2rem;
  max-width: 1400px;
  margin: 0 auto 1.5rem;
  overflow-x: auto;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 140px;
  transition: all 0.2s;
}

.stat-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.photo-stat {
  cursor: pointer;
}

.stat-icon {
  font-size: 1.75rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-light);
  display: block;
}

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

/* ===== PROGRESS ===== */
.progress-section {
  padding: 0 2rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== MAIN LAYOUT ===== */
main {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 0 2rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ===== TIMELINE ===== */
.timeline {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  height: fit-content;
  max-height: 60vh;
  overflow-y: auto;
}

.timeline::-webkit-scrollbar {
  width: 4px;
}

.timeline::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.25rem;
}

.timeline-item:hover {
  background: var(--bg-card-hover);
}

.timeline-item.active {
  background: rgba(244, 167, 185, 0.15);
}

.timeline-item.today {
  border-left: 3px solid var(--accent);
}

.timeline-item.past {
  opacity: 0.6;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.timeline-item.today .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.timeline-item.completed .timeline-dot {
  background: var(--success);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  width: 45px;
}

.timeline-city {
  font-size: 0.9rem;
  font-weight: 500;
}

.city-tokyo { color: #ff6b9d; }
.city-kyoto { color: #9d6bff; }
.city-nara { color: #6bff9d; }
.city-osaka { color: #ffb86b; }

/* ===== DAY VIEW ===== */
.day-view {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.day-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.day-badge {
  background: rgba(244, 167, 185, 0.2);
  color: var(--accent);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.activities {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.activity {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.activity.completed {
  opacity: 0.6;
}

.activity.completed .activity-text {
  text-decoration: line-through;
}

.activity-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.activity.completed .activity-check {
  background: var(--success);
  border-color: var(--success);
}

.activity-check::after {
  content: '✓';
  color: var(--bg-primary);
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0;
}

.activity.completed .activity-check::after {
  opacity: 1;
}

.activity-text {
  font-size: 1rem;
}

.activity-tip {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 200px;
  text-align: right;
}

.day-notes textarea {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 80px;
}

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

/* ===== HIGHLIGHTS ===== */
.highlights-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}

.highlights-section h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.highlights-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.highlight-tag {
  background: rgba(244, 167, 185, 0.15);
  border: 1px solid rgba(244, 167, 185, 0.3);
  color: var(--accent-light);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

.add-highlight {
  display: flex;
  gap: 0.5rem;
}

.add-highlight input {
  flex: 1;
  max-width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.add-highlight input:focus {
  outline: none;
  border-color: var(--accent);
}

.add-highlight button {
  background: var(--accent);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--bg-primary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.add-highlight button:hover {
  background: var(--accent-light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }
  
  .timeline {
    display: flex;
    overflow-x: auto;
    max-height: none;
    gap: 0.5rem;
  }
  
  .timeline-item {
    flex-direction: column;
    min-width: 70px;
    text-align: center;
    margin-bottom: 0;
  }
  
  .stats-bar {
    flex-wrap: wrap;
  }
  
  .stat-card {
    min-width: calc(50% - 0.5rem);
  }
}

@media (max-width: 500px) {
  header, .stats-bar, main, .progress-section, .highlights-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .day-view {
    padding: 1.25rem;
  }
}
