/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   🎨 POPUP CARDS - MAIN PAGE THEME LIGHT MODE
   Clean, readable design optimized for mobile
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   📱 MODAL BACKDROP & CONTAINER
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.popup-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.popup-modal.show {
  opacity: 1;
}

.popup-modal .modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: pointer;
}

.popup-modal .modal-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  margin: 0 auto;
  pointer-events: none;
}

.popup-modal .modal-content {
  background: linear-gradient(180deg, transparent 0%, #f8fafc 40%, #ffffff 100%);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
  border: none;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
  pointer-events: auto;
  position: relative;
  z-index: 10001;
}

.popup-modal.show .modal-content {
  transform: translateY(0) scale(1);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   🎯 HEADER SECTION (Main Page Style)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.popup-modal .modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px 28px 20px;
  position: relative;
  border-bottom: none;
}

/* Category Badge */
.popup-modal .modal-header .category-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.popup-modal .modal-header .category-badge .badge-icon {
  font-size: 14px;
}

.popup-modal .modal-header .likes-count {
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Title */
.popup-modal .modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: white;
}

/* Author & Location */
.popup-modal .modal-header .author-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.popup-modal .modal-header .author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
}

.popup-modal .modal-header .author-details {
  flex: 1;
}

.popup-modal .modal-header .author-name {
  font-weight: 600;
  margin-bottom: 2px;
  color: white;
}

.popup-modal .modal-header .location-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.popup-modal .modal-header .location-date .location-icon {
  font-size: 10px;
}

