/* Theories Page Specific Styles */

/* Theory Categories */
.theory-categories {
  padding: 2rem 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
}

.theory-filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.filter-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-primary);
  background: var(--bg-primary);
  color: var(--text-secondary);
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-secondary);
}

.filter-btn.active {
  background: var(--primary-600);
  color: white;
  border-color: var(--primary-600);
}

/* Theory Status Colors */
.status-proven {
  background: #10b981;
  color: white;
}

.status-debunked {
  background: #ef4444;
  color: white;
}

.status-speculative {
  background: #f59e0b;
  color: white;
}

.status-investigating {
  background: #3b82f6;
  color: white;
}

/* Featured Theory */
.featured-theory {
  padding: 3rem 0;
}

.theory-card.featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.theory-card.featured::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-600), var(--accent-color));
}

.theory-card.featured .theory-image {
  height: 300px;
}

.theory-card.featured .theory-content {
  padding: 2rem;
}

.theory-card.featured .theory-title {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.theory-card.featured .theory-description {
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Theory Grid */
.theories-section {
  padding: 3rem 0;
}

.theories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2rem;
}

.theory-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.theory-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.theory-image {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-600), var(--accent-color));
}

.theory-badges {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

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

.badge-featured {
  background: var(--primary-600);
  color: white;
}

.badge-hot {
  background: #ef4444;
  color: white;
  animation: pulse 2s infinite;
}

.badge-new {
  background: #10b981;
  color: white;
}

.badge-updated {
  background: #3b82f6;
  color: white;
}

/* Credibility Meter */
.credibility-meter {
  position: absolute;
  top: 1rem;
  right: 1rem;
  text-align: center;
}

.credibility-circle {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: conic-gradient(var(--primary-600) calc(var(--credibility) * 1%), rgba(255, 255, 255, 0.2) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.credibility-circle::before {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--bg-primary);
  border-radius: 50%;
}

.credibility-score {
  position: relative;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
}

.credibility-label {
  font-size: 0.625rem;
  color: white;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  margin-top: 0.25rem;
}

.theory-content {
  padding: 1.5rem;
}

.theory-header {
  margin-bottom: 1rem;
}

.theory-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.theory-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  flex-wrap: wrap;
  align-items: center;
}

.theory-status {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.theory-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.theory-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.25rem 0.5rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tag:hover {
  background: var(--primary-600);
  color: white;
}

/* Evidence Section */
.evidence-section {
  margin-bottom: 1rem;
}

.evidence-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.evidence-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  border-left: 3px solid transparent;
}

.evidence-item.supporting {
  border-left-color: #10b981;
}

.evidence-item.contradicting {
  border-left-color: #ef4444;
}

.evidence-item.neutral {
  border-left-color: #6b7280;
}

.evidence-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.evidence-icon.supporting {
  color: #10b981;
}

.evidence-icon.contradicting {
  color: #ef4444;
}

.evidence-icon.neutral {
  color: #6b7280;
}

/* Theory Stats */
.theory-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-icon {
  width: 0.875rem;
  height: 0.875rem;
}

/* Theory Actions */
.theory-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-600);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-secondary);
}

.btn-icon {
  width: 1rem;
  height: 1rem;
}

/* Theory Modal */
.theory-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.theory-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.theory-modal {
  background: var(--bg-primary);
  border-radius: 1rem;
  box-shadow: var(--shadow-xl);
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.theory-modal-overlay.active .theory-modal {
  transform: scale(1);
}

.theory-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-primary);
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 10;
}

.modal-close-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: var(--bg-quaternary);
  color: var(--text-primary);
}

.theory-modal-content {
  padding: 2rem;
}

.theory-full-header {
  margin-bottom: 2rem;
}

.theory-full-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.theory-full-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.meta-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.theory-full-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
}

.theory-full-content {
  line-height: 1.8;
  color: var(--text-primary);
}

.theory-summary {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 0.75rem;
  border-left: 4px solid var(--primary-600);
}

.theory-body h3 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2rem 0 1rem 0;
}

.theory-body h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.75rem 0;
}

.theory-body p {
  margin-bottom: 1rem;
}

.theory-body ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.theory-body li {
  margin-bottom: 0.5rem;
}

/* Evidence Analysis */
.evidence-analysis {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 0.75rem;
}

.evidence-analysis h4 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.evidence-category {
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 0.5rem;
  border: 1px solid var(--border-primary);
}

.evidence-category h5 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.evidence-category.supporting h5 {
  color: #10b981;
}

.evidence-category.contradicting h5 {
  color: #ef4444;
}

.evidence-category.neutral h5 {
  color: #6b7280;
}

.evidence-points {
  list-style: none;
  padding: 0;
}

.evidence-points li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  padding-left: 1rem;
  position: relative;
}

.evidence-points li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text-tertiary);
}

/* Community Discussion */
.community-discussion {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 0.75rem;
}

.discussion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.discussion-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.discussion-preview {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-preview {
  padding: 0.75rem;
  background: var(--bg-primary);
  border-radius: 0.5rem;
  border-left: 3px solid var(--primary-600);
}

.comment-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.comment-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Related Theories */
.related-theories {
  margin: 2rem 0;
}

.related-theories h4 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.related-theory {
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  border: 1px solid var(--border-primary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.related-theory:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-secondary);
}

.related-theory h5 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.related-theory p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary-600);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background: #10b981;
}

.toast.error {
  background: #ef4444;
}

.toast.warning {
  background: #f59e0b;
}

/* Load More Button */
.load-more-container {
  text-align: center;
  margin: 3rem 0;
}

.load-more-btn {
  padding: 0.75rem 2rem;
  background: var(--primary-600);
  color: white;
  border: none;
  border-radius: 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.load-more-btn:hover {
  background: var(--primary-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  opacity: 0.5;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .theory-card.featured {
    grid-template-columns: 1fr;
  }

  .theory-card.featured .theory-image {
    height: 250px;
  }

  .theories-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .filter-buttons {
    justify-content: center;
  }

  .theory-full-title {
    font-size: 1.5rem;
  }

  .meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .toast {
    right: 1rem;
    left: 1rem;
    bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .theory-content {
    padding: 1rem;
  }

  .theory-modal-content {
    padding: 1rem;
  }

  .theory-filters {
    margin: 0 -1rem 2rem -1rem;
    border-radius: 0;
  }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
  .credibility-circle::before {
    background: var(--bg-primary);
  }

  .theory-modal {
    background: var(--bg-primary);
    border-color: var(--border-primary);
  }
}

/* Print Styles */
@media print {
  .theory-filters,
  .theory-actions,
  .load-more-container {
    display: none;
  }

  .theory-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .theory-card:hover {
    transform: none;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  .theory-card,
  .filter-btn,
  .toast,
  .load-more-btn {
    transition: none;
  }

  .badge-hot {
    animation: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .theory-card {
    border-width: 2px;
  }

  .filter-btn {
    border-width: 2px;
  }
}

*{
   font-family: "Cairo", sans-serif !important;
}

/* Focus Styles for Keyboard Navigation */
.filter-btn:focus,
.modal-close-btn:focus,
.load-more-btn:focus,
.btn:focus {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
}

/* Loading States */
.theory-card.loading {
  opacity: 0.6;
  pointer-events: none;
}

.theory-card.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
