/* ============================================
   RAM Latency Calculator Specific Styles
   All shared components use shared/css/components.css
   ============================================ */

/* Input Groups */
.rl-input-group {
  margin-bottom: var(--rt-space-5);
}

.rl-input-group:last-child {
  margin-bottom: 0;
}

.rl-label {
  display: block;
  font-size: var(--rt-text-sm);
  font-weight: var(--rt-weight-semibold);
  color: var(--rt-text-primary);
  margin-bottom: var(--rt-space-2);
}

.rl-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.rl-input-wrap .rt-input {
  width: 100%;
  padding-right: 60px;
}

.rl-suffix {
  position: absolute;
  right: var(--rt-space-4);
  font-size: var(--rt-text-sm);
  color: var(--rt-text-muted);
  font-weight: var(--rt-weight-medium);
  pointer-events: none;
}

.rl-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
}

/* Preset Buttons */
.rl-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rt-space-2);
  margin-top: var(--rt-space-3);
}

.rl-preset-btn {
  background: var(--rt-surface-variant);
  border: 1px solid var(--rt-border-default);
  color: var(--rt-text-secondary);
  font-size: var(--rt-text-xs);
  font-weight: var(--rt-weight-semibold);
  padding: var(--rt-space-2) var(--rt-space-3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.rl-preset-btn:hover {
  background: var(--rt-surface-hover);
  border-color: var(--rt-accent);
  color: var(--rt-accent);
  transform: translateY(-1px);
}

.rl-preset-btn:active {
  transform: translateY(0);
}

/* Grade Badge */
.rl-grade-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--rt-space-2);
  margin-top: var(--rt-space-4);
  padding: var(--rt-space-2) var(--rt-space-4);
  background: var(--rt-surface-variant);
  border: 1px solid var(--rt-border-default);
  border-radius: 100px;
  font-size: var(--rt-text-sm);
  font-weight: var(--rt-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rl-grade-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rt-accent);
  display: inline-block;
}

/* Result Details */
.rl-result-details {
  display: flex;
  flex-direction: column;
  gap: var(--rt-space-3);
}

.rl-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--rt-space-3) 0;
  border-bottom: 1px solid var(--rt-border-subtle);
}

.rl-detail-row:last-child {
  border-bottom: none;
}

.rl-detail-label {
  font-size: var(--rt-text-sm);
  color: var(--rt-text-muted);
  font-weight: var(--rt-weight-medium);
}

.rl-detail-value {
  font-size: var(--rt-text-sm);
  color: var(--rt-text-primary);
  font-weight: var(--rt-weight-semibold);
  font-family: 'Inter', monospace;
}

/* Comparison Table */
.rl-compare-card {
  margin-top: var(--rt-space-5);
}

.rl-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  margin-top: var(--rt-space-4);
}

.rl-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--rt-text-sm);
}

.rl-compare-table th {
  text-align: left;
  padding: var(--rt-space-3) var(--rt-space-4);
  background: var(--rt-surface-variant);
  color: var(--rt-text-muted);
  font-weight: var(--rt-weight-semibold);
  text-transform: uppercase;
  font-size: var(--rt-text-xs);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.rl-compare-table td {
  padding: var(--rt-space-3) var(--rt-space-4);
  border-bottom: 1px solid var(--rt-border-subtle);
  color: var(--rt-text-secondary);
  white-space: nowrap;
}

.rl-compare-table tr:hover td {
  background: var(--rt-surface-hover);
}

.rl-compare-table tr.rl-row-active td {
  background: rgba(230, 57, 70, 0.08);
  border-left: 3px solid var(--rt-accent);
}

.rl-latency-val {
  font-weight: var(--rt-weight-bold);
  color: var(--rt-text-primary);
}

.rl-diff {
  font-size: var(--rt-text-xs);
  font-weight: var(--rt-weight-semibold);
  margin-left: var(--rt-space-2);
  padding: 2px 6px;
  border-radius: 4px;
}

.rl-diff-faster {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.rl-diff-slower {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.1);
}

.rl-diff-same {
  color: var(--rt-text-muted);
  background: var(--rt-surface-variant);
}

/* Read-only input styling */
.rl-input-group--readonly .rt-input {
  background: var(--rt-surface-variant);
  color: var(--rt-text-muted);
  cursor: default;
}

/* Responsive */
@media (max-width: 768px) {
  .rl-presets {
    gap: var(--rt-space-1);
  }

  .rl-preset-btn {
    padding: var(--rt-space-1) var(--rt-space-2);
    font-size: 11px;
  }

  .rl-compare-table {
    font-size: 12px;
  }

  .rl-compare-table th,
  .rl-compare-table td {
    padding: var(--rt-space-2) var(--rt-space-3);
  }
}

/* ============================================
   FAQ ACCORDION
   ============================================ */

.rl-faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--rt-space-3);
  margin-top: var(--rt-space-5);
}

