/**
 * PatriotCompass Admin Console - Historical Events Styles
 * 
 * Styles specific to the Historical Events section
 */

/* ============================================
   EVENTS CONTAINER
   ============================================ */

.events-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.loading {
  text-align: center;
  padding: var(--space-12);
  color: var(--slate-500);
  font-size: var(--text-lg);
}

.no-events {
  text-align: center;
  padding: 40px 20px;
  color: var(--slate-500);
  font-size: 15px;
  background: #f8fafc;
  border-radius: 8px;
  border: 2px dashed var(--slate-300);
}

/* Relevance Sections */
.relevance-section {
  background: #ffffff;
  border-radius: 10px;
  padding: 16px;
  border: 2px solid var(--slate-200);
}

.relevance-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-900);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.relevance-section h3 .btn {
  font-size: 11px;
  padding: 4px 10px;
}

.relevance-section.high-relevance {
  border-color: #10b981;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.relevance-section.high-relevance h3 {
  color: #065f46;
}

.relevance-section.medium-relevance {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.relevance-section.medium-relevance h3 {
  color: #92400e;
}

.relevance-section.low-relevance {
  border-color: #ef4444;
  background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.relevance-section.low-relevance h3 {
  color: #991b1b;
}

.relevance-section.saved-events {
  border-color: var(--patriot-blue);
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
}

.relevance-section.saved-events h3 {
  color: var(--patriot-blue);
}

.events-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ============================================
   EVENT CARDS
   ============================================ */

.event-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-left: 4px solid var(--patriot-blue);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: grab;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.event-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-color: var(--patriot-blue);
  border-left-width: 6px;
}

.event-card:active {
  cursor: grabbing;
  transform: translateY(0);
}

/* Drag Handle */
.drag-handle {
  font-size: 16px;
  color: var(--slate-400);
  cursor: grab;
  padding: 4px;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
  margin-top: 2px;
}

.drag-handle:hover {
  color: var(--patriot-blue);
}

.event-card:active .drag-handle {
  cursor: grabbing;
}

/* Event Content */
.event-content {
  flex: 1;
  min-width: 0;
}

.event-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 12px;
}

.event-year {
  font-size: 10px;
  font-weight: 700;
  color: var(--patriot-blue);
  background: #dbeafe;
  padding: 3px 8px;
  border-radius: 10px;
  display: inline-block;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  line-height: 1.4;
}

/* Event Meta (tier, category, status badges) */
.event-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

/* Tier Badge */
.event-tier {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.4;
  white-space: nowrap;
}

.event-tier.premium {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
}

.event-tier.free {
  background: #dbeafe;
  color: #1e40af;
}

.event-tier.pending {
  background: #fef3c7;
  color: #92400e;
}

/* Category Badge */
.event-category {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--slate-700);
  text-transform: capitalize;
  line-height: 1.4;
  white-space: nowrap;
}

/* Status Badge */
.event-status {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: capitalize;
  line-height: 1.4;
  white-space: nowrap;
}

.event-status.approved {
  background: #d1fae5;
  color: #065f46;
}

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

.event-status.rejected {
  background: #fee2e2;
  color: #991b1b;
}

/* AI Enhanced Badge */
.ai-enhanced {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  cursor: help;
}

.event-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 6px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.event-description {
  font-size: 13px;
  color: var(--slate-700);
  line-height: 1.5;
  margin-bottom: 6px;
}

.event-details {
  font-size: 12px;
  color: var(--slate-600);
  line-height: 1.5;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  margin-bottom: 6px;
  border-left: 3px solid var(--patriot-blue);
}

.event-hook {
  font-size: 11px;
  color: var(--slate-500);
  font-style: italic;
  margin-bottom: 6px;
  padding-left: 10px;
  border-left: 2px solid var(--slate-300);
}

.event-image {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin-top: 8px;
  border: 1px solid var(--slate-200);
}

.event-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--slate-200);
}

.event-actions .btn {
  font-size: 12px;
  padding: 5px 12px;
  height: auto;
}

.event-actions .btn-small {
  font-size: 11px;
  padding: 4px 10px;
}

/* ============================================
   ACTION BAR
   ============================================ */

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 2px solid var(--slate-100);
}

.date-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.date-nav input[type="date"] {
  padding: 10px 16px;
  border: 2px solid var(--slate-200);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--slate-700);
  background: var(--patriot-white);
  transition: all 0.2s ease;
  min-width: 160px;
}

