/* Calendar Integration Styles - Mobile First */

* {
  box-sizing: border-box;
}

.calendar-container {
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(20, 25, 40, 0.6) 0%, rgba(15, 20, 35, 0.7) 100%);
  border: 1.5px solid rgba(255, 122, 0, 0.3);
  border-radius: 18px;
  backdrop-filter: blur(15px);
  width: 100%;
  box-shadow: inset 0 1px 3px rgba(255, 122, 0, 0.1),
              0 8px 32px rgba(255, 114, 0, 0.12);
}

/* Calendar Wrapper */
.calendar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* Calendar Header */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: linear-gradient(
    135deg,
    rgba(255, 122, 0, 0.05),
    rgba(255, 165, 0, 0.03)
  );
  border-radius: 10px;
  border: 1px solid rgba(255, 122, 0, 0.15);
  gap: 6px;
}

.calendar-header h3 {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  flex: 1;
  text-align: center;
  min-width: 0;
}

.calendar-nav-btn {
  background: rgba(255, 122, 0, 0.1);
  border: 1px solid rgba(255, 122, 0, 0.2);
  color: #ff7200;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  padding: 0;
}

.calendar-nav-btn:hover {
  background: rgba(255, 122, 0, 0.2);
  border-color: rgba(255, 122, 0, 0.4);
}

.calendar-nav-btn:active {
  transform: scale(0.95);
}

.calendar-nav-btn svg {
  width: 14px;
  height: 14px;
}

/* Weekdays */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 4px;
  background: rgba(255, 122, 0, 0.05);
  border-radius: 6px;
}

.weekday {
  text-align: center;
  color: #ff7200;
  font-weight: 600;
  font-size: 9px;
  padding: 3px 1px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1;
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 122, 0, 0.1);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  color: #cbd5e1;
  font-size: 9px;
  font-weight: 500;
  min-height: 32px;
}

.calendar-day:hover:not(.empty) {
  background: rgba(255, 122, 0, 0.1);
  border-color: rgba(255, 122, 0, 0.3);
}

.calendar-day.empty {
  cursor: default;
  background: transparent;
  border: none;
}

.calendar-day.today {
  background: rgba(255, 122, 0, 0.15);
  border-color: #ff7200;
  color: #ff7200;
  font-weight: 700;
}

.calendar-day.has-event {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
}

.calendar-day.has-event .day-number {
  color: #10b981;
  font-weight: 700;
}

.calendar-day.selected {
  background: linear-gradient(
    135deg,
    rgba(255, 122, 0, 0.3),
    rgba(255, 165, 0, 0.2)
  );
  border-color: #ff7200;
  color: #fff;
}

.day-number {
  font-size: 9px;
  font-weight: 600;
  z-index: 2;
}

.event-count {
  position: absolute;
  top: 0px;
  right: 0px;
  background: #10b981;
  color: #fff;
  font-size: 7px;
  font-weight: 700;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-indicator {
  position: absolute;
  bottom: 1px;
  width: 2px;
  height: 2px;
  background: rgba(255, 122, 0, 0.5);
  border-radius: 50%;
  opacity: 0;
}

.calendar-day.has-event .event-indicator {
  opacity: 1;
}

/* Calendar Legend */
.calendar-legend {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  border: 1px solid rgba(255, 122, 0, 0.1);
  font-size: 9px;
  flex-wrap: wrap;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #cbd5e1;
}

.legend-color {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  flex-shrink: 0;
}

.legend-color.has-event {
  background: rgba(16, 185, 129, 0.5);
  border: 1px solid #10b981;
}

.legend-color.selected {
  background: rgba(255, 122, 0, 0.7);
  border: 1px solid #ff7200;
}

/* Events Panel */
.calendar-events-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 122, 0, 0.08) 0%, rgba(255, 165, 0, 0.04) 100%);
  border: 1.5px solid rgba(255, 122, 0, 0.3);
  border-radius: 14px;
  min-height: 120px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(255, 114, 0, 0.1);
}

.calendar-events-panel h3 {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1.5px solid rgba(255, 122, 0, 0.25);
  letter-spacing: 0.5px;
}

.selected-date-display {
  color: #ff7200;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
  max-height: 200px;
  padding-right: 2px;
}

.events-list::-webkit-scrollbar {
  width: 4px;
}

.events-list::-webkit-scrollbar-track {
  background: transparent;
}

.events-list::-webkit-scrollbar-thumb {
  background: rgba(255, 122, 0, 0.3);
  border-radius: 2px;
}

.event-item {
  padding: 8px;
  background: rgba(255, 122, 0, 0.05);
  border: 1px solid rgba(255, 122, 0, 0.1);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.event-item:hover {
  background: rgba(255, 122, 0, 0.1);
  border-color: rgba(255, 122, 0, 0.2);
}

.event-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}

.event-item h4 {
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  margin: 0;
  flex: 1;
  line-height: 1.2;
}

