/* Events Page Styles */

.events-container {
  padding: 24px 20px 120px;
  min-height: calc(100vh - 90px);
  background: linear-gradient(180deg, #f6f3e2 0%, #eef4fd 100%);
}

/* Header */
.events-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.events-title {
  font-size: 28px;
  font-weight: 700;
  color: #162b46;
  margin: 0 0 6px;
}

.events-subtitle {
  color: #5d6483;
  font-size: 15px;
  margin: 0;
}

.events-actions {
  display: flex;
  gap: 8px;
}

.events-filter-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  background: white;
  color: #162b46;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.events-filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Filters */
.event-filters {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.event-filters.hidden {
  display: none;
}

.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-row input,
.filter-row select {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 15px;
  background: #faf8f2;
}

.filter-row input:focus,
.filter-row select:focus {
  outline: none;
  border-color: #1e3a8a;
}

/* Events Grid */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* Loading State */
.events-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #5d6483;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top-color: #1e3a8a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.events-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: #5d6483;
}

.events-empty.hidden {
  display: none;
}

.events-empty .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.events-empty h3 {
  font-size: 20px;
  font-weight: 700;
  color: #162b46;
  margin: 0 0 8px;
}

.events-empty p {
  margin: 0;
  font-size: 15px;
}

/* Event Cards */
.event-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  border-color: #1e3a8a;
}

.event-card.past {
  opacity: 0.7;
}

/* Card Header */
.event-card-header {
  height: 100px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

/* Event Type Colors */
.event-type-conference .event-card-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.event-type-meeting .event-card-header {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.event-type-fellowship .event-card-header {
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
}

.event-type-gospel .event-card-header {
  background: linear-gradient(135deg, #dc2626 0%, #f87171 100%);
}

.event-type-bible .event-card-header {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.event-type-default .event-card-header {
  background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
}

.event-card-icon {
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.event-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.event-badge.upcoming {
  background: #dcfce7;
  color: #166534;
}

.event-badge.today {
  background: #dbeafe;
  color: #1e40af;
  animation: pulse 2s infinite;
}

.event-badge.past {
  background: #f3f4f6;
  color: #6b7280;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Card Body */
.event-card-body {
  padding: 20px;
}

.event-card-date {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #1e3a8a;
  font-weight: 600;
  font-size: 14px;
}

.event-date-icon {
  font-size: 16px;
}

.event-card-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: #162b46;
  line-height: 1.3;
}

.event-card-location {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #5d6483;
  font-size: 14px;
  margin-bottom: 12px;
}

.event-card-description {
  margin: 0;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Footer */
.event-card-footer {
  padding: 16px 20px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  gap: 8px;
}

.event-card-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  text-align: center;
}

.event-card-btn.primary {
  background: #1e3a8a;
  color: white;
}

.event-card-btn.primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.event-card-btn.secondary {
  background: #f3f4f6;
  color: #4b5563;
}

.event-card-btn.secondary:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

/* Modal */
.event-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.event-modal.hidden {
  display: none;
}

.event-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.event-detail-content {
  position: relative;
  background: white;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  border-radius: 24px 24px 0 0;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.event-detail-header {
  position: sticky;
  top: 0;
  background: white;
  padding: 16px 20px;
  display: flex;
  justify-content: flex-end;
  border-bottom: 1px solid #f3f4f6;
  z-index: 10;
}

.event-detail-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.event-detail-close:hover {
  background: #e5e7eb;
}

.event-detail-body {
  padding: 0 24px 32px;
  text-align: center;
}

.event-detail-icon {
  font-size: 64px;
  margin: 24px 0 12px;
}

.event-detail-type {
  display: inline-block;
  padding: 6px 16px;
  background: #eff6ff;
  color: #1e40af;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.event-detail-title {
  font-size: 24px;
  font-weight: 700;
  color: #162b46;
  margin: 0 0 24px;
  line-height: 1.3;
}

.event-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.event-detail-meta-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #4b5563;
  font-size: 15px;
}

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

.meta-text {
  font-weight: 500;
}

.event-detail-section {
  text-align: left;
  margin-bottom: 28px;
}

.event-detail-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
}

.event-detail-section p {
  margin: 0;
  color: #374151;
  line-height: 1.7;
  font-size: 15px;
}

.event-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-detail-btn {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-detail-btn.primary {
  background: #1e3a8a;
  color: white;
}

.event-detail-btn.primary:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.event-detail-btn.secondary {
  background: #f3f4f6;
  color: #4b5563;
}

.event-detail-btn.secondary:hover {
  background: #e5e7eb;
  transform: translateY(-2px);
}

/* ========== THEME SUPPORT ========== */

/* Dark Theme */
body.dark-theme .events-container {
  background: #12181f;
}

body.dark-theme .events-title,
body.dark-theme .event-card-title,
body.dark-theme .event-detail-title {
  color: #ffffff;
}

body.dark-theme .events-subtitle,
body.dark-theme .event-card-date,
body.dark-theme .event-card-location,
body.dark-theme .event-detail-section p,
body.dark-theme .event-detail-label,
body.dark-theme .filter-row label {
  color: #e8e8e8;
}

body.dark-theme .events-filter-btn,
body.dark-theme .filter-row input,
body.dark-theme .filter-row select {
  background: #1e1e1e;
  border: 1px solid #3d3d3d;
  color: #e8e8e8;
}

body.dark-theme .event-card,
body.dark-theme .event-detail-content {
  background: #1e1e1e;
  border-color: #3d3d3d;
}

body.dark-theme .event-card:hover {
  background: #2d2d2d;
}

body.dark-theme .event-detail-btn.secondary {
  background: #2d2d2d;
  color: #e8e8e8;
}

body.dark-theme .event-detail-btn.secondary:hover {
  background: #3d3d3d;
}

/* Parchment Theme */
body.parchment-theme .events-container {
  background: #f5e6c8;
}

body.parchment-theme .events-title,
body.parchment-theme .event-card-title,
body.parchment-theme .event-detail-title {
  color: #1a1a1a;
}

body.parchment-theme .events-subtitle,
body.parchment-theme .event-card-date,
body.parchment-theme .event-card-location,
body.parchment-theme .event-detail-section p,
body.parchment-theme .event-detail-label,
body.parchment-theme .filter-row label {
  color: #3d2914;
}

body.parchment-theme .events-filter-btn,
body.parchment-theme .filter-row input,
body.parchment-theme .filter-row select {
  background: #fff8e7;
  border: 1px solid #d4c4a8;
  color: #3d2914;
}

body.parchment-theme .event-card,
body.parchment-theme .event-detail-content {
  background: #fff8e7;
  border-color: #d4c4a8;
}

body.parchment-theme .event-card:hover {
  background: #f0e6d0;
}

body.parchment-theme .event-detail-btn.secondary {
  background: #f0e6d0;
  color: #3d2914;
}

body.parchment-theme .event-detail-btn.secondary:hover {
  background: #e6d9b8;
}

/* Light Theme */
body.light-theme .events-container {
  background: #f8fafc;
}

/* Mobile */
@media (max-width: 640px) {
  .events-grid {
    grid-template-columns: 1fr;
  }
  
  .events-title {
    font-size: 24px;
  }
  
  .filter-row input,
  .filter-row select {
    min-width: 100%;
  }
}
