/* Scoped with .lrc- prefix to avoid theme collisions */

/* Loading state */
.lrc-loading {
  text-align: center;
  padding: 2rem;
  font-size: 1rem;
  color: #6b7280;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lrc-loading::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.5em;
  border: 2px solid #d1d5db;
  border-top-color: #083141;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.lrc-wrapper {
  width: 100% !important;
  max-width: 1100px !important;
  margin: 2rem auto !important;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-sizing: border-box;
}

/* Add padding only on smaller screens */
@media (max-width: 1111px) {
  .lrc-wrapper {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.lrc-app {
  border: 1px solid #083141;
  border-radius: 14px;
  padding: 1.5rem;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.lrc-app h2 {
  margin: 0 0 0.3rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #083141;
}

.lrc-step {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
}

.lrc-step:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.lrc-step h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #083141;
  letter-spacing: -0.01em;
}

.lrc-intro,
.lrc-help {
  font-size: 0.9rem;
  color: #4b5563;
  margin: 0 0 0.9rem;
  line-height: 1.6;
}

.lrc-intro-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid #083141;
}

.lrc-key-points {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.lrc-key-points h4 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #083141;
}

.lrc-key-points ul {
  margin: 0;
  padding-left: 24px;
  color: #4b5563;
}

.lrc-key-points li {
  margin: 6px 0;
  line-height: 1.5;
}

.lrc-help-small {
  font-size: 0.85rem;
  color: #6b7280;
}

/* Grid layout */

.lrc-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.lrc-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.lrc-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

@media (max-width: 720px) {
  .lrc-grid,
  .lrc-grid-2,
  .lrc-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Fields */

.lrc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lrc-field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
}

.lrc-field input[type="text"] {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  background: #f9fafb;
  color: #111827;
}

.lrc-field input[type="text"]:focus {
  outline: 2px solid #083141;
  outline-offset: 0;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(8, 49, 65, 0.15);
  border-color: #083141;
}

.lrc-field input[type="text"]::placeholder {
  color: #9ca3af;
  opacity: 0.7;
}

/* Ensure inputs are easily editable */
.lrc-field input[type="text"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  cursor: text;
}

/* Toggle */

.lrc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #374151;
  cursor: pointer;
}

.lrc-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin: 0;
}

/* Details block */

.lrc-details {
  margin-top: 10px;
  font-size: 0.9rem;
}

.lrc-details summary {
  cursor: pointer;
  color: #083141;
  font-weight: 600;
}

.lrc-lumpy-series {
  margin-top: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #f3f4f6;
  font-size: 0.85rem;
}

.lrc-lumpy-series h4 {
  margin: 4px 0;
  font-size: 0.9rem;
}

/* Table */

.lrc-table-wrapper {
  margin-top: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lrc-swipe-hint {
  display: none;
  font-size: 0.85rem;
  color: #6b7280;
  font-style: italic;
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .lrc-swipe-hint {
    display: block;
  }
}

.lrc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 700px;
}

.lrc-table th,
.lrc-table td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.6rem;
  text-align: right;
  white-space: nowrap;
}

.lrc-table th:first-child,
.lrc-table td:first-child,
.lrc-table th:nth-child(2),
.lrc-table td:nth-child(2) {
  text-align: left;
}

.lrc-table thead {
  background: #f9fafb;
}

.lrc-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

/* Summary cards */

.lrc-summary {
  margin-top: 1.5rem;
}

.lrc-summary-heading {
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  color: #083141 !important;
  margin: 0 0 1.25rem !important;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #083141;
}

.lrc-summary-card {
  border-radius: 12px;
  border: 2px solid #083141;
  background: #ffffff;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 12px rgba(8, 49, 65, 0.12);
  transition: transform 0.2s, box-shadow 0.2s;
}

.lrc-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(8, 49, 65, 0.18);
}

.lrc-summary-card h4 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #083141;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lrc-summary-card p {
  margin: 0.4rem 0;
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.6;
}

.lrc-summary-card-lumpy {
  border-color: #2563eb;
  background: linear-gradient(to bottom, #eff6ff 0%, #ffffff 100%);
}

.lrc-summary-card-smooth {
  border-color: #10b981;
  background: linear-gradient(to bottom, #ecfdf5 0%, #ffffff 100%);
}

/* Responsive */

@media (max-width: 640px) {
  .lrc-app {
    padding: 14px;
  }

  .lrc-table {
    font-size: 0.8rem;
  }
}

/* Charts Section */

.lrc-charts-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
}

.lrc-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.lrc-chart-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s;
}

.lrc-chart-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.lrc-chart-card h4 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #083141;
}

.lrc-chart-description {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0 0 12px;
  line-height: 1.5;
}

.lrc-chart-wrapper {
  position: relative;
  height: 350px;
  width: 100%;
}

.lrc-chart-wrapper canvas {
  max-width: 100%;
  height: 100% !important;
}

/* Table Section */

.lrc-table-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
}

/* Enhanced Summary Cards */

.lrc-summary-card p {
  margin: 4px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.lrc-summary-card p[style*="font-weight: 600"] {
  font-weight: 600;
  color: #083141;
  margin-top: 10px;
}

.lrc-summary-card p[style*="margin-left: 12px"] {
  color: #4b5563;
}

.lrc-disclaimer {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: #fef3c7;
  border-radius: 8px;
  border-left: 4px solid #f59e0b;
}

.lrc-disclaimer h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: #92400e;
}

.lrc-disclaimer ul {
  margin: 0;
  padding-left: 20px;
  font-size: 0.85rem;
  color: #78350f;
  line-height: 1.6;
}

.lrc-disclaimer li {
  margin: 4px 0;
}

/* Responsive */

@media (max-width: 768px) {
  .lrc-charts-grid {
    grid-template-columns: 1fr;
  }

  .lrc-chart-wrapper {
    height: 250px;
  }
}

@media (max-width: 640px) {
  .lrc-wrapper {
    padding: 0 0.75rem;
  }

  .lrc-app {
    padding: 1rem;
    border-radius: 12px;
  }

  .lrc-table {
    font-size: 0.8rem;
  }

  .lrc-table th,
  .lrc-table td {
    padding: 0.4rem 0.5rem;
  }

  .lrc-chart-wrapper {
    height: 200px;
  }

  .lrc-intro-section {
    padding: 0.75rem;
  }
}

/* Print */

@media print {
  .lrc-wrapper {
    max-width: 100%;
    margin: 0;
  }

  .lrc-app {
    border: none;
    box-shadow: none;
  }

  .lrc-charts-section {
    page-break-inside: avoid;
  }

  .lrc-chart-card {
    page-break-inside: avoid;
  }
}

