/* Event Booking Calendar Frontend Styles */
#ebc-calendar-container {
  max-width: 100%;
  width: 100%;
  margin: 10px auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

@media (min-width: 768px) {
  #ebc-calendar-container {
    max-width: 700px;
    margin: 20px auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }
}

#ebc-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: relative;
}

#ebc-calendar-header h3 {
  margin: 0;
  font-size: 1.4em;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
  flex: 1;
}

#ebc-prev-month,
#ebc-next-month {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  min-width: 50px;
}

#ebc-prev-month:hover,
#ebc-next-month:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#ebc-calendar-grid {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  width: 100%;
  box-sizing: border-box;
}

#ebc-calendar-days {
  display: contents !important;
}

.ebc-calendar-day,
.ebc-day-header {
  box-sizing: border-box;
  width: 100%;
}

.ebc-day-header {
  padding: 16px 8px;
  text-align: center;
  font-weight: 600;
  background: #f1f3f4;
  border-bottom: 2px solid #e0e0e0;
  font-size: 13px;
  color: #5f6368;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ebc-calendar-day {
  min-height: 80px;
  padding: 8px;
  border: 1px solid #e8eaed;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: white;
}

.ebc-calendar-day:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.ebc-calendar-day.has-event {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-color: #2196f3;
}

.ebc-calendar-day.has-event:hover {
  background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.3);
}

.ebc-calendar-day.ebc-today {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  border-color: #ff9800;
  font-weight: 600;
}

.ebc-calendar-day.ebc-today .ebc-day-number {
  color: #e65100;
  font-weight: 700;
}

.ebc-day-number {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
  color: #202124;
}

.ebc-event-indicator {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  color: white;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 10px;
  margin-bottom: 2px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.3s ease;
  cursor: pointer;
  font-weight: 500;
}

.ebc-event-indicator:hover {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);
}

.ebc-empty-day {
  background: #fafafa;
  border: 1px solid #e8eaed;
  min-height: 80px;
}

/* Transition animations */
.ebc-transition-slideLeft {
  transform: translateX(-100%);
}

.ebc-transition-slideRight {
  transform: translateX(100%);
}

/* Modal Styles */
.ebc-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.ebc-modal-content {
  background-color: #ffffff;
  margin: 2% auto;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-60px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ebc-close {
  color: #9aa0a6;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 15px;
  transition: color 0.3s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.ebc-close:hover {
  color: #202124;
  background: #f1f3f4;
}

.ebc-event-description {
  background: linear-gradient(135deg, #f8f9fa 0%, #e8f0fe 100%);
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-style: italic;
  color: #5f6368;
  border-left: 4px solid #4285f4;
  font-size: 14px;
  line-height: 1.5;
}

.ebc-event-date-info {
  background: #e8f5e8;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  color: #137333;
  font-weight: 500;
  border-left: 4px solid #34a853;
}

.ebc-form-group {
  margin-bottom: 24px;
}

.ebc-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #202124;
  font-size: 14px;
}

.ebc-form-group input[type="text"],
.ebc-form-group input[type="email"],
.ebc-form-group input[type="tel"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #dadce0;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  box-sizing: border-box;
  font-family: inherit;
}

.ebc-form-group input[type="text"]:focus,
.ebc-form-group input[type="email"]:focus,
.ebc-form-group input[type="tel"]:focus {
  border-color: #4285f4;
  outline: none;
  box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.1);
}

.ebc-form-group input[type="checkbox"] {
  margin-right: 12px;
  transform: scale(1.3);
  accent-color: #4285f4;
}

.ebc-form-group label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 12px;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

.ebc-form-group label:has(input[type="checkbox"]):hover {
  background-color: #f8f9fa;
}

.ebc-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px;
  flex-wrap: wrap;
}

.ebc-form-actions button {
  padding: 14px 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 120px;
}