/* Close Button */
.popup-modal .modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  min-width: 44px;
  min-height: 44px;
  font-size: 18px;
  top: 20px;
  right: 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-modal .modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  transform: scale(1.05);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   📝 BODY SECTION (Clean Light Content)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.popup-modal .modal-body {
  padding: 28px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 50%);
  color: var(--fg, #111827);
  line-height: 1.7;
  font-size: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

.popup-modal .modal-body h3 {
  color: var(--fg, #111827);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.popup-modal .modal-body p {
  margin: 0 0 16px 0;
  color: var(--fg, #111827);
  line-height: 1.7;
}

.popup-modal .modal-body ul {
  margin: 0 0 16px 0;
  padding-left: 20px;
}

.popup-modal .modal-body li {
  margin-bottom: 8px;
  color: var(--fg, #111827);
  line-height: 1.6;
}

/* Remove duplicate li styles and continue with other sections */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   🏷️ TAGS SECTION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.popup-modal .modal-tags {
  padding: 20px 28px;
  background: var(--bg, #ffffff);
  border-top: 1px solid var(--line, #e5e7eb);
}

.popup-modal .modal-tags .tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.popup-modal .modal-tags .tag {
  background: var(--line, #e5e7eb);
  color: var(--muted, #6b7280);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line, #e5e7eb);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   📱 MOBILE RESPONSIVE DESIGN
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

@media (max-width: 768px) {
  .popup-modal {
    padding: 10px;
    align-items: flex-start;
    padding-top: 5vh;
  }

  .popup-modal .modal-container {
    max-width: 100%;
    max-height: 90vh;
  }

  .popup-modal .modal-content {
    border-radius: 8px;
    margin: 0;
  }

  .popup-modal .modal-header {
    padding: 20px 20px 16px;
  }

  .popup-modal .modal-header h2 {
    font-size: 18px;
    line-height: 1.4;
  }

  .popup-modal .modal-header .category-badge {
    font-size: 11px;
    padding: 4px 10px;
    margin-bottom: 10px;
  }

  .popup-modal .modal-header .author-info {
    margin-top: 12px;
    font-size: 13px;
  }

  .popup-modal .modal-header .author-avatar {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .popup-modal .modal-close {
    top: 15px;
    right: 15px;
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
  }

  .popup-modal .modal-body {
    padding: 20px;
    font-size: 15px;
    max-height: 50vh;
  }

  .popup-modal .modal-body h3 {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .popup-modal .modal-tags {
    padding: 16px 20px;
  }

  .popup-modal .modal-tags .tag {
    font-size: 11px;
    padding: 4px 10px;
  }
}

@media (max-width: 480px) {
  .popup-modal {
    padding: 5px;
    padding-top: 2vh;
  }

  .popup-modal .modal-header {
    padding: 16px 16px 12px;
  }

  .popup-modal .modal-header h2 {
    font-size: 16px;
  }

  .popup-modal .modal-body {
    padding: 16px;
    font-size: 14px;
    max-height: 45vh;
  }

  .popup-modal .modal-tags {
    padding: 12px 16px;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   🎯 IMPROVED ACCESSIBILITY
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.popup-modal {
  outline: none;
}

.popup-modal .modal-content {
  outline: none;
}

.popup-modal .modal-close:focus {
  outline: 2px solid var(--primary, #111827);
  outline-offset: 2px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ✨ SMOOTH SCROLLING
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.popup-modal .modal-body {
  scrollbar-width: thin;
  scrollbar-color: var(--line, #e5e7eb) transparent;
}

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

.popup-modal .modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.popup-modal .modal-body::-webkit-scrollbar-thumb {
  background: var(--line, #e5e7eb);
  border-radius: 3px;
}

.popup-modal .modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--muted, #6b7280);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   📊 STORY METADATA SECTION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.popup-modal .story-metadata {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(248, 250, 252, 0.8));
  border-radius: 12px;
  margin-top: 24px;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.popup-modal .metadata-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.popup-modal .metadata-icon {
  font-size: 16px;
}

.popup-modal .metadata-label {
  font-weight: 500;
  color: var(--muted, #6b7280);
}

.popup-modal .metadata-value {
  font-weight: 600;
  color: var(--fg, #111827);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   💡 OUTCOME SECTION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.popup-modal .outcome-section {
  margin: 24px 0;
  padding: 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.05));
  border-radius: 12px;
  border-left: 4px solid #667eea;
}

.popup-modal .outcome-section h4 {
  color: var(--fg, #111827);
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.popup-modal .outcome-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg, #111827);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   🦶 MODAL FOOTER
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.popup-modal .modal-footer {
  padding: 20px 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.popup-modal .footer-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.popup-modal .action-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line, #e5e7eb);
  background: var(--bg, #ffffff);
  color: var(--fg, #111827);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.popup-modal .action-button:hover {
  background: var(--line, #e5e7eb);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.popup-modal .action-button.primary {
  background: var(--primary, #111827);
  color: white;
  border-color: var(--primary, #111827);
}

.popup-modal .action-button.primary:hover {
  background: #374151;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.popup-modal .footer-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted, #6b7280);
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 768px) {
  .popup-modal .modal-footer {
    padding: 16px 20px;
  }

  .popup-modal .footer-actions {
    flex-direction: column;
  }

  .popup-modal .action-button {
    justify-content: center;
  }

  .popup-modal .footer-meta {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   🔗 FOOTER SECTION (Light Theme Action Buttons)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Footer styling is already defined above and uses CSS variables */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   📱 RESPONSIVE DESIGN
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

@media (max-width: 640px) {
  .popup-modal .modal-container {
    width: 98%;
    max-width: none;
  }

  .popup-modal .modal-header {
    padding: 20px 24px;
  }

  .popup-modal .modal-header h2 {
    font-size: 18px;
  }

  .popup-modal .modal-body {
    padding: 24px;
    font-size: 14px;
  }

  .popup-modal .modal-footer {
    padding: 16px 24px 24px 24px;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .popup-modal .modal-footer .action-buttons {
    justify-content: center;
  }

  .popup-modal .modal-footer .metadata {
    text-align: center;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ✨ ANIMATIONS & TRANSITIONS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Show state for modal */
.popup-modal.show {
  opacity: 1;
}

.popup-modal.show .modal-content {
  transform: translateY(0) scale(1);
}

/* Legacy modal content animation */
.popup-modal .modal-content {
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   🎨 LIGHT THEME CATEGORY COLORS (Removed Dark Gradients)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* All categories use light theme now */
.popup-modal .modal-content[data-category] .modal-header {
  background: var(--bg, #ffffff);
  color: var(--fg, #111827);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   💡 LIGHT MODE ONLY (Dark mode support removed)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Force light theme for all modals */
.popup-modal .modal-content,
.popup-modal .modal-header,
.popup-modal .modal-body,
.popup-modal .modal-footer {
  background: var(--bg, #ffffff);
  color: var(--fg, #111827);
}

/* Allow gradient headers now - matching main page style */
.popup-modal .modal-header,
.popup-modal .modal-content .modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Override category-specific colors to use main page gradient */
.popup-modal .modal-content[data-category] .modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Allow gradient backgrounds for modern look */
.popup-modal .modal-body {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 50%);
  color: #111827;
}

.popup-modal .modal-content {
  background: linear-gradient(180deg, transparent 0%, #f8fafc 40%, #ffffff 100%);
  color: #111827;
}
