﻿/* تحلیل تخصصی مدار — parity with CircuitAnalysis.tsx */

body.ic-analysis-page .ic-header,
body.ic-analysis-page .ic-footer,
body.ic-analysis-page .ic-tabbar,
body.ic-analysis-page .ic-tabbar-dock,
body.ic-analysis-page .site-header,
body.ic-analysis-page .site-footer,
body.ic-analysis-page #wpadminbar {
  display: none !important;
}

/* حذف فاصلهٔ ادمین‌بار وردپرس وقتی نوار مخفی است */
html.wp-toolbar:has(body.ic-analysis-page),
html:has(body.ic-analysis-page) {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body.ic-analysis-page {
  background: #fff;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body.ic-analysis-page .ic-site {
  margin: 0;
  padding: 0;
}

@media (max-width: 800px) {
  html:has(body.ic-analysis-page),
  body.ic-analysis-page {
    height: 100%;
    height: 100svh;
    overflow: hidden;
    padding-bottom: 0 !important;
  }

  body.ic-analysis-page .ic-phone-shell {
    height: 100svh;
    max-height: 100svh;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 0 !important;
  }

  body.ic-analysis-page .ic-site {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  body.ic-analysis-page .ic-analysis {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
  }
}

.ic-analysis {
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
  direction: rtl;
  font-family: "IRANYekan", Tahoma, sans-serif;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.ic-analysis-header {
  direction: ltr;
  display: flex;
  align-items: center;
  padding: 8px 16px;
  min-height: 0;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.ic-analysis-close .ic-icon {
  background-color: #007aff;
}

.ic-analysis-diamond {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  text-decoration: none;
}

.ic-analysis-diamond[hidden] {
  display: none !important;
}

.ic-analysis-diamond img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.ic-analysis-header-title {
  flex: 1;
  font-size: 13px;
  font-weight: 400;
  color: #333;
  text-align: center;
  margin: 0;
}

.ic-analysis-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #2d3a4a;
  font-size: 12px;
}

.ic-analysis-loading[hidden] {
  display: none !important;
}

.ic-analysis-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e9f2;
  border-top-color: #4e91e6;
  border-radius: 50%;
  animation: ic-analysis-spin 0.7s linear infinite;
}

@keyframes ic-analysis-spin {
  to { transform: rotate(360deg); }
}

.ic-analysis-error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 60px;
}

.ic-analysis-error[hidden] {
  display: none !important;
}

.ic-analysis-error-brand {
  font-size: 34px;
  font-weight: 700;
  color: #4e91e6;
  letter-spacing: 2px;
}

.ic-analysis-retry {
  background: none;
  border: 0;
  color: #4e91e6;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 12px;
  font-family: inherit;
}

.ic-analysis-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 30px;
  -webkit-overflow-scrolling: touch;
}

.ic-analysis-body[hidden] {
  display: none !important;
}

.ic-analysis-circuit-name {
  font-size: 15px;
  font-weight: 700;
  color: #2d3a4a;
  text-align: center;
  margin: 20px 20px 10px;
}

.ic-analysis-img-wrap {
  margin: 20px 20px 0;
  border-radius: 8px;
  overflow: hidden;
  height: 220px;
  background: #fff;
}

.ic-analysis-img-wrap[hidden] {
  display: none !important;
}

.ic-analysis-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ic-analysis-locked-hint {
  margin: 14px 20px 0;
  text-align: center;
}

.ic-analysis-locked-hint[hidden] {
  display: none !important;
}

.ic-analysis-locked-hint p {
  font-size: 11px;
  color: #3a4553;
  line-height: 22px;
  margin: 0;
  font-family: "IRANYekan", Tahoma, sans-serif;
}

.ic-analysis-sub-link {
  color: #4e91e6;
  text-decoration: none;
  cursor: pointer;
}

.ic-analysis-sections {
  padding: 20px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.ic-analysis-section {
  border-radius: 15px;
  overflow: hidden;
}

.ic-analysis-section-header {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  direction: ltr;
  background: #f3f6fd;
  padding: 18px 16px;
  cursor: pointer;
  border: 0;
  width: 100%;
  border-radius: 15px;
  transition: border-radius 0.18s;
  text-align: right;
  font-family: inherit;
}

.ic-analysis-section-header.is-open {
  border-radius: 15px 15px 0 0;
}

.ic-analysis-section-header.is-locked {
  cursor: pointer;
}

.ic-analysis-section-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #3a4553;
  text-align: right;
  direction: rtl;
  flex: 1;
  margin: 0;
}

.ic-analysis-caret-wrap,
.ic-analysis-lock-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  flex-shrink: 0;
}

.ic-analysis-caret-img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  transition: transform 0.22s ease;
  transform: rotate(0deg);
  opacity: 0.65;
}

.ic-analysis-section-header.is-open .ic-analysis-caret-img {
  transform: rotate(180deg);
}

.ic-analysis-caret {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-left: 2px solid #8e9cb5;
  border-bottom: 2px solid #8e9cb5;
  transform: rotate(-45deg);
  transition: transform 0.22s;
}

.ic-analysis-section-header.is-open .ic-analysis-caret {
  transform: rotate(135deg);
}

.ic-analysis-lock-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
  filter: brightness(0) saturate(100%) invert(78%) sepia(12%) saturate(746%) hue-rotate(185deg) brightness(96%) contrast(92%);
}

.ic-analysis-lock-fallback {
  width: 16px;
  height: 16px;
  display: block;
  background-color: #bcccf0;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1a5 5 0 0 0-5 5v3H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V11a2 2 0 0 0-2-2h-2V6a5 5 0 0 0-5-5zm0 2a3 3 0 0 1 3 3v3H9V6a3 3 0 0 1 3-3zm0 9a2 2 0 1 1 0 4 2 2 0 0 1 0-4z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1a5 5 0 0 0-5 5v3H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V11a2 2 0 0 0-2-2h-2V6a5 5 0 0 0-5-5zm0 2a3 3 0 0 1 3 3v3H9V6a3 3 0 0 1 3-3zm0 9a2 2 0 1 1 0 4 2 2 0 0 1 0-4z'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.ic-analysis-lock-icon.is-shaking,
.ic-analysis-lock-fallback.is-shaking,
.ic-analysis-lock-wrap.is-shaking {
  animation: ic-analysis-lock-shake 0.25s ease;
}

@keyframes ic-analysis-lock-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.ic-analysis-section-body {
  background: #fff;
  padding: 0 10px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.18s ease, padding 0.18s;
  border-radius: 0 0 15px 15px;
}

.ic-analysis-section-body.is-open {
  max-height: 4000px;
  padding: 10px 10px 14px;
  transition: max-height 0.3s ease, padding 0.2s;
}

.ic-analysis-content-text {
  font-size: 12.5px;
  color: #384152;
  line-height: 35px;
  text-align: right;
  margin: 0;
}

.ic-analysis-comp-name {
  font-weight: 700;
  color: #2d3a4a;
}

.ic-analysis-sub-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #4e91e6;
  text-align: right;
  margin: 0;
}

.ic-analysis-adv-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #3cae3d;
  text-align: right;
  margin: 0;
}

.ic-analysis-dis-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #ec4848;
  text-align: right;
  margin: 0;
}

.ic-analysis-read-more {
  color: #f1964e;
  font-size: 10.3px;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  display: block;
  margin-top: 6px;
  text-align: right;
}

.ic-analysis-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.ic-analysis-empty[hidden] {
  display: none !important;
}

.ic-analysis-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin: 0 0 8px;
}

.ic-analysis-empty-text {
  font-size: 12px;
  color: #666;
  margin: 0;
}
