/**
 * YSP Vocabulary Plugin - Side-by-Side Comparison Styles
 * 
 * CSS for the improved side-by-side card comparison
 */

/* Modal sizing and scrolling */
.ysp-side-by-side-modal {
  max-width: 95vw !important;
  max-height: 90vh !important;
}

.ysp-side-by-side-content {
  padding: 0 !important;
  overflow-x: hidden !important;
}

/* Grid layout for cards */
.ysp-side-by-side-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  width: 100%;
  padding: 20px;
}

/* Card styling */
.ysp-lexical-card-column {
  position: relative;
  break-inside: avoid;
  margin-bottom: 20px;
}

.ysp-lexical-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 15px;
  height: 100%;
  overflow: hidden;
  border-left: 4px solid #3498db;
}

/* Highlight the canonical (English) card */
.ysp-canonical-card .ysp-lexical-card {
  border-left: 4px solid #e74c3c;
  background-color: #f9f9f9;
}

.ysp-canonical-card::before {
  content: "Reference";
  position: absolute;
  top: -8px;
  right: 10px;
  background-color: #e74c3c;
  color: white;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 1;
}

/* Card header */
.ysp-card-header {
  font-size: 1.2em;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

/* Definition sections */
.ysp-lexical-card p {
  margin: 8px 0;
  line-height: 1.4;
}

.ysp-lexical-card ul {
  margin: 8px 0;
  padding-left: 20px;
}

.ysp-lexical-card li {
  margin-bottom: 8px;
}

/* Icons and emphasis */
.ysp-lexical-card strong {
  color: #2c3e50;
}

.ysp-lexical-card em {
  color: #7f8c8d;
  font-style: italic;
}

/* Collapsible sections */
.ysp-catch-all {
  margin-top: 15px;
  border-top: 1px dashed #ddd;
  padding-top: 10px;
}

.ysp-catch-all summary {
  cursor: pointer;
  color: #3498db;
  font-weight: bold;
}

.ysp-catch-all summary:hover {
  color: #2980b9;
}

.ysp-catch-scroll {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 10px;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

/* JSON formatting */
.ysp-json-viewer {
  max-height: 400px;
  overflow: auto;
  background-color: #f9f9f9;
  border-radius: 6px;
  padding: 12px;
  margin-top: 10px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  border: 1px solid #eee;
}

.ysp-json-formatted {
  margin: 0;
}

.ysp-json-field {
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}

.ysp-json-key {
  font-weight: 600;
  color: #2c3e50;
  display: inline-block;
  min-width: 120px;
  margin-right: 8px;
}

.ysp-json-value {
  color: #3498db;
}

.ysp-json-array {
  margin-left: 15px;
  padding-left: 10px;
  border-left: 2px solid #eee;
  margin-top: 5px;
  margin-bottom: 5px;
}

.ysp-json-array-item {
  display: block;
  padding: 8px 6px;
  border-bottom: 1px solid #f5f5f5;
  margin-bottom: 5px;
}

.ysp-json-object {
  margin-left: 15px;
  padding-left: 10px;
  border-left: 2px solid #eee;
  margin-top: 5px;
  margin-bottom: 5px;
}

.ysp-json-property {
  padding: 4px 0;
}

.ysp-json-propkey {
  font-weight: 500;
  color: #2c3e50;
  display: inline-block;
  min-width: 100px;
  margin-right: 8px;
}

.ysp-json-propvalue {
  color: #e74c3c;
}

.ysp-json-nested {
  padding: 3px 0;
}

.ysp-json-subkey {
  font-weight: 500;
  color: #7f8c8d;
  display: inline-block;
  min-width: 100px;
  margin-right: 8px;
}

.ysp-json-subvalue {
  color: #16a085;
}

.ysp-json-subarray {
  margin-left: 10px;
  padding-left: 8px;
  border-left: 1px solid #eee;
}

.ysp-json-subitem {
  padding: 2px 0;
  font-style: italic;
  color: #27ae60;
}

.ysp-json-empty {
  color: #7f8c8d;
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ysp-side-by-side-grid {
    grid-template-columns: 1fr;
  }
  
  .ysp-lexical-card {
    max-height: none;
  }
}

/* Print styling */
@media print {
  .ysp-side-by-side-grid {
    display: block;
  }
  
  .ysp-lexical-card-column {
    page-break-inside: avoid;
    margin-bottom: 20px;
  }
  
  .ysp-catch-all {
    display: none;
  }
}

