/* ========================================
   AURA.LOG - Sleep Calculator Style
   ======================================== */

:root {
  --bg-gradient-start: #1a1a2e;
  --bg-gradient-end: #16213e;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  
  /* Fortune colors */
  --excellent: #22c55e;
  --good: #84cc16;
  --neutral: #eab308;
  --caution: #f97316;
  --low: #ef4444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ========================================
   Layout
   ======================================== */

#app {
  min-height: 100vh;
}

/* Language Switcher */
.lang-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  color: var(--accent-light);
  font-weight: 600;
}

.lang-divider {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 40px 20px;
  animation: fadeIn 0.5s ease;
}

.screen.active {
  display: block;
}

/* Input screen layout - title at top, card centered */
#input-screen {
  display: none;
}

#input-screen.active {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#input-screen .container {
  display: flex;
  flex-direction: column;
  flex: 1;
}

#input-screen .main-title,
#input-screen .main-subtitle {
  flex-shrink: 0;
}

#input-screen .card {
  margin-top: auto;
  margin-bottom: auto;
}

#input-screen .privacy-note {
  flex-shrink: 0;
  margin-top: auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  box-sizing: border-box;
}

/* ========================================
   Typography
   ======================================== */

.main-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.main-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-weight: 300;
}

/* ========================================
   Card
   ======================================== */

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 40px 30px;
  backdrop-filter: blur(10px);
  margin-bottom: 30px;
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 30px;
  color: var(--text-primary);
}

/* ========================================
   Wheel Picker
   ======================================== */

.wheel-picker-group {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 30px;
}

.wheel-picker-group.time-picker {
  margin-bottom: 0;
  margin-top: 20px;
}

.wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wheel-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  font-weight: 500;
}

.wheel-wrapper {
  position: relative;
  height: 120px;
  width: 80px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.wheel-wrapper.small {
  width: 70px;
  height: 100px;
}

.wheel-wrapper::before,
.wheel-wrapper::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 40px;
  pointer-events: none;
  z-index: 2;
}

.wheel-wrapper::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg-gradient-start) 0%, transparent 100%);
}

.wheel-wrapper::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg-gradient-start) 0%, transparent 100%);
}

.wheel-wrapper.small::before,
.wheel-wrapper.small::after {
  height: 30px;
}

.wheel-highlight {
  position: absolute;
  top: 50%;
  left: 5px;
  right: 5px;
  height: 32px;
  transform: translateY(-50%);
  background: rgba(124, 58, 237, 0.3);
  border-radius: 8px;
  pointer-events: none;
  z-index: 1;
}

.wheel {
  position: absolute;
  width: 100%;
  transition: transform 0.15s ease-out;
}

.wheel-item {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  font-weight: 400;
}

.wheel-item.selected {
  color: var(--text-primary);
  font-weight: 600;
}

.wheel-separator {
  font-size: 1.8rem;
  color: var(--text-secondary);
  align-self: center;
  margin-top: 30px;
  font-weight: 300;
}

/* ========================================
   Time Section
   ======================================== */

.time-section {
  margin-bottom: 30px;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.toggle-label:hover {
  color: var(--text-primary);
}

.toggle-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}

#time-input-wrapper {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
}

#time-input-wrapper.hidden {
  display: none;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ========================================
   Buttons
   ======================================== */

.primary-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #9333ea 100%);
  color: white;
  border: none;
  padding: 16px 50px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(124, 58, 237, 0.4);
}

.primary-btn:active {
  transform: translateY(0);
}

