:root {
  /* Futuristic & Dark Aesthetic */
  --ds-bg: #050505;
  --ds-card-bg: #121214;
  --ds-card-hover: #1a1a1d;
  --ds-accent-primary: #f0f0f0;
  --ds-accent-secondary: #a0a0a0;
  --ds-streak-glow: rgba(255, 120, 0, 0.3);
  --ds-fire: #ff6b00;
  --ds-fire-gradient: linear-gradient(180deg, #ff9500 0%, #ff4d00 100%);
  --ds-glass: rgba(255, 255, 255, 0.05);
  --ds-border: rgba(255, 255, 255, 0.1);
  
  /* Typography - Clean & Modern */
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "Roboto Mono", monospace;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* Animation */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes glow {
  0% { filter: drop-shadow(0 0 5px var(--ds-fire)); }
  50% { filter: drop-shadow(0 0 20px var(--ds-fire)); }
  100% { filter: drop-shadow(0 0 5px var(--ds-fire)); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-display);
  background-color: var(--ds-bg);
  color: var(--ds-accent-primary);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% -20%, #1a1a1a 0%, transparent 50%),
    radial-gradient(circle at 0% 100%, #111 0%, transparent 40%);
  background-attachment: fixed;
}

.app-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  padding: var(--space-xl) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  box-sizing: border-box;
}

/* Header & Controls */
.header-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: -16px;
}

.icon-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--ios-secondary-label);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.icon-btn:active {
  opacity: 0.5;
}

/* Streak Section */
.streak-container {
  text-align: center;
  padding: var(--space-3xl) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.streak-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.fire-icon {
  width: 120px;
  height: 120px;
  color: var(--ds-fire);
  animation: float 4s ease-in-out infinite, glow 3s ease-in-out infinite;
  z-index: 1;
}

.streak-glow-orb {
  position: absolute;
  width: 180px;
  height: 180px;
  background: var(--ds-fire);
  filter: blur(80px);
  opacity: 0.2;
  border-radius: 50%;
}

.streak-number {
  font-size: 6rem;
  font-weight: 900;
  letter-spacing: -4px;
  margin: 0;
  background: linear-gradient(180deg, #fff 40%, #888 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.streak-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ds-accent-secondary);
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-top: -10px;
}

/* Input Section */
.stack-input-area {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.main-input {
  width: 100%;
  border: 1px solid var(--ds-border);
  background: var(--ds-card-bg);
  border-radius: 24px;
  padding: 24px 60px 24px 24px;
  font-size: 1.1rem;
  font-family: inherit;
  color: #fff;
  transition: all 0.4s var(--ease-out);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.main-input:focus {
  outline: none;
  border-color: rgba(255,255,255,0.4);
  background: #1a1a1d;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 20px 40px rgba(0,0,0,0.5);
  transform: translateY(-2px);
}

.voice-trigger {
  position: absolute;
  right: 20px;
  color: var(--ds-accent-secondary);
  transition: color 0.3s;
}

.voice-trigger:hover {
  color: #fff;
}

.primary-btn {
  background: #fff;
  color: #000;
  border: none;
  border-radius: 24px;
  padding: 24px;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(255,255,255,0.1);
}

.primary-btn:hover {
  transform: translateY(-2px);
  background: #f0f0f0;
  box-shadow: 0 15px 40px rgba(255,255,255,0.2);
}

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

/* Settings Icon Adjustment */
.header-nav .icon-btn svg {
  stroke: var(--ds-accent-secondary);
  transition: stroke 0.3s;
}

.header-nav .icon-btn:hover svg {
  stroke: #fff;
}

/* Scrollbar styling for that extra polish */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--ds-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--ds-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ds-accent-secondary);
}

.primary-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* AI Reflection */
.ai-reflection {
  background: var(--ds-card-bg);
  border-radius: 32px;
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ds-border);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.ai-reflection::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  background-size: 200% 100%;
  animation: shimmer 4s infinite linear;
}

.ai-tag {
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--ds-accent-secondary);
  text-transform: uppercase;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 2px;
}

.ai-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #00ffaa;
  border-radius: 50%;
  box-shadow: 0 0 10px #00ffaa;
}

.ai-content {
  font-size: 1.15rem;
  line-height: 1.5;
  color: #fff;
  font-style: italic;
  margin: 0;
  font-weight: 400;
  position: relative;
}

/* History Section */
.history-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ios-secondary-label);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-xs);
}

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

.history-item {
  background: var(--ds-card-bg);
  border: 1px solid var(--ds-border);
  border-radius: 20px;
  padding: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
  transition: all 0.3s var(--ease-out);
}

.history-item:hover {
  background: var(--ds-card-hover);
  transform: translateX(4px);
  border-color: rgba(255,255,255,0.2);
}

.history-date {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ds-accent-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  min-width: 80px;
  font-family: var(--font-mono);
}

.history-text {
  font-size: 1rem;
  flex: 1;
  font-weight: 500;
}

.history-check {
  color: #00ffaa;
  filter: drop-shadow(0 0 5px rgba(0,255,170,0.5));
}

/* Success State Styles */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.4s ease-out forwards;
}

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

.success-icon {
  width: 80px;
  height: 80px;
  color: var(--ios-green);
  margin-bottom: var(--space-lg);
  animation: scaleUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleUp {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.success-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.success-subtitle {
  color: var(--ios-secondary-label);
  text-align: center;
  padding: 0 var(--space-xl);
}

/* Utilities */
.placeholder-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ios-secondary-bg);
}

/* Media Queries for full-width on web */
@media (min-width: 600px) {
  .app-container {
    max-width: 500px;
    border: 1px solid var(--ios-secondary-bg);
    margin: 40px auto;
    border-radius: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    min-height: 800px;
  }
}
