/**
 * Event System Styles
 * 
 * Styling for event registration system including:
 * - Capacity indicators (green/orange/red)
 * - Registration form styles
 * - Status badges
 * - Flash messages
 * - Event cards and grids
 */

/* ==========================================================================
   Capacity Indicators
   ========================================================================== */

.capacity-indicator {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.capacity-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.capacity-available {
  color: #166534;
  background: #dcfce7;
}

.capacity-available::before {
  background: #22c55e;
}

.capacity-limited {
  color: #92400e;
  background: #fef3c7;
}

.capacity-limited::before {
  background: #f59e0b;
}

.capacity-full {
  color: #991b1b;
  background: #fee2e2;
}

.capacity-full::before {
  background: #ef4444;
}

.capacity-unknown {
  color: #374151;
  background: #f3f4f6;
}

/* ==========================================================================
   Registration Badges
   ========================================================================== */

.registration-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

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

.badge-waitlist {
  color: #92400e;
  background: #fef3c7;
}

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

/* ==========================================================================
   Status Badges
   ========================================================================== */

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-confirmed {
  color: #166534;
  background: #dcfce7;
}

.status-waitlist {
  color: #92400e;
  background: #fef3c7;
}

.status-cancelled {
  color: #6b7280;
  background: #f3f4f6;
}

/* ==========================================================================
   Event Cards
   ========================================================================== */

.event-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.event-card-content {
  padding: 1.5rem;
}

.event-header {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.event-category-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(3, 105, 161, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.event-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.event-title a {
  color: inherit;
  text-decoration: none;
}

.event-title a:hover {
  color: var(--primary);
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.event-meta svg {
  vertical-align: middle;
  margin-right: 0.25rem;
}

.event-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.event-past {
  opacity: 0.7;
}

/* ==========================================================================
   Event Sidebar
   ========================================================================== */

.event-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.event-cover {
  margin: 0 0 1.5rem 0;
}

.event-cover img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.event-cover figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
  text-align: center;
}

@media (min-width: 901px) {
  .event-content-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.event-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.event-details-card,
.registration-card,
.event-actions-card,
.manage2sail-card,
.calendar-card,
.gallery-link-card {
  padding: 1.5rem;
}

.event-details-card h3,
.registration-card h3,
.event-actions-card h3,
.manage2sail-card h3,
.calendar-card h3,
.gallery-link-card h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.detail-row {
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-light);
  font-weight: 500;
}

.detail-value {
  color: var(--text);
  font-weight: 600;
}

.capacity-display {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Registration Form
   ========================================================================== */

.registration-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.registration-info {
  background: var(--bg-alt);
  padding: 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

.registration-state {
  text-align: center;
  padding: 1rem 0;
}

.registration-state p {
  margin-bottom: 0.5rem;
}

.registration-confirmed {
  color: #166534;
}

.registration-confirmed strong {
  display: block;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.registration-closed {
  color: #991b1b;
}

.waitlist-notice {
  background: #fef3c7;
  color: #92400e;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

/* ==========================================================================
   Flash Messages
   ========================================================================== */

.flash-message {
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  animation: slideIn 0.3s ease;
  position: relative;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flash-success {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.flash-error {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.flash-info {
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #93c5fd;
}

.flash-warning {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
}

.flash-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.flash-close:hover {
  opacity: 1;
}

/* ==========================================================================
   Member Events Page
   ========================================================================== */

.member-events-page {
  padding-top: 2rem;
}

.events-section {
  margin-bottom: 3rem;
}

.events-section h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.collapsible-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.collapsible-section summary {
  padding: 1rem 1.5rem;
  cursor: pointer;
  background: var(--bg-alt);
  user-select: none;
}

.collapsible-section summary:hover {
  background: var(--bg-hover);
}

.collapsible-section summary h2 {
  display: inline;
  margin: 0;
  font-size: 1.25rem;
}

.collapsible-section > div {
  padding: 1.5rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-alt);
  border-radius: 8px;
}

.empty-icon {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.empty-state p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 640px) {
  .event-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .event-actions {
    flex-direction: column;
  }
  
  .event-actions .btn {
    width: 100%;
    text-align: center;
  }
  
  .flash-message {
    flex-direction: column;
    text-align: center;
  }
}
