/* ===========================================
   Biorhythm Calculator - Aurora Vitalis
   Glassmorphism Design System
   =========================================== */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

/* CSS Variables */
:root {
  /* Background Gradient Colors */
  --bg-base: #f0f4f8;
  --blob-physical: rgba(255, 154, 139, 0.5);
  --blob-emotional: rgba(139, 193, 255, 0.5);
  --blob-intellectual: rgba(139, 255, 208, 0.5);

  /* Rhythm Colors - Softer, more refined */
  --physical: #e85d4c;
  --physical-soft: rgba(232, 93, 76, 0.15);
  --emotional: #4a9eff;
  --emotional-soft: rgba(74, 158, 255, 0.15);
  --intellectual: #2dd4a8;
  --intellectual-soft: rgba(45, 212, 168, 0.15);

  /* Glass Effect */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --glass-blur: 20px;

  /* Text Colors - Enhanced for readability */
  --text-primary: #1a2536;
  --text-secondary: #3d4f61;
  --text-muted: #6b7c8d;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;

  /* Border Radius */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-full: 50px;
}

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

/* Body & Background */
body {
  font-family: 'Pretendard', -apple-system, sans-serif;
  font-size: 1rem;
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.75;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated Background Blobs */
.bg-aurora {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.7;
  animation: float 20s ease-in-out infinite;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: var(--blob-physical);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: var(--blob-emotional);
  bottom: -150px;
  left: -100px;
  animation-delay: -7s;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: var(--blob-intellectual);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -30px) scale(1.05);
  }
  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }
  75% {
    transform: translate(-30px, -20px) scale(1.02);
  }
}

/* Main Container */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-lg);
  animation: fadeInUp 0.8s ease-out;
}

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

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}

