/**
 * IT Služby - Jiří Počta (itsluzby.jiripocta.cz)
 * Styly pro 2. fázi: světlý tooltip v hlavičce, kompaktní dvousloupcová sekce
 * #rustdesk-help a sdílený stav zkopírování tlačítka.
 */

/* ==========================================================================
   1. SVĚTLÝ TOOLTIP U IKONY RUSTDESK V HLAVIČCE (NENAHRAZUJE ::before ČÁRU)
   ========================================================================== */
.header-rd-tooltip {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: #ffffff;
  color: var(--color-text-slate);
  border: 1px solid var(--color-rustdesk-border);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.45rem 0.78rem;
  white-space: nowrap;
  box-shadow: 0 10px 24px -4px rgba(2, 78, 255, 0.14), 0 2px 6px rgba(15, 23, 42, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  pointer-events: none;
  z-index: 1050;
}

.header-rd-tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  right: 14px;
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-top: 1px solid var(--color-rustdesk-border);
  border-left: 1px solid var(--color-rustdesk-border);
  transform: rotate(45deg);
}

@media (hover: hover) {
  .header-rustdesk-link:hover .header-rd-tooltip,
  .header-rustdesk-link:focus-visible .header-rd-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* ==========================================================================
   2. KOMPAKTNÍ SEKCE #rustdesk-help (VYROVNANÉ 2 SLOUPCE & MINIMALISTICKÝ OS BOX)
   ========================================================================== */
.section-remote-help .remote-box {
  padding: 2.15rem 2.35rem;
}

.section-remote-help .remote-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem;
  align-items: stretch;
}

.remote-steps-col {
  display: flex;
  flex-direction: column;
}

.remote-steps-heading {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--color-text-slate);
  margin-bottom: 1.1rem;
}

.section-remote-help .remote-steps {
  gap: 0.95rem;
  margin-bottom: 1.45rem;
}

.section-remote-help .step-content strong {
  font-size: 0.95rem;
  margin-bottom: 0.1rem;
}

.section-remote-help .step-content p {
  font-size: 0.87rem;
  line-height: 1.42;
}

.remote-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}

.remote-panel-col {
  display: flex;
  flex-direction: column;
}

.section-remote-help .server-panel-rustdesk {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.55rem;
}

.rd-os-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.32rem;
  padding: 0.28rem;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 1.1rem;
}

.rd-os-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.48rem 0.55rem;
  border-radius: calc(var(--radius-md) - 3px);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: var(--transition);
  min-width: 0;
}

.rd-os-tab:hover {
  color: var(--color-text-slate);
  background: rgba(255, 255, 255, 0.65);
}

.rd-os-tab.is-active {
  background: #ffffff;
  color: var(--color-rustdesk-dark);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

.rd-os-icon {
  width: 0.98rem;
  height: 0.98rem;
  flex-shrink: 0;
}

.rd-os-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rd-os-panel[hidden] {
  display: none;
}

.rd-pkg-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}

.rd-pkg-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--color-text-slate);
}

.rd-pkg-badge {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-rustdesk-dark);
  background: var(--color-rustdesk-light);
  border: 1px solid var(--color-rustdesk-border);
  padding: 0.16rem 0.5rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.rd-pkg-desc {
  font-size: 0.86rem;
  color: var(--color-text-muted);
  line-height: 1.42;
}

.rd-primary-dl {
  width: 100%;
  justify-content: center;
}

.rd-pkg-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  font-size: 0.83rem;
  color: var(--color-text-muted);
}

.rd-alt-wrap,
.rd-guide-inline-cta {
  white-space: nowrap;
}

.rd-meta-link {
  color: var(--color-rustdesk-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rd-meta-link:hover {
  color: var(--color-rustdesk);
}

.rd-guide-inline-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  color: var(--color-rustdesk-dark);
}

.rd-guide-inline-cta:hover {
  color: var(--color-rustdesk);
}

.rd-guide-inline-cta .icon {
  width: 0.92rem;
  height: 0.92rem;
}

/* Sdílený stav kopírovacího tlačítka (použitý i na /rustdesk/navod/<os>) */
@keyframes rdCopyPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.35);
  }
  100% {
    box-shadow: 0 0 0 7px rgba(21, 128, 61, 0);
  }
}

.rd-copy-btn:active {
  transform: scale(0.98);
}

.rd-copy-btn.copied {
  background: var(--color-success-bg) !important;
  border-color: #86efac !important;
  color: var(--color-success) !important;
}

.rd-copy-btn.copied:hover {
  background: #bbf7d0 !important;
  border-color: #4ade80 !important;
}

.rd-copy-btn.copied .icon {
  color: var(--color-success) !important;
}

.rd-copy-btn.is-pulsing {
  animation: rdCopyPulse 0.28s ease-out;
}

/* ==========================================================================
   3. RESPONZIVITA SEKCE #rustdesk-help
   ========================================================================== */
@media (max-width: 992px) {
  .section-remote-help .remote-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .section-remote-help .remote-box {
    padding: 1.35rem;
  }

  .section-remote-help .server-panel-rustdesk {
    padding: 1.25rem;
  }

  .section-remote-help .remote-grid {
    gap: 1.5rem;
  }
}

@media (max-width: 540px) {
  .remote-cta-row .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .rd-os-tabs {
    grid-template-columns: 1.35fr 0.8fr 0.85fr;
  }

  .rd-os-tab {
    font-size: 0.78rem;
    padding: 0.45rem 0.25rem;
    gap: 0.26rem;
    white-space: nowrap;
  }

  .rd-os-icon {
    width: 0.85rem;
    height: 0.85rem;
  }

  .rd-tab-apple-prefix {
    display: none;
  }

  .rd-pkg-title-row {
    flex-wrap: wrap;
  }
}