.ebc-form-actions button[type="submit"] {
  background: linear-gradient(135deg, #4285f4 0%, #1a73e8 100%);
  color: white;
}

.ebc-form-actions button[type="submit"]:hover:not(:disabled) {
  background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

.ebc-form-actions button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ebc-cancel {
  background: #f1f3f4;
  color: #5f6368;
}

.ebc-cancel:hover {
  background: #e8eaed;
  color: #202124;
}

/* Validation Styles */
.ebc-validation-errors {
  background: linear-gradient(135deg, #fce8e6 0%, #fdd663 100%);
  color: #d93025;
  border: 1px solid #fce8e6;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  animation: shake 0.6s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

.ebc-validation-errors ul {
  margin: 0;
  padding-left: 20px;
}

.ebc-error {
  border-color: #ea4335 !important;
  background-color: #fce8e6 !important;
  animation: errorPulse 0.6s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  #ebc-calendar-container {
    margin: 5px;
    border-radius: 8px;
    width: calc(100% - 10px);
    max-width: calc(100% - 10px);
  }

  #ebc-calendar-header {
    padding: 12px;
  }

  #ebc-calendar-header h3 {
    font-size: 1.1em;
  }

  #ebc-prev-month,
  #ebc-next-month {
    padding: 8px 10px;
    font-size: 14px;
    min-width: 40px;
  }

  #ebc-calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    grid-gap: 1px;
    background: #f8f9fa;
  }

  .ebc-calendar-day {
    min-height: 50px;
    padding: 4px 2px;
    font-size: 11px;
    display: flex !important;
    flex-direction: column !important;
  }

  .ebc-day-number {
    font-size: 11px;
    margin-bottom: 2px;
  }

  .ebc-event-indicator {
    font-size: 8px;
    padding: 1px 2px;
    margin-bottom: 1px;
    border-radius: 3px;
  }

  .ebc-day-header {
    padding: 8px 2px;
    font-size: 10px;
  }

  .ebc-modal-content {
    margin: 5% auto;
    width: 95%;
    padding: 20px;
  }

  .ebc-form-actions {
    flex-direction: column;
  }

  .ebc-form-actions button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  #ebc-calendar-container {
    margin: 2px;
    width: calc(100% - 4px);
    max-width: calc(100% - 4px);
  }

  #ebc-calendar-header {
    padding: 10px;
  }

  #ebc-calendar-header h3 {
    font-size: 1em;
  }

  #ebc-prev-month,
  #ebc-next-month {
    padding: 6px 8px;
    font-size: 12px;
    min-width: 35px;
  }

  #ebc-calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    grid-gap: 1px;
  }

  .ebc-calendar-day {
    min-height: 45px;
    padding: 2px 1px;
    font-size: 10px;
    display: flex !important;
    flex-direction: column !important;
  }

  .ebc-day-number {
    font-size: 10px;
    margin-bottom: 1px;
  }

  .ebc-event-indicator {
    font-size: 7px;
    padding: 1px;
    margin-bottom: 1px;
    border-radius: 2px;
    line-height: 1.2;
  }

  .ebc-day-header {
    padding: 6px 1px;
    font-size: 9px;
  }

  .ebc-modal-content {
    padding: 15px;
    margin: 2% auto;
    width: 98%;
  }

  .ebc-form-group input[type="text"],
  .ebc-form-group input[type="email"],
  .ebc-form-group input[type="tel"] {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 12px;
  }
}

/* Ensure calendar grid always displays */
@media (max-width: 768px) {
  #ebc-calendar-grid,
  #ebc-calendar-days,
  .ebc-calendar-day,
  .ebc-day-header {
    display: block !important;
  }

  #ebc-calendar-grid {
    display: grid !important;
  }

  #ebc-calendar-days {
    display: contents !important;
  }
}

/* Loading states */
.ebc-loading {
  opacity: 0.6;
  pointer-events: none;
}

.ebc-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #4285f4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
.ebc-calendar-day:focus,
.ebc-event-indicator:focus,
#ebc-prev-month:focus,
#ebc-next-month:focus {
  outline: 2px solid #4285f4;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .ebc-calendar-day {
    border-width: 2px;
  }

  .ebc-event-indicator {
    border: 1px solid;
  }
}

/* Force event indicators to show on mobile */
.ebc-event-indicator {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%) !important;
  color: white !important;
  padding: 2px 4px !important;
  border-radius: 4px !important;
  font-size: 9px !important;
  margin-bottom: 1px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  font-weight: 500 !important;
  line-height: 1.1 !important;
  min-height: 16px !important;
  box-sizing: border-box !important;
}

/* Availability styles */
.ebc-event-availability {
  background: #f8f9fa;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.4;
  border-left: 4px solid #6c757d;
}

.ebc-availability-good {
  background: #d4edda;
  color: #155724;
  border-left-color: #28a745;
}

.ebc-availability-limited {
  background: #fff3cd;
  color: #856404;
  border-left-color: #ffc107;
}

.ebc-availability-full {
  background: #f8d7da;
  color: #721c24;
  border-left-color: #dc3545;
}

/* Mobile specific fixes */
@media (max-width: 768px) {
  .ebc-event-indicator {
    font-size: 8px !important;
    padding: 1px 2px !important;
    margin-bottom: 1px !important;
    border-radius: 2px !important;
    min-height: 14px !important;
    line-height: 1 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .ebc-calendar-day {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }

  .ebc-calendar-day.has-event {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
    border-color: #2196f3 !important;
  }
}

@media (max-width: 480px) {
  .ebc-event-indicator {
    font-size: 7px !important;
    padding: 1px !important;
    margin-bottom: 1px !important;
    border-radius: 2px !important;
    min-height: 12px !important;
    line-height: 1 !important;
    max-width: 100% !important;
    word-break: break-all !important;
  }
}

/* Force visibility on all devices */
.ebc-calendar-day .ebc-event-indicator {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
