:root {
  --primary: #6366f1;
  --secondary: #a855f7;
  --accent: #ec4899;
  --bg-dark: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(16px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* Background Blobs */
.background-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  filter: blur(80px);
}

.blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.6;
  animation: move 20s infinite alternate;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: var(--secondary);
  bottom: -150px;
  right: -100px;
  animation-delay: -5s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: var(--accent);
  top: 40%;
  left: 60%;
  animation-delay: -10s;
}

@keyframes move {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(100px, 50px) scale(1.1);
  }
}

/* Container & Glass Card */
.container {
  width: 100%;
  max-width: 500px;
  padding: 20px;
  z-index: 1;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  animation: fadeIn 0.8s ease-out;
}

.keypad-active .glass-card {
  transform: translateY(-120px);
}

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

header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Input Group */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 30px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr auto;
  gap: 12px;
  align-items: flex-end;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-field label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

input[type="number"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 10px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  outline: none;
  transition: all 0.3s ease;
  text-align: center;
}

input[type="number"]::placeholder {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 400;
}

input[type="number"]:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.calendar-trigger-field {
  display: flex;
  align-items: flex-end;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

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

/* Custom Calendar Modal */
.calendar-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease-out;
}

.calendar-content {
  width: 95%;
  max-width: 380px;
  padding: 30px !important;
  background: rgba(15, 23, 42, 0.92) !important;
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.15) !important;
}

.clickable-header {
  cursor: pointer;
  padding: 5px 15px;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.clickable-header:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary);
  transform: scale(1.05);
}

.calendar-view {
  animation: slideFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.selection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 5px;
}

.selection-grid div {
  padding: 12px;
  text-align: center;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
}

.selection-list {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 8px;
  margin-top: 5px;
}

.selection-list div {
  padding: 12px;
  text-align: center;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  transition: all 0.2s;
}

/* Custom Scrollbar */
.selection-list::-webkit-scrollbar {
  width: 6px;
}

.selection-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.selection-list::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 10px;
}

.selection-list::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.selection-grid div:hover,
.selection-list div:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  transform: translateY(-2px);
  color: #fff;
}

.selection-grid div.selected,
.selection-list div.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.visibility-hidden {
  visibility: hidden;
  pointer-events: none;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1rem;
  transition: 0.2s;
}

.nav-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 10px;
}

.calendar-weekdays div {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.calendar-days div {
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.2s;
  color: rgba(255, 255, 255, 0.8);
}

.calendar-days div:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
}

.calendar-days div.current-day {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.calendar-days div.selected {
  border: 2px solid var(--primary);
  color: #fff;
}

.calendar-days div.prev-date,
.calendar-days div.next-date {
  opacity: 0.3;
}

.calendar-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}

.text-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 5px 10px;
  transition: 0.2s;
}

.text-btn:hover {
  color: var(--primary);
  background: transparent;
  transform: none;
  box-shadow: none;
}

#calendar-close:hover {
  color: var(--accent);
}

/* Results Section */
.result-container {
  margin-top: 20px;
  border-top: 1px solid var(--glass-border);
  padding-top: 25px;
  animation: slideUp 0.5s ease-out;
}

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

.main-result {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.result-box {
  background: rgba(255, 255, 255, 0.03);
  padding: 15px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--glass-border);
}

.result-box span {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 5px;
}

.result-box p {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.detailed-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  color: #fff;
  font-weight: 600;
}

.next-birthday {
  text-align: center;
  background: linear-gradient(
    to right,
    rgba(99, 102, 241, 0.1),
    rgba(168, 85, 247, 0.1)
  );
  padding: 15px;
  border-radius: 12px;
  font-size: 0.95rem;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.next-birthday span {
  color: var(--accent);
  font-weight: 700;
}

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  body {
    align-items: flex-start;
    padding: 40px 10px;
    height: auto;
    overflow-y: auto;
  }

  .container {
    padding: 10px;
  }

  .glass-card {
    padding: 30px 20px;
  }

  header h1 {
    font-size: 2rem;
  }

  .main-result {
    grid-template-columns: 1fr;
  }
}

/* Author Tag Styling */
.author-tag {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 15px;
  text-align: center;
  animation: fadeIn 1s ease-out 0.4s both;
  letter-spacing: 0.02em;
}

.author-tag span {
  color: #fff;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: default;
}

.author-tag span:hover {
  color: var(--primary);
  text-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}
