/* =====================================================
   2026 Yearly Calendar - Styles
   ===================================================== */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* Header */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
  font-size: 2rem;
  font-weight: 600;
}

/* Calendar Grid - Responsive */
.calendar-grid {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1800px;
  margin: 0 auto;
  
  /* Desktop: 3 columns */
  grid-template-columns: repeat(3, 1fr);
}

/* Tablet: 2 columns */
@media (max-width: 1200px) {
  .calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: 1 column */
@media (max-width: 768px) {
  .calendar-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
  }
  
  .header h1 {
    font-size: 1.5rem;
  }
}

/* Month Container */
.month-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.month-container:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Month Title */
.month-title {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  padding: 0.75rem;
  font-size: 1.1rem;
  font-weight: 500;
}

/* Calendar Instance - height set dynamically by JS based on events */
.calendar-instance {
  min-height: 200px;
  padding: 0.5rem;
}

/* =====================================================
   TOAST UI Calendar Overrides
   ===================================================== */

/* Hide unnecessary elements */
.toastui-calendar-month-more-button,
.toastui-calendar-panel-allday {
  display: none !important;
}

/* Calendar grid header - day number */
.toastui-calendar-grid-cell-header {
  text-align: center !important;
  padding: 2px 4px !important;
}

.toastui-calendar-template-monthGridHeader {
  text-align: center;
  font-weight: 500;
}

/* Grid header element */
.grid-header {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  border-radius: 50%;
}

.grid-header.today {
  background-color: #667eea;
  color: white;
}

/* Day names (Mon, Tue, Wed...) */
.day-name {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
}

/* Other month days - light background but events still visible */
.toastui-calendar-weekday-grid-cell-other-month {
  background-color: #fafafa !important;
}

/* Hide day numbers for other month days but keep events visible */
.toastui-calendar-weekday-grid-cell-other-month .toastui-calendar-template-monthGridHeader {
  visibility: hidden;
}

.toastui-calendar-grid-cell-date .toastui-calendar-weekday-grid-date-decorator {
  display: none;
}

/* Hide more events indicators */
.more-events,
.toastui-calendar-grid-cell-more-events,
.toastui-calendar-weekday-exceed-left,
.toastui-calendar-weekday-exceed-right,
.toastui-calendar-month-more-events {
  display: none !important;
}

/* Force all events to be visible - no clipping */
.toastui-calendar-month-week-item {
  overflow: visible !important;
}

.toastui-calendar-weekday-events {
  overflow: visible !important;
}

.toastui-calendar-weekday-grid {
  overflow: visible !important;
}

/* Events display in monthly view */
.toastui-calendar-weekday-event-block {
  margin: 1px 2px !important;
}

.toastui-calendar-weekday-event {
  font-size: 10px !important;
  padding: 1px 4px !important;
  border-radius: 3px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Event title - with native tooltip for full name */
.event-title,
.event-link {
  font-size: 10px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

/* Event name tooltip bubble */
.event-tooltip {
  position: fixed;
  z-index: 10000;
  background: #333;
  color: white;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  pointer-events: none;
  transition: opacity 0.15s ease;
  max-width: 350px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  word-wrap: break-word;
}

.event-tooltip.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#tooltip-text {
  display: block;
}

/* =====================================================
   Event Styling
   ===================================================== */

/* Event element styles */
.toastui-calendar-template-monthDayname {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Custom event link styling */
.event-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.event-link:hover {
  text-decoration: underline;
}

/* Event wrapper for heart icon */
.event-wrapper {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
}

.event-wrapper .event-title,
.event-wrapper .event-link {
  flex: 1;
  min-width: 0;
}

/* Event flag image */
.event-flag {
  width: 16px;
  height: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 2px;
}

/* Favorite heart icon */
.favorite-heart {
  font-size: 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}

.event-wrapper:hover .favorite-heart {
  opacity: 1;
}

.favorite-heart.active {
  opacity: 1;
}

.favorite-heart:hover {
  transform: scale(1.3);
}

/* =====================================================
   Country Filter Panel
   ===================================================== */

.filter-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.filter-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.filter-header:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.filter-icon {
  font-size: 18px;
}

.filter-title {
  font-size: 14px;
  font-weight: 500;
}

.filter-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.filter-arrow.open {
  transform: rotate(180deg);
}

.filter-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  max-width: 280px;
  overflow: hidden;
}

.filter-dropdown.hidden {
  display: none;
}

.filter-actions {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.filter-btn {
  flex: 1;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.filter-btn:first-child {
  background: #667eea;
  color: white;
}

.filter-btn:first-child:hover {
  background: #5a6fd6;
}

.filter-btn:last-child {
  background: #f0f0f0;
  color: #666;
}

.filter-btn:last-child:hover {
  background: #e0e0e0;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.filter-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 22px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 2px solid transparent;
  background: #f8f8f8;
  padding: 8px;
}

.filter-item:hover {
  background: #eef;
  transform: scale(1.1);
}

.filter-item.active {
  background: #e8f5e9;
  border-color: #4caf50;
}

.filter-item.inactive {
  background: #ffebee;
  border-color: #ef5350;
  opacity: 0.5;
}

.filter-item.inactive:hover {
  opacity: 0.8;
}

/* Filter flag image */
.filter-flag-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Favorite filter special styling */
.filter-item.filter-favorite {
  background: #fff0f0;
  border-color: #ffcdd2;
}

.filter-item.filter-favorite.active {
  background: #ffebee;
  border-color: #e91e63;
}

/* Filter count badge */
.filter-count {
  background: #ff5722;
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

