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

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

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-attachment: fixed;
  margin: 0;
}

.form-container, .dashboard {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(255, 105, 180, 0.2), 0 5px 15px rgba(255, 105, 180, 0.1);
  width: 100%;
  max-width: 420px;
  text-align: center;
  border: 1px solid rgba(255, 182, 193, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInUp 0.6s ease;
  margin: auto;
}

.form-container:hover, .dashboard:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 45px rgba(255, 105, 180, 0.25), 0 8px 20px rgba(255, 105, 180, 0.15);
}

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

h2 {
  color: #c2185b;
  margin-bottom: 25px;
  font-size: 2rem;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(194, 24, 91, 0.1);
  line-height: 1.2;
}

.dashboard h2 {
  background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.input-group {
  position: relative;
  margin-bottom: 18px;
}

input, select, textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #f8bbd9;
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  background: rgba(252, 228, 236, 0.6);
  transition: all 0.3s ease;
  color: #2d3748;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #e91e63;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1), 0 2px 8px rgba(233, 30, 99, 0.15);
  transform: translateY(-1px);
}

input::placeholder, textarea::placeholder {
  color: #a0aec0;
  font-weight: 400;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23e91e63' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
  appearance: none;
}

textarea {
  min-height: 100px;
  resize: vertical;
  font-family: 'Inter', sans-serif;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

button {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-transform: none;
  letter-spacing: 0.3px;
  box-sizing: border-box;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

button:hover::before {
  left: 100%;
}

button.primary {
  background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
  border: 2px solid transparent;
  background-clip: padding-box;
}

button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(233, 30, 99, 0.4);
  background: linear-gradient(135deg, #f50057 0%, #c2185b 100%);
}

button.primary:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(233, 30, 99, 0.5);
}

button.secondary {
  background: linear-gradient(135deg, #f06292 0%, #ec407a 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(240, 98, 146, 0.3);
  border: 2px solid transparent;
}

button.secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(240, 98, 146, 0.4);
  background: linear-gradient(135deg, #f48fb1 0%, #f06292 100%);
}

button.secondary:active {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(240, 98, 146, 0.5);
}

button.tertiary {
  background: linear-gradient(135deg, #ffc1cc 0%, #ffb3ba 100%);
  color: #c2185b;
  box-shadow: 0 6px 20px rgba(255, 193, 204, 0.3);
  border: 2px solid rgba(194, 24, 91, 0.1);
  font-weight: 500;
}

button.tertiary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(255, 193, 204, 0.4);
  background: linear-gradient(135deg, #ffcdd2 0%, #ffc1cc 100%);
  border-color: rgba(194, 24, 91, 0.2);
}

button.tertiary:active {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(255, 193, 204, 0.5);
}

button:active {
  transform: translateY(0);
}

button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.3);
}

button i {
  font-size: 0.9rem;
  transition: transform 0.3s ease;
}

button:hover i {
  transform: scale(1.1);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.2) !important;
}

button:disabled:hover::before {
  left: -100% !important;
}