.date-nav input[type="date"]:hover {
  border-color: var(--patriot-blue);
}

.date-nav input[type="date"]:focus {
  outline: none;
  border-color: var(--patriot-blue);
  box-shadow: 0 0 0 4px rgba(26, 58, 95, 0.1);
}

/* ============================================
   BATCH MODE
   ============================================ */

.batch-mode-toggle {
  position: relative;
}

.batch-mode-toggle.active {
  background: var(--patriot-red);
  border-color: var(--patriot-red);
}

.batch-enhance-bar {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  background: var(--patriot-blue);
  color: var(--patriot-white);
  padding: var(--space-4) var(--space-6);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-sticky);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.batch-info {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.batch-count {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
}

.batch-cost {
  font-size: var(--text-base);
}

.batch-actions {
  display: flex;
  gap: var(--space-3);
}

/* ============================================
   MODALS
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: var(--patriot-white);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  z-index: 1;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  background: linear-gradient(135deg, var(--patriot-blue) 0%, #2d5a8c 100%);
  color: white;
}

.modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin: 0;
  letter-spacing: -0.02em;
}

.modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 24px;
  color: white;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 300;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.modal-body {
  padding: 32px;
  max-height: calc(90vh - 180px);
  overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: var(--slate-100);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--slate-400);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px 32px;
  background: var(--slate-50);
  border-top: 2px solid var(--slate-100);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .date-nav {
    flex-direction: column;
    width: 100%;
  }

  .date-nav input[type="date"],
  .date-nav button {
    width: 100%;
  }

  .batch-enhance-bar {
    left: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .batch-info {
    flex-direction: column;
    gap: var(--space-2);
  }

  .batch-actions {
    width: 100%;
  }

  .batch-actions button {
    flex: 1;
  }
}


/* ============================================
   SECTION ENHANCEMENTS
   ============================================ */

.events-section h2,
.events-section h3 {
  font-weight: 700;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}

.events-section h2 {
  font-size: 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.events-section h2::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--patriot-blue) 0%, var(--patriot-red) 100%);
  border-radius: 2px;
}

/* API Counter Styling */
#apiCounter {
  font-size: 14px;
  color: var(--slate-600);
  font-weight: 500;
}

#apiCount {
  font-weight: 700;
  color: var(--patriot-blue);
}

/* Form Improvements for Modal */
.modal-body .form-group {
  margin-bottom: 24px;
}

.modal-body .form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 8px;
}

.modal-body .form-control,
.modal-body input[type="text"],
.modal-body input[type="number"],
.modal-body textarea,
.modal-body select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--slate-200);
  border-radius: 8px;
  font-size: 15px;
  color: var(--slate-700);
  background: var(--patriot-white);
  transition: all 0.2s ease;
  font-family: inherit;
}

.modal-body .form-control:hover,
.modal-body input[type="text"]:hover,
.modal-body input[type="number"]:hover,
.modal-body textarea:hover,
.modal-body select:hover {
  border-color: var(--slate-300);
}

.modal-body .form-control:focus,
.modal-body input[type="text"]:focus,
.modal-body input[type="number"]:focus,
.modal-body textarea:focus,
.modal-body select:focus {
  outline: none;
  border-color: var(--patriot-blue);
  box-shadow: 0 0 0 4px rgba(26, 58, 95, 0.1);
}

.modal-body textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.modal-body small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--slate-500);
}

/* Details/Summary Styling */
.modal-body details {
  margin-top: 20px;
  border: 2px solid var(--slate-200);
  border-radius: 8px;
  overflow: hidden;
}

.modal-body summary {
  cursor: pointer;
  padding: 16px;
  background: var(--slate-50);
  font-weight: 600;
  color: var(--slate-700);
  user-select: none;
  transition: background 0.2s ease;
}

.modal-body summary:hover {
  background: var(--slate-100);
}

.modal-body details[open] summary {
  background: var(--patriot-blue);
  color: white;
}

.modal-body details > div {
  padding: 20px;
}

/* Character Counter */
.modal-body .char-counter {
  font-size: 12px;
  color: var(--slate-500);
  text-align: right;
  margin-top: 4px;
}

.modal-body .char-counter.warning {
  color: var(--patriot-red);
  font-weight: 600;
}
