/**
 * events-enhanced.css - Glass morphism styles for Events page
 * Submit Event form and enhanced UI components
 */

/* ===== SUBMIT EVENT SECTION GLASS MORPHISM ===== */
#addEventSection {
  position: relative;
  background: linear-gradient(135deg, rgba(var(--teal-rgb), 0.05) 0%, rgba(6, 8, 12, 0.95) 100%);
  border: 1px solid rgba(var(--teal-rgb), 0.2);
  border-radius: 1.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(var(--teal-rgb), 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#addEventSection::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent,
    rgba(var(--teal-rgb), 0.9),
    rgba(var(--teal-2-rgb), 0.85),
    rgba(var(--accent-rgb), 0.65),
    transparent
  );
}

#addEventSection .form-panel-header {
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

#addEventSection .form-panel-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#addEventSection .form-panel-header h2 svg {
  filter: drop-shadow(0 0 8px rgba(var(--teal-rgb), 0.5));
}

#addEventSection .form-panel-header p {
  color: #a1a1aa;
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

/* Close button */
#addEventSection #hideAddEvent {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

#addEventSection #hideAddEvent:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  transform: rotate(90deg);
}

#addEventSection #hideAddEvent svg {
  color: #a1a1aa;
  transition: color 0.2s ease;
}

#addEventSection #hideAddEvent:hover svg {
  color: #ef4444;
}

/* Form styling */
#addEventForm {
  padding: 1.5rem 2rem 2rem;
}

/* Section headers */
#addEventForm .form-section {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--teal, #18e1ff);
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(var(--teal-rgb), 0.15);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#addEventForm .form-section::before {
  content: '';
  width: 4px;
  height: 1rem;
  background: linear-gradient(180deg, var(--teal), transparent);
  border-radius: 999px;
}

#addEventForm .form-section:first-of-type {
  margin-top: 0;
}

/* Glass input fields */
#addEventForm .field {
  position: relative;
  margin-bottom: 1rem;
}

#addEventForm input:not([type="checkbox"]),
#addEventForm textarea,
#addEventForm select {
  width: 100%;
  padding: 1rem 1rem 1rem 2.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  outline: none;
}

#addEventForm input:not([type="checkbox"]):focus,
#addEventForm textarea:focus,
#addEventForm select:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(var(--teal-rgb), 0.5);
  box-shadow:
    0 0 0 3px rgba(var(--teal-rgb), 0.1),
    0 4px 20px rgba(var(--teal-rgb), 0.15);
}

#addEventForm input:not([type="checkbox"]):hover:not(:focus),
#addEventForm textarea:hover:not(:focus),
#addEventForm select:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

/* Float labels */
#addEventForm .field.float label {
  position: absolute;
  left: 2.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #71717a;
  font-size: 0.95rem;
  pointer-events: none;
  transition: all 0.2s ease;
  background: transparent;
  padding: 0 0.25rem;
}

#addEventForm .field.float textarea ~ label {
  top: 1rem;
  transform: none;
}

#addEventForm .field.float input:focus ~ label,
#addEventForm .field.float input:not(:placeholder-shown) ~ label,
#addEventForm .field.float textarea:focus ~ label,
#addEventForm .field.float textarea:not(:placeholder-shown) ~ label {
  top: 0;
  left: 0.75rem;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal, #18e1ff);
  background: linear-gradient(180deg, transparent 50%, rgba(6, 8, 12, 0.9) 50%);
  padding: 0 0.5rem;
}

/* Icons for inputs */
#addEventForm .with-icon.ico-title { padding-left: 2.75rem; }
#addEventForm .with-icon.ico-location { padding-left: 2.75rem; }
#addEventForm .with-icon.ico-tag { padding-left: 2.75rem; }
#addEventForm .with-icon.ico-desc { padding-left: 2.75rem; padding-top: 1rem; }

#addEventForm .field.float::before {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #52525b;
  font-size: 0.9rem;
  z-index: 1;
  pointer-events: none;
}

/* Grid for 2 column layouts */
#addEventForm .grid.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  #addEventForm .grid.cols-2 {
    grid-template-columns: 1fr;
  }
}

/* Datetime inputs */
#addEventForm input[type="datetime-local"] {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  color-scheme: dark;
}

#addEventForm .field label:not(.chip-toggle) {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #a1a1aa;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Featured checkbox toggle */
#addEventForm .chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  color: #a1a1aa;
}

#addEventForm .chip-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

#addEventForm .chip-toggle:has(input:checked) {
  background: rgba(var(--teal-rgb), 0.15);
  border-color: rgba(var(--teal-rgb), 0.4);
  color: var(--teal, #18e1ff);
}

#addEventForm .chip-toggle input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--teal, #18e1ff);
}

/* Textarea */
#addEventForm textarea {
  min-height: 100px;
  resize: vertical;
  padding-top: 1rem;
}

/* Action buttons */
#addEventForm .flex-end {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#addEventForm button[type="submit"] {
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, var(--teal, #18e1ff), var(--teal-2, #00c8e6));
  color: #000;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(var(--teal-rgb), 0.3);
}

#addEventForm button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(var(--teal-rgb), 0.4);
}

#addEventForm button[type="submit"]:active {
  transform: translateY(0);
}

/* Secondary buttons */
#addEventForm .btn.btn-sm,
#addEventForm #fillCoordsBtn {
  padding: 0.625rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#addEventForm .btn.btn-sm:hover,
#addEventForm #fillCoordsBtn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(var(--teal-rgb), 0.4);
  color: var(--teal, #18e1ff);
}

/* Message area */
#addEventForm #evMsg {
  text-align: center;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

#addEventForm #evMsg:not(:empty) {
  background: rgba(var(--teal-rgb), 0.1);
  border: 1px solid rgba(var(--teal-rgb), 0.2);
  color: var(--teal, #18e1ff);
}

/* Animation for panel showing */
#addEventSection.is-hidden {
  display: none;
}

#addEventSection:not(.is-hidden) {
  animation: slideDownFade 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===== LIGHT MODE ===== */
body.light-mode #addEventSection {
  background: linear-gradient(135deg, rgba(var(--teal-rgb), 0.08) 0%, rgba(255, 255, 255, 0.95) 100%);
  border-color: rgba(var(--teal-rgb), 0.2);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.1),
    0 0 40px rgba(var(--teal-rgb), 0.05);
}

body.light-mode #addEventSection .form-panel-header h2 {
  color: #1a1a2e;
}

body.light-mode #addEventSection .form-panel-header p {
  color: #64748b;
}

body.light-mode #addEventForm input:not([type="checkbox"]),
body.light-mode #addEventForm textarea,
body.light-mode #addEventForm select {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a2e;
}

body.light-mode #addEventForm input:not([type="checkbox"]):focus,
body.light-mode #addEventForm textarea:focus,
body.light-mode #addEventForm select:focus {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(var(--teal-rgb), 0.5);
}

body.light-mode #addEventForm .field.float label {
  color: #64748b;
}

body.light-mode #addEventForm .field.float input:focus ~ label,
body.light-mode #addEventForm .field.float input:not(:placeholder-shown) ~ label {
  background: linear-gradient(180deg, transparent 50%, #fff 50%);
}

body.light-mode #addEventForm .chip-toggle {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.1);
  color: #64748b;
}

body.light-mode #addEventForm .chip-toggle:has(input:checked) {
  background: rgba(var(--teal-rgb), 0.1);
  border-color: rgba(var(--teal-rgb), 0.3);
  color: var(--teal-2, #00c8e6);
}