.back-btn {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 10px 24px;
  font-size: 0.9rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.back-btn:hover {
  background: var(--card-bg);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* ========================================
   Privacy Note
   ======================================== */

.privacy-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 30px;
}

/* ========================================
   Loading Screen
   ======================================== */

#processing-screen .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

.loader {
  width: 60px;
  height: 60px;
  border: 3px solid var(--card-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ========================================
   Result Screen
   ======================================== */

.result-date-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

/* Result Card - Single Card Layout */
.result-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 16px 32px;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
  text-align: left;
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.keyword-section {
  text-align: center;
  margin-bottom: 8px;
}

.keyword-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.keyword-text {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 12px 0;
  background: linear-gradient(135deg, var(--accent-light) 0%, #fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.keyword-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 300;
}

.divider {
  height: 1px;
  background: var(--card-border);
  margin: 24px 0;
}

/* Insights Section */
.insights-section {
  margin-bottom: 8px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.insights-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  animation: fadeInUp 0.4s ease-out forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.insight-item:last-child {
  border-bottom: none;
}

.insight-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.insight-content {
  flex: 1;
}

.insight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.insight-label {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 10px;
}

.insight-score {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.insight-score.positive {
  background: rgba(16, 185, 129, 0.2);
  color: var(--excellent);
}

.insight-score.negative {
  background: rgba(239, 68, 68, 0.2);
  color: var(--low);
}

.insight-text {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* 波纹线高亮样式 */
.highlight-good {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: #22c55e;
  text-underline-offset: 4px;
  color: var(--text-primary);
}

.highlight-bad {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: #ef4444;
  text-underline-offset: 4px;
  color: var(--text-primary);
}

/* Section 类型样式 */
.insight-item.section-positive .insight-label {
  color: #22c55e;
}

.insight-item.section-caution .insight-label {
  color: #ef4444;
}

.insight-item.positive .insight-label {
  color: var(--excellent);
}

.insight-item.negative .insight-label {
  color: var(--low);
}

/* Summary item styling */
.insight-item.summary-item {
  background: rgba(124, 58, 237, 0.1);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 14px;
  border-bottom: none;
}

.insight-item.summary-item .insight-text {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.85;
}

/* Dimension item styling */
.insight-item.dimension-item {
  padding: 20px 0;
}

.insight-item.dimension-item .insight-header {
  margin-bottom: 12px;
}

/* Highlight item styling */
.insight-item.highlight-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 18px;
  margin-top: 10px;
  border-bottom: none;
}

/* Lucky item styling */
.insight-item.lucky-item {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(124, 58, 237, 0.1));
  border-radius: 12px;
  padding: 20px;
  margin-top: 18px;
  border-bottom: none;
}

.insight-item.lucky-item .insight-text {
  font-size: 1.15rem;
  color: var(--text-secondary);
}

/* Guidance Section */
.guidance-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.guidance-block {
  padding: 20px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.guidance-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.guidance-title.do {
  color: var(--excellent);
}

.guidance-title.avoid {
  color: var(--low);
}

.guidance-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0;
}

/* Card Footer with Site URL */
.card-footer {
  margin-top: 28px;
  margin-bottom: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
  text-align: center;
}

.site-url {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-light);
  letter-spacing: 3px;
}

/* Result Privacy Note - positioned at bottom */
.result-privacy {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  margin: 0;
  padding: 0 20px;
}

/* Result screen needs relative positioning for absolute child */
#result-screen {
  position: relative;
  min-height: 100vh;
  padding-bottom: 60px;
}

/* Result Actions */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 20px;
}

.secondary-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
  padding: 14px 40px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.secondary-btn:hover {
  background: var(--card-bg);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.primary-btn.large {
  padding: 18px 50px;
  font-size: 1.15rem;
}

#result-screen .primary-btn {
  margin-top: 10px;
  margin-bottom: 20px;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 480px) {
  .main-title {
    font-size: 2.2rem;
  }
  
  .card {
    padding: 30px 20px;
  }
  
  .card-title {
    font-size: 1.2rem;
  }
  
  .wheel-wrapper {
    width: 70px;
    height: 130px;
  }
  
  .wheel-picker-group {
    gap: 8px;
  }
  
  .keyword-text {
    font-size: 2.2rem;
  }
  
  .fortune-cards {
    grid-template-columns: 1fr;
  }
  
  .primary-btn {
    padding: 14px 40px;
    font-size: 1rem;
  }
}

@media (min-width: 768px) {
  .main-title {
    font-size: 3.5rem;
  }
  
  .fortune-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}
