/* === Pastel Dream Theme + Native Select Styling === */
* {
  margin: 0; padding: 0; box-sizing: border-box;
}
body {
  font-family: 'Satoshi', 'Inter', system-ui, sans-serif;
  background: linear-gradient(135deg, #fdf2f8 0%, #e0f2fe 100%);
  min-height: 100vh;
  color: #2d3748;
  line-height: 1.6;
 padding: 1.5rem 1rem;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}
.header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  padding: 2rem 0;
  text-align: center;
  color: #6b21a8;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid rgba(147, 123, 255, 0.15);
  border-radius: 14px;
}
.header h1 {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(90deg, #c084fc, #a78bfa, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header p {
  font-size: 1.25rem;
  opacity: 0.9;
  color: #6b21a8;
}
h2 {
  color: #6b21a8;
  margin-bottom: 1.2rem;
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.upcoming-grid,
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.8rem;
}
.card {
  background: white;
  border-radius: 20px;
  padding: 1.8rem;
  box-shadow: 0 10px 35px rgba(147, 123, 255, 0.15);
  border: 1px solid rgba(147, 123, 255, 0.12);
  transition: all 0.3s ease;
}
.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 50px rgba(147, 123, 255, 0.25);
}
.card.birthday {
  border-left: 6px solid #f472b6;
}
.card.anniversary {
  border-left: 6px solid #c084fc;
}
.card.reminder {
  border-left: 6px solid #93c5fd;
}
.card.upcoming {
  border-left-width: 8px;
}
.card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #4c1d95;
}
.card .date {
  font-weight: 600;
  color: #a78bfa;
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
}
.card .meta {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 0.8rem;
}
.card .note {
  font-style: italic;
  color: #94a3b8;
  margin-top: 1rem;
  font-size: 0.98rem;
}
.card .actions {
  margin-top: 1.2rem;
  display: flex;
  gap: 0.7rem;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin: 2.5rem 0;
  align-items: center;
  justify-content: space-between;
}
.filters {
  display: flex;
  gap: 1rem;
  flex: 1;
  max-width: 650px;
  min-width: 300px; 
}
input,
select,
textarea {
  width: 100%;
  padding: 0.95rem 1.3rem;
  border: 2.5px solid #e2e8f0;
  border-radius: 16px;
  background: white;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.25s ease;
  color: #4c1d95;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}
select {
  background-image:
    linear-gradient(45deg, transparent 50%, #a78bfa 50%),
    linear-gradient(135deg, #a78bfa 50%, transparent 50%),
    linear-gradient(to right, #c084fc, #a78bfa);
  background-position:
    calc(100% - 20px) calc(1em + 2px),
    calc(100% - 15px) calc(1em + 2px),
    100% 0;
  background-size: 5px 5px, 5px 5px, 1px 1.5em;
  background-repeat: no-repeat;
}
select:focus {
  outline: none;
  border-color: #c084fc;
  box-shadow: 0 0 0 5px rgba(147, 123, 255, 0.18);
  background-color: #faf5ff;
}
/* Remove default blue highlight on selected option */
select:focus {
  outline: none;
  border-color: #c084fc;
  box-shadow: 0 0 0 5px rgba(147, 123, 255, 0.18);
  background-color: #faf5ff;
  color: #6b21a8;
}

/* Customize dropdown options appearance */
select option {
  background: #f5f3ff; /* pastel off-white */
  color: #6b21a8;
  padding: 8px 16px;
}

/* For Firefox: when option is hovered or selected */
select option:hover,
select option:checked {
  background: #c084fc !important;
  color: white !important;
}

/* For Chrome/Safari: We cannot style dropdown list items much,
   but can style the selected text and the dropdown arrow */

/* Custom arrow with gradient consistent with theme */
select {
  background-image:
    linear-gradient(45deg, transparent 50%, #a78bfa 50%),
    linear-gradient(135deg, #a78bfa 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(1em + 2px),
    calc(100% - 15px) calc(1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* Remove dotted outline on Firefox */
select::-moz-focus-inner {
  border: 0;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #c084fc;
  box-shadow: 0 0 0 5px rgba(147, 123, 255, 0.18);
  background-color: #faf5ff;
}
#searchInput {
   flex-grow: 2;      
  min-width: 180px;
}

#filterType {
  flex-grow: 1;      /* select smaller */
  max-width: 180px;  /* limit max width */
}
/* Perfect Checkbox */
label input[type="checkbox"] {
  appearance: none;
  width: 24px;
  height: 24px;
  border: 2.5px solid #e2e8f0;
  border-radius: 10px;
  margin-right: 10px;
  position: relative;
  top: 6px;
  cursor: pointer;
  background: white;
}
label input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #c084fc, #a78bfa);
  border-color: #a78bfa;
}
label input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 16px;
  font-weight: bold;
}
/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
  padding: 0.9rem 1.8rem;
  border: none;
  border-radius: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}
.btn-primary {
  background: linear-gradient(135deg, #c084fc, #a78bfa);
  color: white;
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #a855f7, #9333ea);
  transform: translateY(-3px);
}
.btn-secondary {
  background: #f1f5f9;
  color: #475569;
}
.btn-secondary:hover {
  background: #e2e8f0;
}
.btn-danger {
  background: #fca5a5;
  color: #991b1b;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
}
.btn-danger:hover {
  background: #f87171;
}
/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-content {
  background: white;
  border-radius: 24px;
  padding: 2.5rem;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 25px 70px rgba(147, 123, 255, 0.3);
}
.modal h2 {
  color: #6b21a8;
  margin-bottom: 1.5rem;
}
.modal label {
  display: block;
  margin: 1.2rem 0 0.5rem;
  font-weight: 600;
  color: #4c1d95;
}
.form-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}
.no-upcoming {
  grid-column: 1/-1;
  text-align: center;
  color: rgba(107, 33, 168, 0.7);
  font-size: 1.3rem;
  padding: 3rem;
}
.hidden {
  display: none !important;
}
/* Flatpickr */
.flatpickr-calendar {
  border-radius: 18px !important;
  box-shadow: 0 20px 60px rgba(147, 123, 255, 0.25) !important;
}
.flatpickr-day.selected,
.flatpickr-day.today {
  background: #a78bfa !important;
  border-color: #a78bfa !important;
  color: white !important;
}
.flatpickr-day:hover {
  background: #c084fc !important;
  color: white !important;
}

/* Event Count Badges – perfectly matching your theme */
.count-badge {
  display: inline-block;
  background: linear-gradient(135deg, #c084fc, #a78bfa);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  min-width: 28px;
  text-align: center;
  margin-left: 0.8rem;
  box-shadow: 0 4px 15px rgba(167, 139, 250, 0.3);
}

/* Beautiful Empty State (only visible when no cards) */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: #6b21a8;
  font-weight: 600;
}

/* Hide default no-upcoming text when we have our pretty version */
#upcomingEvents:not(:empty) ~ .no-upcoming,
#upcomingEvents:empty .empty-state ~ .no-upcoming {
  display: none;
}

/* === DREAMY PASTEL FOOTER === */
.footer {
  margin-top: 5rem;
  padding: 3rem 0 2rem;
  background: linear-gradient(to top, rgba(253, 242, 248, 0.8), transparent),
              linear-gradient(135deg, #fdf2f8 0%, #e0f2fe 100%);
  border-top: 1px solid rgba(147, 123, 255, 0.15);
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  position: relative;
  z-index: 2;
}

.footer-left h3 {
  font-weight: 800;
  font-size: 2rem;
}

.footer-right {
  text-align: right;
}

.footer-hearts {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  opacity: 0.3;
  pointer-events: none;
}

.footer-hearts span {
  font-size: 1.4rem;
  animation: float 6s ease-in-out infinite;
}

.footer-hearts span:nth-child(1) { animation-delay: 0s; }
.footer-hearts span:nth-child(2) { animation-delay: 1s; }
.footer-hearts span:nth-child(3) { animation-delay: 2s; }
.footer-hearts span:nth-child(4) { animation-delay: 3s; }
.footer-hearts span:nth-child(5) { animation-delay: 4s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(10deg); }
}

/* Mobile friendly */
@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
  .footer-right {
    text-align: center;
  }
  .footer-hearts {
    bottom: 5px;
  }
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 2.8rem;
  }
  .controls,
  .filters {
    flex-direction: column;
  }
}
/* Extra small screens */
@media (max-width: 480px) {
  body { padding: 1rem 0.75rem; font-size: 14.5px; }
  
  .header { padding: 1.5rem 1rem; border-radius: 12px; }
  .header h1 { font-size: 2.3rem; }
  
  .card {
    padding: 1.2rem;
    border-radius: 14px;
  }
  
  .upcoming-grid,
  .events-grid {
    grid-template-columns: 1fr; /* Full width cards */
    gap: 1rem;
  }
  
  h2 { font-size: 1.5rem; margin: 1.5rem 0 0.8rem; }
  
  .controls { margin: 1.5rem 0; }
}

/* Medium mobile */
@media (min-width: 481px) and (max-width: 768px) {
  .upcoming-grid,
  .events-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}