/* Service Banners */
.service-banners {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.service-banner {
  display: block;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: white;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.service-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.service-banner:hover::before {
  opacity: 1;
}

.service-banner:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.soul-test {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.lotto-calc {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.banner-content {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.banner-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.banner-text {
  flex: 1;
}

.banner-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.banner-description {
  font-size: 0.9rem;
  opacity: 0.9;
}

.banner-sub-description {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 2px;
}

/* Personality Banner */
.personality-banner {
  display: block;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  text-align: center;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: var(--space-lg);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.5;
}

.personality-banner:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(79, 172, 254, 0.3);
}

.highlight {
  display: inline-block;
  font-weight: 700;
  animation: pulse 2s ease-in-out infinite;
}

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

/* Main Title */
h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, var(--physical) 0%, var(--emotional) 50%, var(--intellectual) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Bio Description */
.bio-description {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  margin-bottom: var(--space-xl);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.9;
  text-align: center;
  word-break: keep-all;
}

/* Input Section */
.input-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.input-group {
  width: 100%;
  max-width: 320px;
  text-align: center;
}

label {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

input[type="text"],
input[type="date"] {
  width: 100%;
  padding: var(--space-md);
  font-family: 'Pretendard', sans-serif;
  font-size: 1.1rem;
  color: var(--text-primary);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

input[type="text"]:focus,
input[type="date"]:focus {
  outline: none;
  border-color: var(--emotional);
  box-shadow: 0 4px 20px rgba(74, 158, 255, 0.2);
}

input[type="text"]::placeholder {
  color: var(--text-muted);
}

.input-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* Input Validation States */
.input-error-message {
  font-size: 0.85rem;
  color: #e74c3c;
  margin-top: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(231, 76, 60, 0.1);
  border-radius: var(--radius-xs);
  display: none;
  text-align: left;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

input.input-error {
  border-color: #e74c3c !important;
  background: rgba(231, 76, 60, 0.05);
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.15);
}

input.input-valid {
  border-color: #27ae60 !important;
  background: rgba(39, 174, 96, 0.05);
}

/* Disabled Button State */
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* Button */
button {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--emotional) 0%, #667eea 100%);
  border: none;
  border-radius: var(--radius-full);
  padding: var(--space-md) var(--space-xl);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(74, 158, 255, 0.3);
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(74, 158, 255, 0.4);
}

button:active {
  transform: translateY(-1px);
}

/* Warning Section */
.warning-section {
  background: rgba(255, 107, 107, 0.1);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  text-align: center;
  display: none;
}

.warning-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #e74c3c;
  margin-bottom: var(--space-sm);
}

.warning-blink {
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.warning-message {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: var(--space-sm) 0;
}

.warning-dates {
  font-weight: 600;
  color: #e74c3c;
  margin: var(--space-md) 0;
  line-height: 1.8;
}

/* Chart Container */
.chart-container {
  display: none;
  animation: fadeInUp 0.6s ease-out;
}

/* Rhythm Score Cards */
.rhythm-scores {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.rhythm-box {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.rhythm-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.physical-box::before {
  background: linear-gradient(90deg, var(--physical), #ff8a80);
}

.emotional-box::before {
  background: linear-gradient(90deg, var(--emotional), #82b1ff);
}

.intellectual-box::before {
  background: linear-gradient(90deg, var(--intellectual), #69f0ae);
}

.rhythm-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.rhythm-box h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.rhythm-box .score {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
}

.physical-box .score { color: var(--physical); }
.emotional-box .score { color: var(--emotional); }
.intellectual-box .score { color: var(--intellectual); }

/* Chart Wrapper */
.chart-wrapper {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  height: 350px;
}

/* Interpretation */
.interpretation {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
  display: none;
}

.interpretation h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--glass-border);
}

.interpretation p {
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--emotional);
  word-break: keep-all;
}

.interpretation p:nth-child(2) { border-left-color: var(--physical); }
.interpretation p:nth-child(3) { border-left-color: var(--emotional); }
.interpretation p:nth-child(4) { border-left-color: var(--intellectual); }

/* Company Banner */
.company-banner {
  display: block;
  background: linear-gradient(135deg, #2c3e50 0%, #4a5568 100%);
  color: white;
  text-align: center;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  text-decoration: none;
  margin-top: var(--space-xl);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.company-banner:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.company-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.company-description {
  font-size: 0.85rem;
  opacity: 0.9;
  line-height: 1.7;
}

/* Share Container */
.share-container {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-lg);
  text-align: center;
}

.share-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  border: none;
  font-family: 'Pretendard', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-button:hover {
  transform: translateY(-2px);
}

.share-button img {
  width: 16px;
  height: 16px;
}

.share-button.kakao {
  background: #fee500;
  color: #3c1e1e;
}

.share-button.facebook {
  background: #1877f2;
}

.share-button.twitter {
  background: #1da1f2;
}

.share-button.link {
  background: linear-gradient(135deg, var(--intellectual), #4ade80);
}

.copy-message {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: white;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  display: none;
  z-index: 1000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* ===========================================
   Responsive Design - Mobile First
   =========================================== */
@media screen and (max-width: 768px) {
  .container {
    padding: var(--space-sm);
  }

  h1 {
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
  }

  .bio-description {
    font-size: 0.95rem;
    line-height: 1.85;
    padding: var(--space-md);
  }

  .rhythm-scores {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .rhythm-box {
    padding: var(--space-md);
  }

  .rhythm-box h3 {
    font-size: 0.95rem;
  }

  .rhythm-box .score {
    font-size: 1.75rem;
  }

  .chart-wrapper {
    height: 280px;
    padding: var(--space-md);
  }

  .interpretation {
    padding: var(--space-md);
  }

  .interpretation h2 {
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
  }

  .interpretation p {
    font-size: 1rem;
    padding: var(--space-sm) var(--space-md);
    line-height: 1.8;
  }

  .service-banner {
    padding: var(--space-sm) var(--space-md);
  }

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

  .banner-title {
    font-size: 1rem;
  }

  .banner-description {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .banner-sub-description {
    display: none;
  }

  .share-buttons {
    gap: var(--space-xs);
  }

  .share-button {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.85rem;
  }

  .blob-1 {
    width: 300px;
    height: 300px;
  }

  .blob-2 {
    width: 250px;
    height: 250px;
  }

  .blob-3 {
    width: 200px;
    height: 200px;
  }

  .input-group {
    max-width: 100%;
  }

  label {
    font-size: 1rem;
  }

  input[type="text"],
  input[type="date"] {
    font-size: 1rem;
    padding: var(--space-sm) var(--space-md);
  }

  button {
    width: 100%;
    max-width: 280px;
    font-size: 1rem;
    padding: var(--space-sm) var(--space-lg);
  }
}

/* Input date styling for mobile */
@media screen and (max-width: 768px) {
  input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }

  input[type="date"]::-webkit-datetime-edit {
    text-align: center;
  }

  input[type="date"]::-webkit-calendar-picker-indicator {
    margin-left: -20px;
    opacity: 0.6;
  }
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background: var(--emotional-soft);
  color: var(--text-primary);
}

/* Footer */
.site-footer {
  margin-top: var(--space-lg);
  padding: var(--space-md) var(--space-sm);
  text-align: center;
  border-top: 1px solid var(--glass-border);
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-divider {
  color: var(--glass-border);
}

.footer-link {
  color: var(--emotional);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--physical);
}

/* Side Ads (PC Only) */
.side-ad {
  display: none;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  min-height: 600px;
  z-index: 100;
}

.side-ad-left {
  left: 10px;
}

.side-ad-right {
  right: 10px;
}

/* PC에서만 사이드 광고 표시 (1200px 이상) */
@media (min-width: 1200px) {
  .side-ad {
    display: block;
  }
}
