/* Calendar Modal and Tooltip Styles */

/* Day Tooltip */
.day-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.day-tooltip::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
}

.day-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-15px);
}

.tooltip-content h6 {
  margin: 0 0 8px 0;
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.tooltip-event {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  padding: 4px 0;
}

.event-type-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.event-type-indicator.generic {
  background: #ff6b6b;
}
.event-type-indicator.activity {
  background: #4ecdc4;
}
.event-type-indicator.workshop {
  background: #f7b731;
}
.event-type-indicator.environment {
  background: #5f27cd;
}

.event-title {
  font-size: 1rem;
  opacity: 0.9;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Event Type Popup */
.event-type-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.event-type-popup.show {
  opacity: 1;
  visibility: visible;
}

.popup-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  transition: all 0.3s ease;
}

.popup-content {
  position: relative;
  background: white;
  border-radius: 20px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.event-type-popup.show .popup-content {
  transform: scale(1) translateY(0);
}

.popup-header {
  background: linear-gradient(to bottom, #3B1FA3, #00C6FF);
  color: white;
  padding: 25px 30px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
}

.event-type-info {
  flex: 1;
}

.event-type-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.event-type-badge.badge-activity {
  background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}
.event-type-badge.badge-generic {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}
.event-type-badge.badge-workshop {
  background: linear-gradient(135deg, #f7b731 0%, #f5af19 100%);
}
.event-type-badge.badge-environment {
  background: linear-gradient(135deg, #5f27cd 0%, #341f97 100%);
}

.event-type-title {
  margin: 0 0 8px 0;
  font-size: 1.8rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.event-count {
  margin: 0;
  font-size: 1rem;
  opacity: 0.9;
  font-weight: 400;
}

.popup-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  margin-left: 20px;
}

.popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.popup-body {
  padding: 30px;
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.event-image-container {
  margin-bottom: 25px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.event-type-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.event-item {
  background: #f8f9ff;
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid #001d9e;
  transition: all 0.3s ease;
}

.event-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.event-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.event-date {
  color: #667eea;
  font-weight: 600;
  font-size: 0.9rem;
}

.event-time {
  color: #64748b;
  font-size: 0.85rem;
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 8px;
}

.event-item-title {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
}

.event-venue {
  margin: 0 0 8px 0;
  color: #64748b;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-item-description {
  margin: 0;
  color: #64748b;
  line-height: 1.6;
  font-size: 0.95rem;
}

.popup-footer {
  padding: 20px 30px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.popup-footer .btn {
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.popup-footer .btn-secondary {
  background: #64748b;
  color: white;
}

.popup-footer .btn-secondary:hover {
  background: #475569;
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(100, 116, 139, 0.3);
}

.popup-footer .btn-primary {
  background: linear-gradient(to bottom, #3B1FA3, #00C6FF);
  color: white;
}

.popup-footer .btn-primary:hover {
  background: linear-gradient(to bottom, #3B1FA3, #00C6FF);
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Event Modal */
.event-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.event-modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.event-modal.show .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  background: linear-gradient(to bottom, #3B1FA3, #00C6FF);
  color: white;
  padding: 20px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.modal-body {
  padding: 25px;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  height: auto;
}

.modal-content-wrapper {
  max-height: 50vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #3B1FA3, #00C6FF);
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Event Card */
.event-card {
  background: #f8f9ff;
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.event-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.event-image-modal {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.event-type-tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
}

.event-type-tag.generic {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}
.event-type-tag.activity {
  background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}
.event-type-tag.workshop {
  background: linear-gradient(135deg, #f7b731 0%, #f5af19 100%);
}
.event-type-tag.environment {
  background: linear-gradient(135deg, #5f27cd 0%, #341f97 100%);
}

.event-type-clickable {
  cursor: pointer;
  transition: all 0.3s ease;
}

.event-type-clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  filter: brightness(1.1);
}

.event-time {
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 500;
}

.event-card h4 {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
}

.event-description {
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.event-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
}

.event-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.event-actions .btn {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-outline-primary {
  color: #667eea;
  border-color: #667eea;
  background: transparent;
}

.btn-outline-primary:hover {
  background: #667eea;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-outline-secondary {
  color: #64748b;
  border-color: #64748b;
  background: transparent;
}

.btn-outline-secondary:hover {
  background: #64748b;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(100, 116, 139, 0.3);
}

.modal-footer {
  padding: 20px 25px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.modal-footer .btn {
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
}

.btn-secondary {
  background: #64748b;
  color: white;
}

.btn-secondary:hover {
  background: #475569;
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(100, 116, 139, 0.3);
}

.btn-primary {
  background: linear-gradient(to bottom, #3B1FA3, #00C6FF);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Date Actions Modal */
.date-actions {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.date-actions.show {
  opacity: 1;
  visibility: visible;
}

.actions-content {
  background: white;
  border-radius: 20px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.date-actions.show .actions-content {
  transform: scale(1) translateY(0);
}

.actions-content h4 {
  margin: 0 0 20px 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  color: #475569;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.action-btn:hover {
  border-color: #667eea;
  color: #667eea;
  background: #f0f4ff;
  transform: translateX(5px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.action-btn i {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Filter Effects */
.filtered-highlight {
  animation: highlightPulse 1s ease infinite;
}

@keyframes highlightPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    border-color: #667eea;
  }
  50% {
    box-shadow: 0 0 0 8px rgba(102, 126, 234, 0);
  }
}

.filtered-dim {
  opacity: 0.3;
  filter: grayscale(100%);
  pointer-events: none;
}

/* Clear Filter Button */
.clear-filter {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #e2e8f0;
  color: #64748b;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 10;
}

.clear-filter:hover {
  background: #ff6b6b;
  color: white;
  border-color: #ff6b6b;
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

/* Loading State */
.calendar-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  display: none;
}

.calendar-loading.active {
  display: block;
}

.calendar-loading::before {
  content: "";
  width: 50px;
  height: 50px;
  border: 4px solid rgba(102, 126, 234, 0.2);
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .popup-content {
    width: 95%;
    margin: 20px;
    max-height: 90vh;
  }

  .popup-header {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    margin-left: 0;
  }

  .event-type-title {
    font-size: 1.4rem;
  }

  .popup-body {
    padding: 20px;
    max-height: 50vh;
  }

  .event-type-image {
    height: 180px;
  }

  .event-item {
    padding: 15px;
  }

  .event-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .popup-footer {
    padding: 15px 20px;
    flex-direction: column;
    gap: 10px;
  }

  .popup-footer .btn {
    width: 100%;
    padding: 12px 20px;
    text-align: center;
  }

  .modal-content {
    width: 95%;
    margin: 20px;
    max-height: 90vh;
  }

  .modal-header {
    padding: 15px 20px;
  }

  .modal-header h3 {
    font-size: 1.2rem;
  }

  .modal-body {
    padding: 20px;
    max-height: 50vh;
  }

  .modal-footer {
    padding: 15px 20px;
    flex-direction: column;
    gap: 10px;
  }

  .modal-footer .btn {
    width: 100%;
    padding: 12px 20px;
  }

  .event-card {
    padding: 15px;
  }

  .event-actions {
    flex-direction: column;
  }

  .event-actions .btn {
    width: 100%;
    text-align: center;
  }

  .actions-content {
    padding: 25px 20px;
    margin: 20px;
  }

  .action-btn {
    padding: 12px 15px;
    font-size: 0.9rem;
  }

  .day-tooltip {
    font-size: 0.75rem;
    padding: 8px 12px;
    max-width: 200px;
    white-space: normal;
  }


}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus States */
.event-modal:focus,
.date-actions:focus {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

.modal-close:focus,
.action-btn:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .modal-content,
  .actions-content {
    background: #2d3748;
    color: #e2e8f0;
  }

  .event-card {
    background: #4a5568;
    border-color: #718096;
  }

  .event-card h4 {
    color: #e2e8f0;
  }

  .modal-header h3 {
    color: white;
  }

  .actions-content h4 {
    color: #e2e8f0;
  }

  .action-btn {
    background: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
  }

  .action-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
  }

  .modal-footer {
    background: #4a5568;
    border-color: #718096;
  }
}
