/* ================================
   EVENTS PAGE STYLES 
================================ */

/* Hero Section */
.events-hero {
  text-align: center;
  background: var(--bg-primary);
}

/* ================================
   Event List Layout
================================ */
.events-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 70px 30px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 400px;
  isolation: isolate;
  align-items: start;
  grid-auto-rows: auto;
}

@media (max-width: 992px) {
  .events-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 70px 20px;
  }
}

@media (max-width: 600px) {
  .events-container {
    grid-template-columns: 1fr;
    gap: 40px 0;
  }
}

/* ================================
   Event Card
================================ */
.event-card {
  background: #ffffff;
  padding: 1.25rem 1.4rem;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border-left: 6px solid #3b82f6;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: visible;
  z-index: 1;
  margin-bottom: 0;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.event-card:focus,
.event-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  outline: none;
  border-color: var(--accent-color);
  z-index: 10;
}

.event-card.upcoming {
  border-left-color: #3b82f6;
}

.event-card.today {
  border-left-color: #22c55e;
}

.event-card.ended {
  border-left-color: #9ca3af;
  opacity: 0.85;
}

/* ================================
   Header
================================ */
.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.event-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
  margin: 0;
}

.event-card h2 {
  margin: 0 0 10px 0;
  color: var(--text-primary);
  font-size: 1.4rem;
}

.event-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
}

.event-status.upcoming {
  background: #e0edff;
  color: #1d4ed8;
}

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

.event-status.ended {
  background: #f3f4f6;
  color: #374151;
}

/* ================================
   Meta Info
================================ */
.event-meta {
  display: grid;
  gap: 0.45rem;
  margin: 0.5rem 0 0.75rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #4b5563;
}

.meta-item i {
  color: #6b7280;
  font-size: 0.9rem;
  width: 20px;
  text-align: center;
}

.event-date,
.event-location {
  color: var(--text-secondary);
  margin: 5px 0;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-date i,
.event-location i {
  color: var(--accent-color);
  width: 20px;
  text-align: center;
}

/* ================================
   Description
================================ */
.event-description {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #374151;
  margin: 0.75rem 0 1.2rem;
  flex-grow: 1;
  max-height: 100px;
  overflow-y: auto;
  padding-right: 10px;
  margin-right: -10px;
}

.event-description::-webkit-scrollbar {
  width: 6px;
}

.event-description::-webkit-scrollbar-thumb {
  background: rgba(100, 100, 100, 0.5);
  border-radius: 3px;
}

.event-description::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* ================================
   Event Footer (Register + Views)
================================ */
.event-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* ================================
   Register Section
================================ */
.event-register {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}

.event-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.btn-register {
  padding: 0.6rem 1.1rem;
  font-family: 'JetBrains Mono', monospace;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition:
    background 0.2s ease,
    transform 0.15s ease,
    opacity 0.2s ease;
  position: relative;
  z-index: 15;
}

.btn-open-register {
  background: linear-gradient(135deg, #86b0f3, #4373d9);
  color: #ffffff;
}

.btn-open-register:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px) scale(1.05);
}

.btn-register.disabled {
  background: #e5e7eb;
  color: #6b7280;
  cursor: not-allowed;
  opacity: 0.6;
  filter: grayscale(100%);
}

.btn-event {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s;
  position: relative;
  z-index: 15;
}

.btn-event:hover {
  background: var(--accent-color);
  color: white;
}

/* ================================
   View Counter
================================ */
.event-views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  color: #666;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  user-select: none;
}

.event-views:hover {
  transform: scale(1.05);
  color: #3b82f6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.view-icon {
  font-size: 1rem;
  line-height: 1;
}

.view-count {
  font-weight: 500;
  white-space: nowrap;
}

@keyframes viewPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.event-views.view-pulse {
  animation: viewPulse 0.5s ease;
}

@media (max-width: 768px) {
  .event-views {
    font-size: 0.75rem;
    padding: 3px 6px;
  }

  .view-icon {
    font-size: 0.875rem;
  }
}

/* ================================
   Empty / Error State
================================ */
.no-events {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  background: #f9fafb;
  border-radius: 14px;
  color: #374151;
}

.no-events h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.no-events.error {
  background: #fff1f2;
  color: #7f1d1d;
}

/* ================================
   PAGINATION CONTROLS
================================ */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 40px auto 40px auto;
  gap: 15px;
}

.pagination-btn {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
  font-weight: 600;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ================================
   COUNTDOWN SECTION
================================ */
#countdown-section.countdown-hidden {
  display: none !important;
}

#countdown-section {
  margin-top: 40px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  display: inline-block;
}

#countdown-section h3 {
  margin: 0 0 20px 0;
  color: var(--text-secondary);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#countdown-timer {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
}

.time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.time-unit span {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent-color);
  line-height: 1;
}

.time-unit label {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-top: 10px;
  font-weight: 600;
}

.time-unit:not(:last-child)::after {
  content: ':';
  position: absolute;
  right: -20px;
  top: 5px;
  font-size: 2rem;
  color: var(--text-secondary);
  opacity: 0.5;
}

.countdown-note {
  margin-top: 8px;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.85;
}