.dashboard {
  max-width: 500px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.form-grid .input-group {
  margin-bottom: 0;
}

.period-stats {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  padding: 20px;
  border-radius: 16px;
  margin: 20px 0;
  color: white;
  text-align: left;
}

.period-stats h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.period-stats p {
  margin: 5px 0;
  opacity: 0.9;
}

.history-item {
  background: #fce4ec;
  padding: 15px;
  border-radius: 12px;
  margin: 10px 0;
  border-left: 4px solid #e91e63;
  text-align: left;
}

.history-item h4 {
  color: #c2185b;
  margin-bottom: 8px;
}

.history-item p {
  color: #4a5568;
  font-size: 0.9rem;
  margin: 3px 0;
}

a {
  color: #e91e63;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

a:hover {
  color: #ad1457;
  text-decoration: underline;
}

.logo {
  font-size: 2.8rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-text {
  color: #4a5568;
  margin-bottom: 25px;
  font-size: 1rem;
  line-height: 1.5;
}

/* Calendar Styling */
.calendar-container {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(25px);
  border-radius: 24px;
  padding: 30px;
  margin: 20px 0;
  box-shadow: 0 20px 50px rgba(255, 105, 180, 0.2);
  border: 1px solid rgba(255, 182, 193, 0.3);
  transition: all 0.3s ease;
}

.calendar-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 60px rgba(255, 105, 180, 0.25);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding: 10px 15px;
  background: linear-gradient(135deg, rgba(233, 30, 99, 0.05) 0%, rgba(173, 20, 87, 0.05) 100%);
  border-radius: 16px;
  border: 1px solid rgba(233, 30, 99, 0.1);
}

.calendar-nav {
  background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
  position: relative;
  overflow: hidden;
}

.calendar-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.calendar-nav:hover::before {
  left: 100%;
}

.calendar-nav:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 25px rgba(233, 30, 99, 0.5);
  background: linear-gradient(135deg, #f50057 0%, #c2185b 100%);
}

.calendar-nav:active {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(233, 30, 99, 0.6);
}

.calendar-title {
  color: #c2185b;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  flex: 1;
  text-shadow: 0 2px 4px rgba(194, 24, 91, 0.1);
  background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  background: linear-gradient(135deg, #f8bbd9 0%, #f3e5f5 100%);
  border-radius: 16px;
  padding: 15px;
  box-shadow: inset 0 2px 8px rgba(233, 30, 99, 0.1);
}

.calendar-day-header {
  background: linear-gradient(135deg, #f06292 0%, #ec407a 100%);
  color: white;
  padding: 12px 6px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 8px;
  margin-bottom: 8px;
  box-shadow: 0 3px 10px rgba(240, 98, 146, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.calendar-day-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.8s;
}

.calendar-day-header:nth-child(1)::before { animation-delay: 0.1s; }
.calendar-day-header:nth-child(2)::before { animation-delay: 0.2s; }
.calendar-day-header:nth-child(3)::before { animation-delay: 0.3s; }
.calendar-day-header:nth-child(4)::before { animation-delay: 0.4s; }
.calendar-day-header:nth-child(5)::before { animation-delay: 0.5s; }
.calendar-day-header:nth-child(6)::before { animation-delay: 0.6s; }
.calendar-day-header:nth-child(7)::before { animation-delay: 0.7s; }

.calendar-day {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: #2d3748;
  position: relative;
  border: 2px solid transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.calendar-day::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(233, 30, 99, 0.1) 0%, rgba(173, 20, 87, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 8px;
}

.calendar-day:hover::before {
  opacity: 1;
}

.calendar-day:hover {
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
  transform: scale(1.08) translateY(-2px);
  border-color: #f06292;
  box-shadow: 0 8px 20px rgba(240, 98, 146, 0.3);
  color: #c2185b;
  font-weight: 600;
}

.calendar-day:active {
  transform: scale(1.02) translateY(0);
}

.calendar-day.other-month {
  color: #cbd5e1;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  opacity: 0.6;
}

.calendar-day.other-month:hover {
  opacity: 0.8;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.calendar-day.today {
  background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
  color: white;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4); }
  50% { box-shadow: 0 8px 25px rgba(233, 30, 99, 0.6); }
  100% { box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4); }
}

.calendar-day.today:hover {
  background: linear-gradient(135deg, #f50057 0%, #c2185b 100%);
  transform: scale(1.12) translateY(-3px);
  box-shadow: 0 10px 30px rgba(245, 0, 87, 0.5);
}

.calendar-day.period-day {
  background: linear-gradient(135deg, #ff6b9d 0%, #ff5722 100%);
  color: white;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.calendar-day.period-day::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
}

.calendar-day.period-day:hover {
  background: linear-gradient(135deg, #ff8a65 0%, #ff7043 100%);
  transform: scale(1.12) translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 138, 101, 0.5);
}

.calendar-day.predicted-period {
  background: linear-gradient(135deg, #ffb3ba 0%, #ffc1cc 100%);
  color: #c2185b;
  border: 2px dashed #f06292;
  font-weight: 600;
  position: relative;
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.calendar-day.predicted-period:hover {
  background: linear-gradient(135deg, #ffcdd2 0%, #f8bbd9 100%);
  border-color: #e91e63;
  transform: scale(1.1) translateY(-2px);
}

.calendar-day.ovulation {
  background: linear-gradient(135deg, #81c784 0%, #66bb6a 100%);
  color: white;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(129, 199, 132, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.calendar-day.ovulation:hover {
  background: linear-gradient(135deg, #a5d6a7 0%, #81c784 100%);
  transform: scale(1.12) translateY(-3px);
  box-shadow: 0 10px 30px rgba(165, 214, 167, 0.5);
}

.calendar-day.fertile {
  background: linear-gradient(135deg, #a5d6a7 0%, #c8e6c9 100%);
  color: #2e7d32;
  border: 2px solid #81c784;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(165, 214, 167, 0.3);
}

.calendar-day.fertile:hover {
  background: linear-gradient(135deg, #c8e6c9 0%, #dcedc8 100%);
  border-color: #66bb6a;
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 25px rgba(200, 230, 201, 0.4);
}

.calendar-day.selected {
  background: linear-gradient(135deg, #9c27b0 0%, #673ab7 100%);
  color: white;
  font-weight: 700;
  transform: scale(1.15);
  box-shadow: 0 8px 25px rgba(156, 39, 176, 0.5);
  border: 3px solid rgba(255, 255, 255, 0.5);
  z-index: 10;
  position: relative;
}

.calendar-day.selected:hover {
  background: linear-gradient(135deg, #ab47bc 0%, #7986cb 100%);
  transform: scale(1.18) translateY(-2px);
  box-shadow: 0 12px 35px rgba(171, 71, 188, 0.6);
}

/* Calendar Day Indicators */
.calendar-day::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}

.calendar-day.has-notes::after {
  background: #ffd54f;
}

.calendar-day.heavy-flow::after {
  background: #d32f2f;
}

.calendar-day.medium-flow::after {
  background: #f57c00;
}

.calendar-day.light-flow::after {
  background: #fbc02d;
}

/* Calendar Legend */
.calendar-legend {
  margin-top: 25px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(255, 158, 158, 0.1);
}

.legend-title {
  font-size: 18px;
  font-weight: 700;
  color: #e91e63;
  margin-bottom: 15px;
  text-align: center;
  background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.legend-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  color: #555;
}

.legend-item:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
  box-shadow: 0 6px 20px rgba(255, 158, 158, 0.15);
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 8px;
  margin-right: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.legend-color::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.legend-item:hover .legend-color::before {
  opacity: 1;
}

.legend-color.period { background: linear-gradient(135deg, #ff6b9d 0%, #ff5722 100%); }
.legend-color.predicted { background: linear-gradient(135deg, #ffb3ba 0%, #ffc1cc 100%); border: 2px dashed #f06292; }
.legend-color.ovulation { background: linear-gradient(135deg, #81c784 0%, #66bb6a 100%); }
.legend-color.fertile { background: linear-gradient(135deg, #a5d6a7 0%, #c8e6c9 100%); }

.legend-text {
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Date Input Styling for Calendar */
input[type="date"] {
  position: relative;
  background: #fce4ec;
  border: 2px solid #f8bbd9;
  color: #2d3748;
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23e91e63'%3e%3cpath fill-rule='evenodd' d='M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z' clip-rule='evenodd'/%3e%3c/svg%3e");
  width: 20px;
  height: 20px;
  cursor: pointer;
}

input[type="date"]::-webkit-datetime-edit {
  color: #2d3748;
  padding: 0;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

input[type="date"]::-webkit-datetime-edit-text {
  color: #c2185b;
  padding: 0 0.3em;
}

input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  color: #2d3748;
  font-weight: 500;
}

input[type="date"]:focus::-webkit-datetime-edit-month-field,
input[type="date"]:focus::-webkit-datetime-edit-day-field,
input[type="date"]:focus::-webkit-datetime-edit-year-field {
  background: rgba(233, 30, 99, 0.1);
  border-radius: 4px;
}

/* Responsive Calendar */
@media (max-width: 768px) {
  .calendar-container {
    padding: 20px 15px;
    margin: 15px 0;
  }
  
  .calendar-title {
    font-size: 1.1rem;
  }
  
  .calendar-day {
    min-height: 30px;
    font-size: 0.8rem;
    padding: 6px 2px;
  }
  
  .calendar-day-header {
    font-size: 0.7rem;
    padding: 6px 2px;
  }
  
  .calendar-legend {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .calendar-grid {
    gap: 1px;
    padding: 8px;
  }
  
  .calendar-day {
    min-height: 25px;
    font-size: 0.75rem;
    padding: 4px 2px;
  }
  
  .calendar-nav {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  
  .calendar-title {
    font-size: 1rem;
  }
}

/* Custom Message Box */
.message-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.message-overlay.show {
  opacity: 1;
  visibility: visible;
}

.message-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(255, 105, 180, 0.3);
  border: 1px solid rgba(255, 182, 193, 0.3);
  transform: scale(0.8) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: messageSlideIn 0.4s ease;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.message-overlay.show .message-box {
  transform: scale(1) translateY(0);
}

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

.message-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.message-title {
  color: #c2185b;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.message-content {
  color: #4a5568;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 20px;
  white-space: pre-line;
  text-align: left;
  max-height: 400px;
  overflow-y: auto;
  padding: 0 5px;
  flex: 1;
}

.message-content::-webkit-scrollbar {
  width: 6px;
}

.message-content::-webkit-scrollbar-track {
  background: rgba(255, 182, 193, 0.2);
  border-radius: 3px;
}

.message-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
  border-radius: 3px;
}

.message-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #c2185b 0%, #e91e63 100%);
}

/* History Entry Styling */
.history-entry {
  background: linear-gradient(135deg, rgba(255, 182, 193, 0.1) 0%, rgba(255, 205, 210, 0.1) 100%);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  border-left: 4px solid #f06292;
  transition: all 0.3s ease;
}

.history-entry:hover {
  background: linear-gradient(135deg, rgba(255, 182, 193, 0.2) 0%, rgba(255, 205, 210, 0.2) 100%);
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(255, 105, 180, 0.2);
}

.history-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-entry-number {
  background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.history-entry-date {
  color: #c2185b;
  font-weight: 600;
  font-size: 0.9rem;
}

.history-entry-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.history-detail-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #4a5568;
}

.history-detail-emoji {
  font-size: 1rem;
}

.history-note {
  background: rgba(255, 255, 255, 0.6);
  padding: 8px 12px;
  border-radius: 8px;
  font-style: italic;
  color: #666;
  border: 1px solid rgba(255, 182, 193, 0.3);
  margin-top: 8px;
}

.message-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.message-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  min-width: 80px;
}

.message-btn.primary {
  background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.message-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
  background: linear-gradient(135deg, #f50057 0%, #c2185b 100%);
}

.message-btn.secondary {
  background: linear-gradient(135deg, #ffc1cc 0%, #ffb3ba 100%);
  color: #c2185b;
  border: 1px solid rgba(194, 24, 91, 0.2);
}

.message-btn.secondary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #ffcdd2 0%, #ffc1cc 100%);
  border-color: rgba(194, 24, 91, 0.3);
}

/* Mobile Responsive Message Box */
@media (max-width: 768px) {
  .message-box {
    max-width: 95%;
    padding: 25px 20px;
    max-height: 85vh;
  }
  
  .message-title {
    font-size: 1.1rem;
  }
  
  .message-content {
    font-size: 0.9rem;
    max-height: 350px;
  }
  
  .history-entry-details {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .history-entry {
    padding: 12px;
  }
  
  .message-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  .message-btn {
    width: 100%;
    padding: 12px 20px;
  }
}

@media (max-width: 480px) {
  .message-box {
    padding: 20px 15px;
    max-height: 90vh;
  }
  
  .message-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
  }
  
  .message-title {
    font-size: 1rem;
    margin-bottom: 8px;
  }
  
  .message-content {
    font-size: 0.85rem;
    max-height: 300px;
  }
  
  .history-entry {
    padding: 10px;
    margin-bottom: 10px;
  }
  
  .history-entry-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .history-detail-item {
    font-size: 0.8rem;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }
  
  .form-container, .dashboard {
    padding: 25px 20px;
    max-width: 100%;
  }
  
  h2 {
    font-size: 1.7rem;
    margin-bottom: 20px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .button-group {
    gap: 8px;
    margin-top: 18px;
  }
  
  input, select, textarea, button {
    padding: 12px 16px;
    font-size: 0.95rem;
  }
  
  .input-group {
    margin-bottom: 15px;
  }
  
  .welcome-text {
    font-size: 0.95rem;
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  
  .form-container, .dashboard {
    padding: 20px 15px;
    border-radius: 20px;
  }
  
  h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }
  
  input, select, textarea, button {
    padding: 10px 14px;
    font-size: 0.9rem;
  }
  
  .logo {
    font-size: 2.3rem;
    margin-bottom: 6px;
  }
  
  .welcome-text {
    font-size: 0.9rem;
    margin-bottom: 18px;
  }
  
  .input-group {
    margin-bottom: 12px;
  }
  
  .button-group {
    gap: 6px;
    margin-top: 15px;
  }
}

/* AI Chatbot Styles */
.chatbot-toggle {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
  border-radius: 50%;
  border: none;
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(233, 30, 99, 0.4), 0 4px 15px rgba(233, 30, 99, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-glow 4s infinite;
  background-image: url('chat_icon.png');
  background-size: 32px 32px;
  background-repeat: no-repeat;
  background-position: center;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

@keyframes pulse-glow {
  0%, 100% { 
    box-shadow: 0 8px 25px rgba(233, 30, 99, 0.4), 0 4px 15px rgba(233, 30, 99, 0.2);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 12px 35px rgba(233, 30, 99, 0.6), 0 6px 20px rgba(233, 30, 99, 0.3);
    transform: scale(1.05);
  }
}

.chatbot-toggle:hover {
  background: linear-gradient(135deg, #f50057 0%, #c2185b 100%);
  transform: scale(1.15);
  box-shadow: 0 15px 40px rgba(245, 0, 87, 0.6), 0 8px 25px rgba(245, 0, 87, 0.4);
  border-color: rgba(255, 255, 255, 0.3);
}

.chatbot-container {
  position: fixed;
  bottom: 95px;
  right: 25px;
  width: 360px;
  height: 500px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
  backdrop-filter: blur(30px);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(255, 105, 180, 0.3), 0 8px 25px rgba(255, 105, 180, 0.15);
  border: 1px solid rgba(255, 182, 193, 0.3);
  display: none;
  flex-direction: column;
  z-index: 998;
  animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

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

.chatbot-container.show {
  display: flex;
}

.chatbot-header {
  background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
  color: white;
  padding: 18px 24px;
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
}

.chatbot-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.3px;
  z-index: 1;
  position: relative;
}

.chatbot-title::before {
  content: '🩸';
  font-size: 1.1rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.chatbot-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: all 0.3s ease;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 1;
  position: relative;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(135deg, rgba(252, 228, 236, 0.2) 0%, rgba(248, 187, 217, 0.15) 100%);
}

.chatbot-messages::-webkit-scrollbar {
  width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: rgba(255, 182, 193, 0.15);
  border-radius: 4px;
  margin: 8px 0;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #c2185b 0%, #e91e63 100%);
}

.chat-message {
  display: flex;
  gap: 12px;
  animation: fadeInMessage 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  align-items: flex-end;
}

@keyframes fadeInMessage {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
}

.chat-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-avatar.bot {
  background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  line-height: 1;
  background-image: url('chat_icon.png');
  background-size: 22px 22px;
  background-repeat: no-repeat;
  background-position: center;
}

.chat-avatar.user {
  background: linear-gradient(135deg, #ffc1cc 0%, #ffb3ba 100%);
  color: #c2185b;
  font-weight: 600;
  border: 2px solid rgba(255, 193, 204, 0.6);
}

.chat-bubble {
  max-width: 78%;
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 0.95rem;
  line-height: 1.6;
  position: relative;
  word-wrap: break-word;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.chat-bubble:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.chat-bubble.bot {
  background: linear-gradient(135deg, rgba(233, 30, 99, 0.08) 0%, rgba(240, 98, 146, 0.06) 100%);
  color: #4a5568;
  border-bottom-left-radius: 8px;
  border: 1px solid rgba(233, 30, 99, 0.15);
  backdrop-filter: blur(10px);
  position: relative;
}

.chat-bubble.bot::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
  border-radius: 20px;
  border-bottom-left-radius: 8px;
  pointer-events: none;
  z-index: -1;
}

.chat-bubble.user {
  background: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
  color: white;
  border-bottom-right-radius: 8px;
  box-shadow: 0 6px 20px rgba(233, 30, 99, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-input-container {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 182, 193, 0.3);
  display: flex;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(252, 228, 236, 0.4) 100%);
  backdrop-filter: blur(20px);
}

.chat-input {
  flex: 1;
  padding: 14px 20px;
  border: 2px solid #f8bbd9;
  border-radius: 25px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.9);
  color: #2d3748;
  outline: none;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.1);
}

.chat-input:focus {
  border-color: #e91e63;
  background: white;
  box-shadow: 0 0 0 4px rgba(233, 30, 99, 0.15), 0 4px 12px rgba(233, 30, 99, 0.2);
  transform: translateY(-1px);
}

.chat-input::placeholder {
  color: #a0aec0;
  font-weight: 400;
}

.chat-send {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.chat-send:hover {
  background: linear-gradient(135deg, #f50057 0%, #c2185b 100%);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(245, 0, 87, 0.5);
}

.chat-send:active {
  transform: scale(1.05);
}

.chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 0;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #e91e63;
  border-radius: 50%;
  animation: typingAnimation 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

/* Mobile Responsive Chatbot */
@media (max-width: 768px) {
  .chatbot-container {
    bottom: 80px;
    right: 15px;
    left: 15px;
    width: auto;
    height: 460px;
    border-radius: 18px;
  }
  
  .chatbot-toggle {
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    font-size: 1.1rem;
  }
  
  .chatbot-header {
    padding: 16px 20px;
    border-radius: 18px 18px 0 0;
  }
  
  .chatbot-title {
    font-size: 1rem;
  }
  
  .chatbot-messages {
    padding: 18px;
    gap: 14px;
  }
  
  .chat-bubble {
    max-width: 82%;
    font-size: 0.9rem;
    padding: 12px 16px;
  }
  
  .chat-input {
    font-size: 0.9rem;
    padding: 12px 18px;
  }
  
  .chat-send {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 480px) {
  .chatbot-container {
    height: 440px;
    border-radius: 18px;
    bottom: 80px;
  }
  
  .chatbot-toggle {
    width: 50px;
    height: 50px;
    bottom: 18px;
    right: 18px;
  }
  
  .chatbot-header {
    padding: 14px 18px;
  }
  
  .chatbot-title {
    font-size: 1rem;
    gap: 8px;
  }
  
  .chatbot-close {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }
  
  .chatbot-messages {
    padding: 18px;
    gap: 14px;
  }
  
  .chat-avatar {
    width: 34px;
    height: 34px;
  }
  
  .chat-avatar.bot {
    background-size: 18px 18px;
  }
  
  .chat-bubble {
    font-size: 0.85rem;
    padding: 10px 14px;
    border-radius: 16px;
  }
  
  .chat-input-container {
    padding: 16px 18px;
  }
  
  .chat-input {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
  
  .chat-send {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }
}
