* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f5f5;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Admin Panel */
.admin-toggle {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  background-color: #4a90e2;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.admin-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 90%;
  max-width: 400px;
  height: 100vh;
  background-color: white;
  box-shadow: -2px 0 10px rgba(0,0,0,0.2);
  z-index: 2000;
  overflow-y: auto;
  transition: right 0.3s ease;
}

.admin-panel.active {
  right: 0;
}

.admin-header {
  background-color: #4a90e2;
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.admin-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.admin-content {
  padding: 20px;
}

.admin-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.admin-section h3 {
  font-size: 16px;
  margin-bottom: 15px;
  color: #333;
}

.admin-section label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  color: #666;
}

.admin-section input,
.admin-section textarea,
.admin-section select {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.admin-section textarea {
  min-height: 80px;
  resize: vertical;
}

.admin-btn {
  background-color: #4a90e2;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 10px;
}

.admin-btn:hover {
  background-color: #357abd;
}

.admin-event-item {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 2px solid #4a90e2;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
}

.admin-event-item h4 {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #1976d2;
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 2px solid #4a90e2;
}

.admin-color-picker {
  width: 100%;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 5px;
}

.admin-checkbox {
  margin-right: 8px;
}

/* Calendar Container */
.calendar-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-color: #f5f5f5;
}

.month-view {
  width: 100%;
  position: relative;
}

.month-next {
  position: absolute;
  top: 0;
  left: 100%;
  width: 100%;
  transition: left 0.3s ease;
  z-index: 10;
}

.month-next.active {
  left: 0;
  z-index: 20;
}

#current-month {
  transition: opacity 0.3s ease;
}

/* Banner Section */
.banner-section {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.3));
}

.logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: block;
  margin-bottom: 10px;
}

.month-year {
  color: white;
  font-size: 24px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  letter-spacing: 1px;
}

/* Events List */
.events-list {
  background-color: #f5f5f5;
  padding-bottom: 20px;
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (min-width: 768px) {
  .events-list {
    max-width: 800px;
    margin: 0 auto;
  }
}

.event-item {
  display: flex;
  align-items: stretch;
  background-color: white;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
  margin-bottom: 28px;
}

@media (min-width: 768px) {
  .event-item {
    width: 100%;
    max-width: 800px;
    height: 100px;
  }
}

.event-item::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #bdbdbd;
}

.event-item:active {
  background-color: #f0f0f0;
}

.event-date-col {
  min-width: 90px;
  padding: 22px 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #fafafa;
}

.event-day {
  font-size: 12px;
  color: #000000;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 500;
}

.event-date {
  font-size: 22px;
  font-weight: bold;
  color: #000000;
}

.event-card {
  flex: 1;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 10px;
}

.event-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.event-icon.menu-icon::before {
  content: '☰';
}

.event-icon.doc-icon::before {
  content: '□';
  font-size: 20px;
  line-height: 1;
}

.event-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.event-title {
  font-size: 16px;
  font-weight: bold;
  color: white;
  margin-bottom: 4px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.event-description {
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  margin-top: 4px;
}

.event-time,
.event-person {
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-time::before {
  content: '🕐';
  font-size: 14px;
}

.event-person::before {
  content: '👤';
  font-size: 14px;
}

.event-check {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: #FFD700;
  font-size: 24px;
  font-weight: bold;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 10;
  pointer-events: none;
  padding-right: 8px;
}

/* Event Card Colors */
.event-card.color-light-blue {
  background-color: #64b5f6;
}

.event-card.color-dark-blue {
  background-color: #1976d2;
}

.event-card.color-purple {
  background-color: #7b2cbf;
}

.event-card.color-teal {
  background-color: #20b2aa;
}

.event-card.color-red {
  background-color: #d32f2f;
}

/* Swipe Hint */
.swipe-hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0,0,0,0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 12px;
  z-index: 100;
  animation: fadeInOut 3s ease-in-out;
  pointer-events: none;
  display: none;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  10%, 90% { opacity: 1; }
}

/* Event Details Modal */
.event-details {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 3000;
  display: none;
  align-items: flex-end;
}

.event-details.active {
  display: flex;
}

.event-details-content {
  width: 100%;
  max-height: 80vh;
  background-color: white;
  border-radius: 20px 20px 0 0;
  padding: 25px;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.event-details-text {
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.event-register-btn {
  display: block;
  width: 100%;
  padding: 15px;
  background-color: #4a90e2;
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
}

.event-register-btn:active {
  background-color: #357abd;
}

.event-details-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  background-color: #f0f0f0;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 14px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .banner-section {
    height: 135px !important;
  }
  
  .logo {
    width: 70px;
    height: 70px;
  }
  
  .month-year {
    font-size: 20px;
  }
  
  .event-date-col {
    min-width: 75px;
    padding: 18px 10px;
  }
  
  .event-day {
    font-size: 11px;
    margin-bottom: 5px;
  }
  
  .event-date {
    font-size: 20px;
  }
  
  .event-card {
    padding: 12px 10px;
    gap: 8px;
  }
  
  .event-title {
    font-size: 15px;
    line-height: 1.3;
  }
  
  .event-meta {
    font-size: 11px;
    gap: 8px;
  }
  
  .event-icon {
    width: 20px;
    height: 20px;
    font-size: 14px;
    flex-shrink: 0;
  }
  
  .event-check {
    font-size: 20px;
    letter-spacing: 1.5px;
  }
}

