@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&family=Noto+Sans+KR:wght@300;400;500;700;900&display=swap');

:root {
  --bg-color: #0c0f1d;
  --card-bg: rgba(20, 24, 46, 0.6);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-color: #ffd700; /* Gold */
  --accent-glow: rgba(255, 215, 0, 0.15);
  --purple-glow: rgba(139, 92, 246, 0.25);
  --button-bg: linear-gradient(135deg, #6366f1, #8b5cf6);
  --button-hover: linear-gradient(135deg, #4f46e5, #7c3aed);
  --adsense-bg: rgba(255, 255, 255, 0.03);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: 'Outfit', 'Noto Sans KR', 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow-x: hidden;
  position: relative;
}

/* Background elements for premium atmosphere */
body::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 10%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  z-index: -1;
  filter: blur(40px);
}

body::after {
  content: '';
  position: absolute;
  bottom: 15%;
  right: 5%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
  z-index: -1;
  filter: blur(50px);
}

header {
  padding: 2.5rem 1rem 1rem 1rem;
  text-align: center;
  width: 100%;
}

.logo {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.sub-logo {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

main {
  flex: 1;
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 2rem;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, var(--accent-color), #8b5cf6);
}

.image-container {
  width: 100%;
  height: 240px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 2rem;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.image-container:hover img {
  transform: scale(1.05);
}

.input-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.input-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.select-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 0.8rem;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  font-family: inherit;
}

select:focus {
  border-color: #8b5cf6;
  background: rgba(255, 255, 255, 0.08);
}

.time-select {
  width: 100%;
}

.btn-primary {
  width: 100%;
  background: var(--button-bg);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 1.1rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  margin-top: 1rem;
  font-family: inherit;
}

.btn-primary:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

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

.btn-bokchae {
  width: 100%;
  background: linear-gradient(135deg, #00c7ae, #00a896); /* Toss Mint Gradient */
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 1.1rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(0, 199, 174, 0.3);
  margin-top: 2rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-bokchae:hover {
  background: linear-gradient(135deg, #00b09b, #009688);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 199, 174, 0.4);
}

.btn-bokchae svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* AdSense Mocking Area */
.ads-area {
  width: 100%;
  max-width: 480px;
  padding: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  background: var(--adsense-bg);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  position: relative;
}

.ads-area::before {
  content: 'Google AdSense 광고';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-color);
  padding: 0 8px;
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.ads-box {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Fallback Promo Banners before AdSense approval */
.promo-banner {
  width: 100%;
  height: 90px;
  border-radius: 12px;
  background-image: linear-gradient(rgba(12, 15, 29, 0.75), rgba(12, 15, 29, 0.75)), url('../assets/images/banner_backup.png');
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  transition: transform 0.2s, border-color 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.promo-banner:hover {
  transform: translateY(-2px);
  border-color: var(--accent-color);
}

.promo-banner::before {
  content: '추천';
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--accent-color);
  color: #0c0f1d;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.promo-banner-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 3px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.promo-banner-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.promo-interstitial-banner {
  width: 100%;
  height: 250px;
  border-radius: 12px;
  background-image: linear-gradient(rgba(12, 15, 29, 0.6), rgba(12, 15, 29, 0.8)), url('../assets/images/banner_backup.png');
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.2s;
  cursor: pointer;
}

.promo-interstitial-banner:hover {
  border-color: var(--accent-color);
}


/* Interstitial Ad Modal */
.ad-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 15, 29, 0.95);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.ad-modal-content {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  text-align: center;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.ad-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.ad-modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: #fff;
  font-size: 1.1rem;
  cursor: not-allowed;
  opacity: 0.5;
  transition: opacity 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-modal-close-btn.active {
  cursor: pointer;
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

.ad-modal-close-btn.active:hover {
  background: rgba(255, 255, 255, 0.3);
}

.timer-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.ad-modal-body {
  min-height: 250px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Result Style elements */
.result-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.result-summary {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 2rem;
  font-weight: 500;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  margin: 1.5rem 0;
}

.detail-section {
  text-align: left;
  margin-bottom: 1.5rem;
}

.detail-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-section-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  font-size: 0.9rem;
  z-index: 2000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  display: none;
  animation: fadeInUp 0.3s ease-out;
}

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

footer {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  width: 100%;
}

footer p {
  margin-bottom: 0.3rem;
}

/* API Key Settings Button */
.settings-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  color: var(--text-primary);
  z-index: 10;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.settings-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* API Key Modal */
.key-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 15, 29, 0.96);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.key-modal-content {
  background: rgba(20, 24, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  padding: 2.2rem;
  text-align: left;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  position: relative;
}

.key-modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #8b5cf6, #3b82f6);
  border-radius: 24px 24px 0 0;
}

.key-modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.key-modal-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.settings-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  color: #fff;
  border-radius: 12px;
  padding: 0.9rem;
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s;
}

.settings-input:focus {
  border-color: #3b82f6;
}

.modal-buttons {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.8rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
  text-align: center;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.key-modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.key-modal-close:hover {
  color: #fff;
}