/* ================================
   ORGANIZE/HOST EVENT SECTION
================================ */
.organize-section {
  padding: 100px 20px;
  background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(59, 130, 246, 0.03) 100%);
  border-top: 1px solid var(--border-color);
  margin-top: 60px;
}

.organize-container {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: 24px;
  border: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.organize-container:hover {
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.12);
}

.organize-content {
  padding: 50px;
}

.form-header {
  margin-bottom: 35px;
}

.form-header h2 {
  margin: 0 0 12px 0;
  font-size: 2.2rem;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
}

.form-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

.organize-content h2 {
  margin-top: 0;
  font-size: 2rem;
  color: var(--text-primary);
}

.organize-content p {
  color: var(--text-secondary);
  margin-bottom: 25px;
}

/* ================================
   FORM STRUCTURE
================================ */
.form-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 30px 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.required-indicator {
  color: #ef4444;
  font-weight: 700;
  margin-left: 4px;
}

/* ================================
   FORM INPUTS
================================ */
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: rgba(59, 130, 246, 0.4);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: var(--card-bg);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 45px;
}

.form-group input[type='date'] {
  cursor: pointer;
  position: relative;
}

.form-group input[type='date']::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  filter: invert(1);
}

.form-group input[type='date']::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* ================================
   HELPER TEXT & VALIDATION
================================ */
.field-hint {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.char-counter {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.field-error {
  display: none;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #ef4444;
  font-weight: 500;
}

.form-group.error .field-error {
  display: block;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.form-group.error input:focus,
.form-group.error select:focus,
.form-group.error textarea:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-group.success input,
.form-group.success select,
.form-group.success textarea {
  border-color: #10b981;
}

/* ================================
   SUBMIT BUTTON
================================ */
.btn-organize {
  width: 100%;
  padding: 16px 28px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-organize::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-organize:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-organize:hover::before {
  left: 100%;
}

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

.btn-organize:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-icon {
  transition: transform 0.3s ease;
}

.btn-organize:hover .btn-icon {
  transform: translateX(4px);
}

/* ================================
   FEEDBACK MESSAGE
================================ */
.feedback-message {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  display: none;
}

.feedback-message.show {
  opacity: 1;
  transform: translateY(0);
  display: block;
}

.feedback-message.success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.feedback-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ================================
   VISUAL SECTION
================================ */
.organize-visual {
  position: relative;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.organize-image {
  background: linear-gradient(135deg, var(--accent-color), #0088cc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 8rem;
  opacity: 0.9;
}

.organize-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  filter: grayscale(20%);
}

.visual-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.9);
  font-size: 8rem;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-20px);
  }
}

/* ================================
   REGISTRATION MODAL - GUARANTEED DISPLAY
================================ */
#register-modal {
  display: none !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.85) !important;
  z-index: 999999 !important;
  align-items: center !important;
  justify-content: center !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto !important;
  padding: 20px;
  box-sizing: border-box;
}

#register-modal.show,
#register-modal[aria-hidden='false'] {
  display: flex !important;
}

