/* 613 Mitzvot App Styles */

/* * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
} */

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  /* padding: 20px;
  padding-top: 0; */
  padding-bottom: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background-color: white;
  border-radius: 15px;
  padding: 0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
  color: white;
  padding: 30px;
  padding-top: 10px;
}

.header-top {
  text-align: center;
  margin-bottom: 15px;
  position: relative;
}

.header-title-wrapper {
  margin-bottom: 20px;
}

.header-title-wrapper h1 {
  /* margin-top: 15px;
  margin-bottom: 0; */
  /* text-align: center;
  flex-shrink: 0; */
}

.header-date {
  /* position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0; */
  text-align: center;
  font-size: 0.85em;
  opacity: 0.85;
  font-weight: normal;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.4;
  /* max-width: 700px; */
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.header-date .separator {
  opacity: 0.5;
}

.header-date .date-part,
.header-date .parasha-part,
.header-date .events-part {
  white-space: nowrap;
}

.header-hebrew-text {
  position: absolute;
  right: 20px;
  top: 0;
  text-align: right;
  direction: rtl;
  font-family: "Noto Serif Hebrew", "Times New Roman", serif;
}

.header-hebrew-text .bsd {
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 5px;
}

.header-hebrew-text .based-on {
  font-size: 0.9em;
  opacity: 0.85;
}

.header-bottom {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

/* Header stats in header */
.header-stats {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

/* Search box in header */
.header .search-box {
  flex: 1;
  min-width: 250px;
  margin: 0;
}

.header .search-box input {
  width: 100%;
  padding: 12px 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  color: white;
  border-radius: 25px;
  font-size: 16px;
  transition: all 0.3s ease;
}

.header .search-box input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.header .search-box input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.header h1 {
  font-size: 2.5em;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Title: Hebrew and English side-by-side */
.app-title {
  /* display: inline-flex; */
  align-items: baseline;
  /* gap: 10px; */
}
.app-title .title-he {
  font-family: "Noto Serif Hebrew", "Times New Roman", serif;
}
.app-title .title-en,
.title-en {
  font-weight: 700;
  font-family: "Cardo", Georgia, "Times New Roman", serif;
}

/* Subtle separator between EN and HE in title */
.subtitle .title-sep {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 400;
  opacity: 0.85;
  margin: 5px;
  /* slightly smaller to reduce visual weight */
  font-size: 0.9em;
}

.header .subtitle {
  font-size: 1.2em;
  opacity: 0.9;
  /* font-family: "Cardo", serif; */
}

.stats {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.stat-card {
  background: rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 10px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-card.active {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  /* display: none; */
}
.stat-label {
  font-size: 0.8em;
  opacity: 0.9;
  display: none;
}

.stat-total .stat-icon {
  /* color: #f39c12; */
}

.stat-positive .stat-icon {
  /* color: #2ecc71; */
}

.stat-negative .stat-icon {
  /* color: #e74c3c; */
}

.stat-content {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
}

.stat-number {
  font-size: 1.5em;
  font-weight: bold;
  line-height: 1;
}

.controls {
  padding: 10px 20px;
  /* background-color: #a4cbf1; */
  border-bottom: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.filter-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.primary-filters {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
}

/* Scope icon chips panel */
.scope-filters {
  display: flex;
  align-items: center;
}

.scope-chip-row {
  display: flex;
  gap: 6px;
}

.scope-chip {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #dcdfe3;
  background: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scope-chip .chip-icon {
  width: 16px;
  height: 16px;
}

.scope-chip:hover {
  border-color: #bfc5cc;
  transform: translateY(-1px);
}

.scope-chip.active {
  border-color: #6c757d;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.scope-chip.muted {
  opacity: 0.45;
}

/* Type-specific active colors for icon-only chips */
.scope-chip.positive.active {
  background: #d4edda;
  color: #155724;
  border-color: rgba(21, 87, 36, 0.35);
}

.scope-chip.negative.active {
  background: #f8d7da;
  color: #721c24;
  border-color: rgba(114, 28, 36, 0.35);
}

/* Compact type filter chips */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid #dcdfe3;
  background: #ffffff;
  color: #2c3e50;
  font-weight: 600;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip .chip-icon {
  width: 16px;
  height: 16px;
}

.filter-chip .chip-count {
  font-weight: 700;
}

.filter-chip:hover {
  border-color: #bfc5cc;
  transform: translateY(-1px);
}

.filter-chip.active {
  border-color: #6c757d;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.filter-chip.muted {
  opacity: 0.45;
}

/* Type-specific active colors */
.filter-chip.positive.active {
  background: #d4edda;
  color: #155724;
  border-color: rgba(21, 87, 36, 0.35);
}

.filter-chip.negative.active {
  background: #f8d7da;
  color: #721c24;
  border-color: rgba(114, 28, 36, 0.35);
}

.filter-chip.active:not(.positive):not(.negative) {
  background: #e9ecef;
  color: #343a40;
}

.secondary-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-left: 0;
  animation: slideDown 0.3s ease;
  align-items: center;
}

/* Filter label */
.filter-label {
  /* font-weight: 600; */
  color: #495057;
  font-size: 0.9em;
  white-space: nowrap;
}

/* Input groups in secondary filters should not wrap and have fixed width */
.secondary-filters .input-group {
  flex: 0 0 auto;
  width: 200px;
  /* min-width: 185px; */
  flex-wrap: nowrap;
}

/* Set fixed width for select filters */
/* .filter-select {
  flex: 1;
  min-width: 120px;
} */

/* Select2 parasha dropdown styling */
/* .select2-container {
  max-width: 200px;
} */

.select2-container .select2-selection--single {
  height: 31px;
  border-color: #ced4da;
}

.select2-container .select2-selection--single .select2-selection__rendered {
  line-height: 29px;
  padding-left: 8px;
  font-size: 0.875rem;
}

.select2-container .select2-selection--single .select2-selection__arrow {
  height: 29px;
}

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

.language-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 4px 0;
}

/* On small screens, allow wrapping so controls don't overflow */
@media (max-width: 768px) {
  .primary-filters {
    flex-wrap: wrap;
  }
  .language-controls {
    /* width: 100%; */
    justify-content: flex-start;
    margin-left: 0;
    padding-top: 6px;
  }
}

/* Minimal Tom Select styling */
.ts-wrapper {
  min-width: 150px;
}

.loading {
  text-align: center;
  padding: 50px;
  font-size: 1.2em;
  color: #666;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

/* Font styling for language buttons */
.table-lang-btn[data-lang="he"],
.language-btn[data-lang="he"] {
  font-family: "Noto Serif Hebrew", "Times New Roman", serif;
}

.language-btn,
.table-lang-btn:not([data-lang="he"]) {
  font-family: "Cardo", Georgia, "Times New Roman", serif;
}

/* Active state for language buttons using Bootstrap classes */
/* .table-lang-btn.active {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
  color: white !important;
} */

.table-container {
  overflow-x: auto;
  max-height: 150vh;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
}

th,
td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
th {
  padding: 10px;
}

th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #2c3e50;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Sortable table headers */
th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

th.sortable:hover {
  background-color: #e9ecef;
}

th.sortable.active {
  background-color: #3498db;
  color: white;
}

.sort-label {
  margin-right: 4px;
}

.sort-indicator {
  font-size: 0.8em;
  display: inline-block;
  width: 12px;
}

/* Add subtle sort icon to sortable headers */
th.sortable .sort-label::after {
  content: "⇅";
  font-size: 0.85em;
  margin-left: 6px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

th.sortable:hover .sort-label::after {
  opacity: 0.9;
}

th.sortable.active .sort-label::after {
  opacity: 0;
}

/* Ensure Tom Select dropdowns appear above sticky table headers */
.ts-dropdown {
  z-index: 1002 !important;
}

tr:hover {
  background-color: #f8f9fa;
}

.mitzvah-number {
  font-weight: bold;
  color: #2c3e50;
  text-align: center;
  width: 80px;
}

.mitzvah-type {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: bold;
  text-align: center;
  min-width: 80px;
}

.positive {
  background-color: #d4edda;
  color: #155724;
}

.negative {
  background-color: #f8d7da;
  color: #721c24;
}

/* Mitzvah number badge - uses positive/negative colors */
.mitzvah-number-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.mitzvah-title {
  font-weight: 600;
  color: #2c3e50;
  max-width: 300px;
}

/* Hebrew title styling */
.title-he {
  direction: rtl;
  text-align: right;
  font-weight: 600;
  /* color: #2c3e50; */
  margin-top: 4px;
  font-family: "Noto Serif Hebrew", "Times New Roman", serif;
}

.description {
  max-width: 400px;
  line-height: 1.5;
  color: #555;
}

/* Classification icons column */
.classification-icons {
  text-align: center;
  width: 120px;
  white-space: nowrap;
}

.icon-badge {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin: 2px;
  border-radius: 4px;
  line-height: 24px;
  text-align: center;
  font-size: 14px;
  cursor: help;
  position: relative;
}

.icon-badge:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 100;
  margin-bottom: 4px;
}

/* Icon colors and symbols */
.icon-men {
  background-color: #e3f2fd;
  color: #1976d2;
}
.icon-women {
  background-color: #fce4ec;
  color: #c2185b;
}
.icon-all {
  background-color: #e8f5e9;
  color: #388e3c;
}
.icon-time-always {
  background-color: #fff3e0;
  color: #f57c00;
}
.icon-time-conditional {
  background-color: #f3e5f5;
  color: #7b1fa2;
}
.icon-time-festival {
  background-color: #e0f2f1;
  color: #00796b;
}
.icon-location-temple {
  background-color: #efebe9;
  color: #5d4037;
}
.icon-location-israel {
  background-color: #e8eaf6;
  color: #3f51b5;
}
.icon-location-anywhere {
  background-color: #f1f8e9;
  color: #689f38;
}

.parasha {
  font-style: italic;
  color: #7f8c8d;
  font-size: 0.9em;
  min-width: 120px;
}

.pagination {
  padding: 20px;
  text-align: center;
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

.pagination button {
  padding: 8px 15px;
  margin: 0 5px;
  border: 1px solid #ddd;
  background-color: white;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
  background-color: #3498db;
  color: white;
}

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

.pagination .current {
  background-color: #3498db;
  color: white;
}

.error {
  text-align: center;
  padding: 50px;
  color: #e74c3c;
  font-size: 1.2em;
}

.details-toggle {
  background: none;
  border: none;
  color: #3498db;
  cursor: pointer;
  font-size: 0.9em;
  text-decoration: underline;
}

.source-refs-label {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
}

.source-ref {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 6px;
  background-color: #f0f0f0;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.8em;
}

/* Sidebar styles */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 999;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.sidebar {
  position: fixed;
  top: 0;
  right: -600px;
  width: 600px;
  max-width: 90vw;
  height: 100vh;
  background-color: white;
  box-shadow: -2px 0 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar.show {
  right: 0;
}

.sidebar-header {
  background-color: #f8f9fa;
  padding: 20px;
  border-bottom: 2px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 15px;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.5em;
  color: #2c3e50;
  flex: 1 1 calc(100% - 60px);
}

.language-toggle {
  display: flex;
  gap: 5px;
  background-color: #e9ecef;
  padding: 4px;
  border-radius: 8px;
  flex: 1 1 auto;
}

.language-btn {
  padding: 8px 16px;
  border: none;
  background-color: transparent;
  color: #495057;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.language-btn:hover {
  background-color: #dee2e6;
}

.language-btn.active {
  background-color: #3498db;
  color: white;
}

.sidebar-close {
  background: #dee2e6;
  border: none;
  color: #2c3e50;
  font-size: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
}

.sidebar-close:hover {
  background: #c8cdd2;
  transform: rotate(90deg);
}

.sidebar-content {
  padding: 25px;
  flex: 1;
}

.sidebar-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 10px;
}

.sidebar-meta-item {
  text-align: center;
}

.sidebar-meta-label {
  font-size: 0.85em;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.sidebar-meta-value {
  font-weight: 600;
  color: #2c3e50;
  font-size: 1.1em;
}

.sidebar-section {
  margin-bottom: 25px;
}

.sidebar-section h3 {
  color: #2c3e50;
  font-size: 1.2em;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #3498db;
}

.sidebar-section p {
  line-height: 1.8;
  color: #555;
  margin: 0;
}

/* Hebrew text styling */
.text-he {
  direction: rtl;
  text-align: right;
  font-family: "Noto Serif Hebrew", "Times New Roman", serif;
}

/* Interlinear styling */
.interlinear-container {
  margin-bottom: 15px;
}

.interlinear-en {
  color: #2c3e50;
  margin-bottom: 5px;
}

.interlinear-he {
  direction: rtl;
  text-align: right;
  color: #555;
  font-family: "Noto Serif Hebrew", "Times New Roman", serif;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

/* Ensure any element explicitly marked as Hebrew uses the Hebrew font */
[lang="he"] {
  font-family: "Noto Serif Hebrew", "Times New Roman", serif;
}

.sidebar-classification {
  background: linear-gradient(135deg, #e8f4f8 0%, #f0f8ff 100%);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 25px;
  border-left: 4px solid #3498db;
}

.sidebar-classification h3 {
  border-bottom: none;
  margin-bottom: 15px;
}

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

@media (max-width: 768px) {
  .sidebar {
    width: 100vw;
    right: -100vw;
  }

  .sidebar-meta {
    grid-template-columns: 1fr;
  }
}

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

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

  .header-title-wrapper {
    /* flex-direction: column; */
    align-items: center;
    justify-content: space-around;
    line-height: normal;
    margin-bottom: 20px;
  }

  .header-hebrew-text {
    position: static;
    margin-top: 10px;
  }
  .header-top {
    margin-bottom: 10px;
  }
  .header .subtitle {
    font-size: 1em;
    /* opacity: 0.9; */
  }
  .stat-icon {
    /* width: 20px;
  height: 20px;
  flex-shrink: 0; */
    display: initial;
    height: 15px;
  }
  .stat-card {
    gap: 2px;
    padding: 6px 10px;
  }
  .stat-total .stat-icon {
    /* color: #f39c12; */
  }

  .stat-positive .stat-icon {
    /* color: #2ecc71; */
  }

  .stat-negative .stat-icon {
    /* color: #e74c3c; */
  }
  .stat-number {
    font-size: 0.8em;
    /* font-weight: bold; */
    line-height: normal;
  }
  .stat-label {
    /* font-size: 0.8em;
  opacity: 0.9; */
    display: none;
  }

  .header-bottom {
    flex-direction: column;
  }

  .header .search-box {
    min-width: 100%;
  }

  .stats {
    gap: 15px;
    justify-content: center;
    /* width: 100%; */
  }

  /* .stat-card {
    padding: 10px 15px;
  } */

  .header h1 {
    font-size: 2em;
  }
}

/* Card Modal Styles */
.card-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(5px);
}

.card-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.card-modal {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -20px) scale(0.8);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 20px;
}

.card-modal.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

.card-modal-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e74c3c;
  color: white;
  border: 3px solid white;
  font-size: 24px;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.card-modal-close:hover {
  background: #c0392b;
  transform: scale(1.1);
}

/* MTG Card Styles */
.mtg-card {
  /* width: calc(750px * 0.7);
  height: calc(1050px * 0.7); */
  width: 500px;
  height: 700px;
  background: #1a1a1a;
  border-radius: 20px;
  padding: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
}

.mtg-card-inner {
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  border-radius: 15px;
  padding: 12px;
  border: 3px solid #333;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mtg-card-inner.positive-frame {
  border-color: #4caf50;
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.mtg-card-inner.negative-frame {
  border-color: #f44336;
  box-shadow: 0 0 20px rgba(244, 67, 54, 0.5);
}

/* Card Header */
.mtg-card-header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  padding: 12px 15px;
  border-radius: 10px 10px 0 0;
  margin: -12px -12px 0 -12px;
  flex-shrink: 0;
}

.mtg-card-title {
  font-size: 18px;
  font-weight: bold;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 5px;
}

.mtg-card-title-he {
  font-family: "Noto Serif Hebrew", "Times New Roman", serif;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  direction: rtl;
}

/* Type Line */
.mtg-card-type-line {
  background: linear-gradient(90deg, #d4af37 0%, #f4e7c3 50%, #d4af37 100%);
  padding: 8px 15px;
  margin: 0 -12px;
  font-weight: bold;
  border-top: 2px solid #b8941f;
  border-bottom: 2px solid #b8941f;
  font-size: 14px;
  color: #333;
  flex-shrink: 0;
}

.mtg-type {
  font-weight: bold;
}

.mtg-subtype {
  font-style: italic;
}

/* Card Image */
.mtg-card-image {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  height: 250px;
  min-height: 250px;
  max-height: 250px;
  margin: 12px 0;
  border-radius: 8px;
  border: 3px solid #444;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.mtg-card-image-actual {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* object-position: top center; */
  display: block;
}

.mtg-card-image-placeholder {
  text-align: center;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.mtg-card-image-placeholder > span:first-child {
  font-size: 48px;
  display: block;
  margin-bottom: 10px;
}

.placeholder-text {
  font-size: 16px;
  font-style: italic;
  opacity: 0.9;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Text Box */
.mtg-card-text-box {
  background: #f9f9f9;
  padding: 15px;
  margin: 12px 0;
  border-radius: 8px;
  border: 2px solid #666;
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom scrollbar for text box */
.mtg-card-text-box::-webkit-scrollbar {
  width: 8px;
}

.mtg-card-text-box::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.mtg-card-text-box::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.mtg-card-text-box::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

.mtg-card-icons-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* padding: 10px 15px; */
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(155, 89, 182, 0.15) 100%);
  border-top: 2px solid rgba(0, 0, 0, 0.1);
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  gap: 10px;
}

.mtg-card-category {
  font-weight: bold;
  font-size: 13px;
  color: #2c3e50;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.mtg-card-subcategory {
  font-weight: normal;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.3px;
  opacity: 0.85;
}

.mtg-card-icons {
  display: flex;
  /* gap: 5px; */
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 0;
  flex-shrink: 0;
}

.mtg-card-description {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #222;
}

.mtg-card-details {
  background: rgba(52, 152, 219, 0.1);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 12px;
  border-left: 3px solid #3498db;
}

.mtg-card-details > div {
  margin-bottom: 5px;
}

.mtg-card-details > div:last-child {
  margin-bottom: 0;
}

.mtg-card-flavor {
  font-style: italic;
  color: #666;
  font-size: 12px;
  text-align: center;
  padding-top: 10px;
  border-top: 1px solid #ddd;
}

/* Card Footer */
.mtg-card-footer {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  padding: 10px 15px;
  border-radius: 0 0 10px 10px;
  margin: 0 -12px -12px -12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  font-size: 12px;
  flex-shrink: 0;
}

.mtg-card-set-info {
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mtg-card-number {
  font-family: "Courier New", monospace;
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: bold;
}

/* Details Actions */
.details-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.details-toggle,
.card-toggle {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  min-width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.details-toggle:hover,
.card-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.card-toggle {
  background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

/* Mobile Cards */
.mobile-cards {
  display: none;
  padding: 15px;
  gap: 15px;
  flex-direction: column;
}

.mitzvah-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease;
}

.mitzvah-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header .details-toggle {
  font-size: 1.2em;
  padding: 6px 10px;
  min-width: auto;
  height: auto;
}

.card-number {
  font-weight: 600;
  color: #667eea;
  font-size: 1.1em;
}

.card-title {
  font-size: 1.05em;
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 12px;
  line-height: 1.4;
}

.card-description {
  font-size: 0.9em;
  color: #555;
  margin-bottom: 12px;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
}

.card-parasha {
  font-size: 0.9em;
  color: #666;
  flex: 1;
}

.card-scope {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.parasha-label {
  font-weight: 600;
  color: #495057;
}

/* Desktop: Show table, hide mobile cards */
@media (min-width: 768px) {
  #mitzvotTable {
    display: table;
  }

  .mobile-cards {
    display: none !important;
  }
}

/* Mobile: Hide table, show mobile cards */
@media (max-width: 767px) {
  #mitzvotTable {
    display: none;
  }

  .mobile-cards {
    display: flex !important;
  }

  .mtg-card {
    width: 95vw;
    max-width: 400px;
  }

  .card-modal {
    width: 100%;
    padding: 10px;
  }

  .header {
    padding: 20px 15px;
  }

  .filters-main {
    flex-direction: column;
    gap: 10px;
  }

  .header-title-wrapper h1 {
    font-size: 1.5em;
  }
}

/* Custom SweetAlert Styles for Subtle Popup */
.subtle-popup {
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.subtle-title {
  font-size: 17px !important;
  font-weight: 500 !important;
  color: #495057 !important;
  margin-bottom: 8px !important;
}

.subtle-button {
  font-size: 13px !important;
  padding: 8px 20px !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

.subtle-button:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3) !important;
}

/* Make SweetAlert icon much smaller and subtle */
.subtle-icon {
  width: 50px !important;
  height: 50px !important;
  margin: 10px auto 15px !important;
}

.subtle-icon.swal2-icon {
  font-size: 1.5em !important;
  border-width: 3px !important;
}

.subtle-icon.swal2-icon.swal2-info {
  color: #6c757d !important;
  border-color: #dee2e6 !important;
}

.subtle-icon .swal2-icon-content {
  font-size: 2em !important;
}
