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

:root {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --surface-hover: #25253d;
  --border: #2a2a4a;
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --accent: #7c5cfc;
  --accent-glow: rgba(124, 92, 252, 0.3);
  --accent-hover: #9579ff;
  --green: #4ade80;
  --yellow: #fbbf24;
  --red: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  min-height: 100vh;
  line-height: 1.6;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2.5rem;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.3rem;
}

.pro-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #b44cfc);
  color: white;
  font-size: 0.6em;
  padding: 2px 10px;
  border-radius: 20px;
  vertical-align: middle;
  position: relative;
  top: -3px;
  letter-spacing: 1.5px;
}

.tagline {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Mode Selector */
.mode-selector {
  margin-bottom: 2rem;
}

.mode-label,
.situation-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.mode-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.5rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.mode-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--text);
}

.mode-btn.active {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 16px var(--accent-glow);
}

.mode-icon {
  font-size: 1.5rem;
}

.mode-text {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

/* Situation Cards */
.situation-selector {
  margin-bottom: 2rem;
}

.situation-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.situation-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.2rem 0.75rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.situation-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.situation-card:active {
  transform: translateY(0);
}

.situation-card.selected {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

.situation-icon {
  font-size: 1.8rem;
}

.situation-text {
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.3;
}

.situation-card:hover .situation-text,
.situation-card.selected .situation-text {
  color: var(--text);
}

/* Custom Add Card */
.custom-add-card {
  border-style: dashed !important;
  border-color: var(--text-muted) !important;
  opacity: 0.7;
}

.custom-add-card:hover {
  opacity: 1;
  border-color: var(--accent) !important;
  border-style: dashed !important;
}

.custom-add-card.selected {
  opacity: 1;
  border-color: var(--accent) !important;
  border-style: dashed !important;
}

/* Custom Input Row */
.custom-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
  animation: slideUp 0.3s ease;
}

.custom-input-row.hidden {
  display: none;
}

.custom-input {
  flex: 1;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.custom-input:focus {
  border-color: var(--accent);
}

.custom-input::placeholder {
  color: var(--text-muted);
}

.custom-go-btn {
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease;
}

.custom-go-btn:hover {
  background: var(--accent-hover);
}

/* Excuse Output */
.excuse-output {
  margin-bottom: 2rem;
  animation: slideUp 0.4s ease;
}

.excuse-output.hidden {
  display: none;
}

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

.excuse-card {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 0 30px var(--accent-glow);
}

.excuse-header {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.excuse-mode-badge,
.excuse-situation-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(124, 92, 252, 0.15);
  color: var(--accent-hover);
  border: 1px solid rgba(124, 92, 252, 0.3);
}

.excuse-situation-badge {
  background: rgba(74, 222, 128, 0.1);
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.2);
}

.excuse-text {
  font-size: 1.2rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  font-weight: 400;
  min-height: 3.4rem;
}

/* Credibility Meter */
.credibility-meter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.credibility-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.meter-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.5s ease;
  width: 0;
}

.credibility-value {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}

/* Action Buttons */
.excuse-actions {
  display: flex;
  gap: 0.6rem;
}

.btn-generate,
.btn-copy {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-generate:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.btn-copy:hover {
  border-color: var(--green);
  background: var(--surface-hover);
}

.btn-copy.copied {
  border-color: var(--green);
  color: var(--green);
}

/* Footer */
footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Responsive */
@media (max-width: 600px) {
  .app {
    padding: 1.5rem 1rem;
  }

  header h1 {
    font-size: 1.6rem;
  }

  .mode-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .situation-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .excuse-text {
    font-size: 1.05rem;
  }
}

@media (max-width: 380px) {
  .situation-cards {
    grid-template-columns: 1fr;
  }
}