.event-badge {
  background: linear-gradient(135deg, #ff7200, #ffa500);
  color: #fff;
  font-size: 7px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.event-item-content {
  color: #cbd5e1;
  font-size: 10px;
  line-height: 1.3;
  margin: 0 0 6px 0;
  display: none;
}

.no-events {
  color: #cbd5e1;
  font-size: 11px;
  text-align: center;
  padding: 12px;
  margin: 0;
  font-style: italic;
}

.btn-small {
  width: 100%;
  padding: 6px 10px;
  background: linear-gradient(135deg, #ff7200, #ffa500);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-small:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 122, 0, 0.3);
}

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

/* Event Modal */
.event-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.event-modal {
  background: linear-gradient(135deg, rgba(15, 15, 35, 0.95) 0%, rgba(26, 29, 46, 0.95) 100%);
  border: 1.5px solid rgba(255, 122, 0, 0.25);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: slideInUp 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.event-modal::-webkit-scrollbar {
  width: 8px;
}

.event-modal::-webkit-scrollbar-track {
  background: transparent;
}

.event-modal::-webkit-scrollbar-thumb {
  background: rgba(255, 122, 0, 0.3);
  border-radius: 4px;
}

.event-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 122, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 122, 0, 0.12);
  border: 1.5px solid rgba(255, 122, 0, 0.25);
  color: #ffa726;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 122, 0, 0.25);
  border-color: rgba(255, 122, 0, 0.5);
  color: #ffb366;
  transform: scale(1.05);
}

.modal-close:active {
  transform: scale(0.95);
}

.event-modal-header {
  padding: 28px 28px 20px;
  border-bottom: 1.5px solid rgba(255, 122, 0, 0.15);
  background: linear-gradient(135deg, rgba(255, 122, 0, 0.04) 0%, rgba(255, 165, 0, 0.02) 100%);
}

.event-modal-date {
  color: #ffa726;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-modal-date::before {
  content: "📅";
  font-size: 14px;
}

.event-modal h2 {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  margin: 10px 0 0 0;
  line-height: 1.3;
  letter-spacing: -0.5px;
}

.event-modal-body {
  padding: 28px;
}

.event-modal-image {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 122, 0, 0.1);
  display: block;
}

.event-modal-body p {
  color: #cbd5e1;
  line-height: 1.7;
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 400;
}

.event-modal-body p:last-child {
  margin-bottom: 0;
}

.event-modal-footer {
  padding: 24px 28px;
  border-top: 1.5px solid rgba(255, 122, 0, 0.15);
  display: flex;
  gap: 12px;
  background: rgba(255, 122, 0, 0.03);
}

.event-modal-footer .btn {
  flex: 1;
  font-size: 15px;
  padding: 14px 24px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.event-modal-footer .btn:hover {
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 600px) {
  .event-modal {
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 16px;
  }

  .event-modal-header {
    padding: 20px 20px 16px;
  }

  .event-modal h2 {
    font-size: 20px;
  }

  .event-modal-body {
    padding: 20px;
  }

  .event-modal-footer {
    padding: 16px 20px;
    flex-direction: column;
  }

  .event-modal-footer .btn {
    padding: 12px 16px;
  }
}

/* Tablet (600px and up) */
@media (min-width: 600px) {
  .calendar-container {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
  }

  .calendar-header {
    padding: 12px;
  }

  .calendar-header h3 {
    font-size: 16px;
  }

  .calendar-nav-btn {
    width: 32px;
    height: 32px;
  }

  .calendar-nav-btn svg {
    width: 16px;
    height: 16px;
  }

  .calendar-weekdays {
    gap: 4px;
    padding: 8px;
  }

  .weekday {
    font-size: 11px;
    padding: 6px;
  }

  .calendar-grid {
    gap: 4px;
    padding: 8px;
  }

  .calendar-day {
    font-size: 12px;
    padding: 4px;
    min-height: 44px;
  }

  .day-number {
    font-size: 12px;
  }

  .event-count {
    width: 16px;
    height: 16px;
    font-size: 9px;
  }

  .calendar-events-panel {
    padding: 16px;
    min-height: 200px;
  }

  .calendar-events-panel h3 {
    font-size: 14px;
  }

  .event-item h4 {
    font-size: 13px;
  }

  .event-item-content {
    font-size: 12px;
    display: block;
  }

  .btn-small {
    font-size: 12px;
    padding: 10px;
  }

  .events-list {
    max-height: 250px;
  }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
  .calendar-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex-direction: row;
    gap: 30px;
    padding: 20px;
  }

  .calendar-wrapper {
    gap: 20px;
  }

  .calendar-header {
    padding: 16px;
  }

  .calendar-header h3 {
    font-size: 18px;
    min-width: 150px;
  }

  .calendar-nav-btn {
    width: 40px;
    height: 40px;
  }

  .calendar-nav-btn svg {
    width: 20px;
    height: 20px;
  }

  .calendar-weekdays {
    gap: 8px;
    padding: 12px;
  }

  .weekday {
    font-size: 12px;
    padding: 8px;
  }

  .calendar-grid {
    gap: 8px;
    padding: 12px;
  }

  .calendar-day {
    font-size: 14px;
    padding: 8px;
    min-height: auto;
  }

  .day-number {
    font-size: 14px;
  }

  .event-count {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .calendar-events-panel {
    padding: 24px;
    max-height: 600px;
    min-height: auto;
  }

  .calendar-events-panel h3 {
    font-size: 16px;
  }

  .event-item {
    padding: 12px;
  }

  .event-item h4 {
    font-size: 14px;
  }

  .event-item-content {
    font-size: 12px;
    display: block;
  }

  .btn-small {
    font-size: 12px;
    padding: 8px 12px;
  }

  .events-list {
    max-height: 400px;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Scrollbar Styling */
.calendar-events-panel {
  scrollbar-color: rgba(255, 122, 0, 0.3) transparent;
  scrollbar-width: thin;
}

/* Footer Spacing */
.footer {
  margin-top: 60px;
}