.modal-dialog {
  position: relative;
  background: var(--card-bg, #1a1a2e);
  border-radius: 20px;
  padding: 45px 40px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-color, #333);
  animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: auto;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1000000;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-40px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 22px;
  right: 22px;
  background: rgba(239, 68, 68, 0.08);
  border: none;
  font-size: 1.6rem;
  color: var(--text-secondary, #999);
  cursor: pointer;
  transition: all 0.25s ease;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  line-height: 1;
  font-weight: 300;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  transform: rotate(90deg) scale(1.1);
}

.form-title {
  margin: 0 0 32px 0;
  font-size: 1.9rem;
  color: var(--text-primary, #fff);
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  padding-right: 30px;
}

#register-event-title {
  color: var(--accent-color, #3b82f6);
  display: block;
  margin-top: 10px;
  font-size: 1.7rem;
}

.register-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.input-group {
  position: relative;
  display: flex;
  flex-direction: column;
}

.input-group label {
  margin-bottom: 10px;
  color: var(--text-primary, #fff);
  font-weight: 600;
  font-size: 0.95rem;
}

.input-group label.required::after {
  content: ' *';
  color: #ef4444;
  font-weight: 700;
}

.input-group input {
  width: 100%;
  padding: 14px 18px;
  padding-right: 45px;
  border: 2px solid var(--border-color, #333);
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--text-primary, #fff);
  background: var(--bg-primary, #0f0f23);
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-color, #3b82f6);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  background: var(--card-bg, #1a1a2e);
}

.input-group input:hover {
  border-color: rgba(59, 130, 246, 0.5);
}

.input-group.valid input {
  border-color: #10b981;
}

.input-group.invalid input {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.validation-icon {
  position: absolute;
  right: 16px;
  top: 42px;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.input-group.valid .valid-icon {
  opacity: 1;
  color: #10b981;
}

.input-group.invalid .error-icon {
  opacity: 1;
  color: #ef4444;
}

.error-message {
  display: none;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #ef4444;
  font-weight: 500;
}

.input-group.invalid .error-message {
  display: block;
}

.button-group {
  display: flex;
  gap: 14px;
  margin-top: 14px;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 14px 26px;
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

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

.btn-secondary {
  background: transparent;
  color: var(--text-primary, #fff);
  border: 2px solid var(--border-color, #333);
}

.btn-secondary:hover {
  background: var(--bg-primary, #0f0f23);
  border-color: var(--accent-color, #3b82f6);
  color: var(--accent-color, #3b82f6);
}

.modal-cancel {
  background: transparent;
  border: 2px solid var(--border-color, #333);
  color: var(--text-primary, #fff);
}

.modal-cancel:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: #ef4444;
  color: #ef4444;
}

/* ================================
   TOAST NOTIFICATION
================================ */
#toast-notification {
  position: fixed;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  min-width: 300px;
  max-width: 500px;
  padding: 16px 32px;
  border-radius: 50px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: all 0.45s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  z-index: 100000;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: center;
}

#toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#toast-notification.toast.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#toast-notification.toast.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#toast-notification.toast.info {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ================================
   BUTTON LOADING STATE
================================ */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rotate 0.8s infinite linear;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ================================
   DARK MODE - Event Cards
================================ */
body.dark-mode #events-container {
  background: transparent;
}

body.dark-mode .event-card {
  background: #0f172a;
  color: #e5e7eb;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-color);
}

body.dark-mode .event-card:hover,
body.dark-mode .event-card:focus {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
}

body.dark-mode .event-title {
  color: #f9fafb;
}

body.dark-mode .event-status.upcoming {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

body.dark-mode .event-status.today {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

body.dark-mode .event-status.ended {
  background: rgba(156, 163, 175, 0.15);
  color: #d1d5db;
}

body.dark-mode .event-meta {
  color: #cbd5f5;
}

body.dark-mode .meta-item {
  color: #cbd5f5;
}

body.dark-mode .meta-item i {
  color: #94a3b8;
}

body.dark-mode .event-description {
  color: #d1d5db;
}

body.dark-mode .btn-open-register {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #ffffff;
}

body.dark-mode .btn-open-register:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
}

body.dark-mode .btn-register.disabled {
  background: #1f2933;
  color: #9ca3af;
}

body.dark-mode .event-card.ended {
  opacity: 0.75;
}

body.dark-mode .no-events {
  background: #020617;
  color: #e5e7eb;
}

body.dark-mode .no-events.error {
  background: rgba(127, 29, 29, 0.25);
  color: #fecaca;
}

/* ================================
   DARK MODE - Organize Section & Modal
================================ */
body.dark-mode .organize-section {
  background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(59, 130, 246, 0.05) 100%);
}

body.dark-mode .form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23cbd5e1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

body.dark-mode .form-group input[type='date']::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

body.dark-mode .event-views {
  background: rgba(15, 23, 42, 0.9);
  color: #cbd5e1;
}

body.dark-mode .event-views:hover {
  color: #3b82f6;
}

body.dark-mode #register-modal {
  background: rgba(0, 0, 0, 0.92) !important;
}

body.dark-mode .modal-dialog {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
}

body.dark-mode .modal-close {
  background: rgba(239, 68, 68, 0.1);
}

body.dark-mode .modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ================================
   RESPONSIVE DESIGN
================================ */
@media (max-width: 992px) {
  .organize-container {
    grid-template-columns: 1fr;
  }

  .organize-visual {
    min-height: 250px;
    order: -1;
  }

  .organize-content {
    padding: 40px 35px;
  }
}

@media (max-width: 768px) {
  .organize-image {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  #countdown-timer {
    gap: 15px;
  }

  .time-unit span {
    font-size: 2rem;
  }

  .time-unit:not(:last-child)::after {
    right: -10px;
    font-size: 1.5rem;
  }

  .modal-dialog {
    padding: 35px 28px;
    margin: 15px;
    max-width: 100%;
  }

  .form-title {
    font-size: 1.6rem;
    padding-right: 35px;
  }

  #register-event-title {
    font-size: 1.4rem;
  }

  .button-group {
    flex-direction: column;
    gap: 10px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  #toast-notification {
    min-width: 250px;
    padding: 14px 24px;
    font-size: 0.875rem;
  }
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .organize-content {
    padding: 30px 25px;
  }

  .form-header h2 {
    font-size: 1.8rem;
  }

  .organize-section {
    padding: 60px 20px;
  }

  #register-modal {
    padding: 10px !important;
  }

  .modal-dialog {
    padding: 30px 22px;
  }

  .form-title {
    font-size: 1.4rem;
  }
}



/* Ensure the containers don't touch edges on mobile */
.events-container {
  width: 100%;
  display: grid;
  /* 2 columns on desktop, 1 on mobile */
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

@media (max-width: 768px) {
  /* Stack Event Cards */
  .events-container {
    grid-template-columns: 1fr;
  }

  /* Adjust Section Headers */
  .section-header-terminal h2 {
    font-size: 1.5rem; /* Smaller font for mobile */
  }
  
  /* Add spacing between Upcoming and Archive sections */
  .container[style*="margin-top"] {
    margin-top: 3rem !important; /* Reduce gap slightly on mobile */
  }
}