.rl-faq-item {
  background: var(--rt-surface-card);
  border: 1px solid var(--rt-border-default);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rl-faq-item:hover {
  border-color: var(--rt-border-hover);
}

.rl-faq-item[open] {
  border-color: var(--rt-accent);
  box-shadow: 0 0 0 1px var(--rt-accent);
}

.rl-faq-question {
  display: flex;
  align-items: center;
  gap: var(--rt-space-3);
  padding: var(--rt-space-4) var(--rt-space-5);
  cursor: pointer;
  list-style: none;
  font-weight: var(--rt-weight-semibold);
  color: var(--rt-text-primary);
  font-size: var(--rt-text-base);
  transition: background 0.2s ease;
}

.rl-faq-question::-webkit-details-marker {
  display: none;
}

.rl-faq-question:hover {
  background: var(--rt-surface-hover);
}

.rl-faq-q-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--rt-accent);
  color: #fff;
  border-radius: 8px;
  font-size: var(--rt-text-xs);
  font-weight: var(--rt-weight-bold);
  flex-shrink: 0;
}

.rl-faq-q-text {
  flex: 1;
}

.rl-faq-chevron {
  width: 20px;
  height: 20px;
  border: solid var(--rt-text-muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform 0.25s ease, border-color 0.2s ease;
  flex-shrink: 0;
  margin-top: -4px;
}

.rl-faq-item[open] .rl-faq-chevron {
  transform: rotate(225deg);
  margin-top: 4px;
  border-color: var(--rt-accent);
}

.rl-faq-answer {
  padding: 0 var(--rt-space-5) var(--rt-space-5) calc(var(--rt-space-5) + 40px);
  color: var(--rt-text-secondary);
  font-size: var(--rt-text-sm);
  line-height: 1.7;
  animation: rl-faq-slide 0.25s ease;
}

.rl-faq-answer p {
  margin: 0;
}

.rl-faq-answer p + p {
  margin-top: var(--rt-space-3);
}

@keyframes rl-faq-slide {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   RELATED GUIDES GRID
   ============================================ */

.rl-guides-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--rt-space-4);
  margin-top: var(--rt-space-5);
}

.rl-guide-card {
  display: flex;
  flex-direction: column;
  background: var(--rt-surface-card);
  border: 1px solid var(--rt-border-default);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.rl-guide-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border-color: var(--rt-accent);
}

.rl-guide-card:hover .rl-guide-link {
  color: var(--rt-accent);
}

.rl-guide-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--rt-surface-variant);
  overflow: hidden;
}

.rl-guide-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.rl-guide-card:hover .rl-guide-img img {
  transform: scale(1.05);
}

.rl-guide-img--fallback .rl-guide-fallback {
  display: flex !important;
}

.rl-guide-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--rt-surface-variant), var(--rt-surface-hover));
}

.rl-guide-body {
  padding: var(--rt-space-4);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.rl-guide-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: var(--rt-weight-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--rt-accent);
  background: rgba(230, 57, 70, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: var(--rt-space-2);
}

.rl-guide-title {
  font-size: var(--rt-text-base);
  font-weight: var(--rt-weight-bold);
  color: var(--rt-text-primary);
  margin: 0 0 var(--rt-space-2) 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rl-guide-excerpt {
  font-size: var(--rt-text-sm);
  color: var(--rt-text-secondary);
  line-height: 1.6;
  margin: 0 0 var(--rt-space-3) 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.rl-guide-link {
  font-size: var(--rt-text-sm);
  font-weight: var(--rt-weight-semibold);
  color: var(--rt-text-muted);
  transition: color 0.2s ease;
  margin-top: auto;
}

/* ============================================
   ABOUT THIS TOOL
   ============================================ */

.rl-about-tool {
  margin-top: var(--rt-space-8);
  background: var(--rt-surface-card);
  border: 1px solid var(--rt-border-default);
  border-radius: 12px;
  overflow: hidden;
}

.rl-about-header {
  display: flex;
  align-items: center;
  gap: var(--rt-space-3);
  padding: var(--rt-space-4) var(--rt-space-5);
  background: var(--rt-surface-variant);
  border-bottom: 1px solid var(--rt-border-default);
}

.rl-about-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.rl-about-title {
  margin: 0;
  font-size: var(--rt-text-lg);
  font-weight: var(--rt-weight-bold);
  color: var(--rt-text-primary);
}

.rl-about-body {
  padding: var(--rt-space-5);
}

.rl-about-body p {
  color: var(--rt-text-secondary);
  font-size: var(--rt-text-sm);
  line-height: 1.7;
  margin: 0 0 var(--rt-space-4) 0;
}

.rl-about-body p:last-of-type {
  margin-bottom: var(--rt-space-5);
}

.rl-about-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--rt-space-4);
  padding-top: var(--rt-space-4);
  border-top: 1px solid var(--rt-border-subtle);
}

.rl-about-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rl-about-meta-label {
  font-size: var(--rt-text-xs);
  color: var(--rt-text-muted);
  font-weight: var(--rt-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rl-about-meta-value {
  font-size: var(--rt-text-sm);
  color: var(--rt-text-primary);
  font-weight: var(--rt-weight-semibold);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .rl-guides-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .rl-guides-grid {
    grid-template-columns: 1fr;
  }

  .rl-about-meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .rl-faq-answer {
    padding-left: var(--rt-space-4);
    padding-right: var(--rt-space-4);
  }

  .rl-faq-question {
    padding: var(--rt-space-3) var(--rt-space-4);
    font-size: var(--rt-text-sm);
  }

  .rl-guide-title {
    font-size: var(--rt-text-sm);
  }
}

@media (max-width: 480px) {
  .rl-about-meta {
    grid-template-columns: 1fr;
    gap: var(--rt-space-3);
  }
}
