/* ===========================
   ObliczProcent - Tool Pages
   =========================== */

/* === TOOL HERO === */

.op-tool-hero {
  background: linear-gradient(135deg, var(--op-navy) 0%, var(--op-navy-light) 100%);
  padding: 36px 20px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
  width: 100%;
  margin: 0 !important;
}

.op-tool-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image:
    linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.op-tool-hero__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
}

.op-tool-hero__title {
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.op-tool-hero__title span {
  color: var(--op-teal-light);
}

.op-tool-hero__desc {
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  margin: 0;
}

/* === BREADCRUMB === */

.op-breadcrumb {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}

.op-breadcrumb a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
}

.op-breadcrumb a:hover {
  color: rgba(255,255,255,0.7);
}

.op-breadcrumb span {
  color: rgba(255,255,255,0.3);
}

.op-breadcrumb__current {
  color: var(--op-teal-light) !important;
}

/* === TOOL CARD === */

.op-tool-wrap {
  padding: 0 20px;
  margin-top: -32px;
  position: relative;
  z-index: 3;
  width: 100%;
}

.op-tool-card {
  background: #fff;
  border-radius: var(--op-radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  padding: 28px 32px;
  max-width: 720px;
  margin: 0 auto;
}

/* === TOOL TABS === */

.op-tool-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--op-gray-50);
  border-radius: var(--op-radius-sm);
  padding: 4px;
}

.op-tool-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  color: var(--op-gray-400);
  background: transparent;
  border: none;
  transition: all 0.2s;
}

.op-tool-tab.active {
  background: #fff;
  color: var(--op-gray-800);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* === TOOL FIELDS (grid) === */

.op-tool-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: end;
}

.op-tool-fields--3col {
  grid-template-columns: 1fr 1fr 120px;
}

.op-tool-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--op-gray-600);
  margin: 0 0 6px 0;
}

.op-tool-field input {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--op-gray-200);
  border-radius: var(--op-radius-sm);
  padding: 0 14px;
  font-size: 18px;
  font-weight: 600;
  color: var(--op-gray-800);
  background: var(--op-gray-50);
  outline: none;
  text-align: center;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}

.op-tool-field input::-webkit-outer-spin-button,
.op-tool-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.op-tool-field input:focus {
  border-color: var(--op-teal);
}

.op-tool-field--result input {
  background: var(--op-teal-bg);
  border-color: rgba(34,176,125,0.2);
  color: var(--op-teal);
}

.op-tool-field--small input {
  font-size: 16px;
}

/* === TOOL INPUT GROUP (stacked) === */

.op-tool-input-group {
  margin-bottom: 16px;
}

.op-tool-input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--op-gray-600);
  margin: 0 0 6px 0;
}

.op-tool-input-group input {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--op-gray-200);
  border-radius: var(--op-radius-sm);
  padding: 0 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--op-gray-800);
  background: var(--op-gray-50);
  outline: none;
  text-align: center;
  transition: border-color 0.2s;
}

.op-tool-input-group input:focus {
  border-color: var(--op-teal);
}

.op-tool-input-group--result input {
  background: var(--op-teal-bg);
  border-color: rgba(34,176,125,0.2);
  color: var(--op-teal);
}

/* === TOOL DIVIDER === */

.op-tool-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}

.op-tool-divider__line {
  flex: 1;
  height: 1px;
  background: var(--op-gray-200);
}

.op-tool-divider__text {
  font-size: 11px;
  font-weight: 600;
  color: var(--op-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === TOOL FRACTION ROW === */

.op-tool-fraction-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
}

.op-tool-fraction-sep {
  font-size: 28px;
  font-weight: 300;
  color: var(--op-gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 20px;
}

/* === EXAMPLE GRID === */

.op-example-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0 24px;
}

.op-example-card {
  background: var(--op-gray-50);
  border-radius: var(--op-radius-sm);
  padding: 16px;
  text-align: center;
}

.op-example-card__from {
  font-size: 20px;
  font-weight: 700;
  color: var(--op-purple);
  margin: 0 0 4px 0;
}

.op-example-card__arrow {
  font-size: 12px;
  color: var(--op-gray-400);
  margin: 0 0 4px 0;
}

.op-example-card__to {
  font-size: 17px;
  font-weight: 600;
  color: var(--op-teal);
  margin: 0;
}

.op-example-card__sub {
  font-size: 12px;
  color: var(--op-gray-400);
  margin: 2px 0 0 0;
}

/* === TOOL FORMULA === */

.op-tool-formula {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--op-gray-50);
  border-radius: var(--op-radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}

.op-tool-formula__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--op-teal-bg);
  color: var(--op-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  font-style: italic;
  flex-shrink: 0;
}

.op-tool-formula p {
  font-size: 13px;
  color: var(--op-gray-400);
  line-height: 1.4;
  margin: 0;
}

.op-tool-formula strong {
  color: var(--op-gray-600);
}

/* === TOOL BUTTON === */

.op-tool-btn {
  width: 100%;
  height: 48px;
  margin-top: 16px;
  background: var(--op-teal);
  color: #fff;
  border: none;
  border-radius: var(--op-radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
}

.op-tool-btn:hover {
  background: var(--op-teal-light);
}

/* === TOOL PANELS === */

.op-tool-panel {
  display: none;
}

.op-tool-panel.active {
  display: block;
}

/* === TOOL CONTENT === */

.op-tool-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px;
}

.op-tool-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--op-gray-800);
  margin: 0 0 16px 0;
  line-height: 1.3;
}

.op-tool-content h2 span,
.op-tool-content h2 strong {
  color: var(--op-teal);
}

.op-tool-content h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--op-gray-800);
  margin: 32px 0 12px 0;
}

.op-tool-content p {
  font-size: 15px;
  color: var(--op-gray-600);
  line-height: 1.8;
  margin: 0 0 14px 0;
}

.op-tool-content .wp-block-code,
.op-tool-content pre {
  background: var(--op-navy);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--op-radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 15px;
  margin: 12px 0 20px;
  overflow-x: auto;
}

.op-tool-content .wp-block-code code {
  color: var(--op-teal-light);
}

/* === DEFINITION CARDS === */

.op-def-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 24px;
}

.op-def-card {
  background: var(--op-gray-50);
  border-radius: var(--op-radius-sm);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.op-def-sym {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

.op-def-sym--purple {
  background: #eef2ff;
  color: var(--op-purple);
}

.op-def-sym--teal {
  background: var(--op-teal-bg);
  color: var(--op-teal);
}

.op-def-card p {
  font-size: 13px !important;
  margin: 0 !important;
}

.op-def-card strong {
  color: var(--op-gray-800);
  font-size: 15px;
  display: block;
  margin-bottom: 2px;
}

/* === CONVERSION BOX === */

.op-conv-box {
  background: var(--op-navy);
  border-radius: var(--op-radius);
  padding: 20px 24px;
  color: #fff;
  margin: 16px 0 24px;
}

.op-conv-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.op-conv-row:last-child {
  margin-bottom: 0;
}

.op-conv-dir {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 5px;
  min-width: 56px;
  text-align: center;
}

.op-conv-dir--purple {
  background: rgba(124,92,252,0.25);
  color: #b8a4ff;
}

.op-conv-dir--teal {
  background: rgba(34,176,125,0.25);
  color: var(--op-teal-light);
}

.op-conv-expr {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  font-family: 'Courier New', monospace;
}

/* === FAQ STYLES === */

.op-faq {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

.op-faq__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--op-gray-800);
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.op-faq__badge {
  background: var(--op-teal-bg);
  color: var(--op-teal);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.op-faq-item {
  border: 1.5px solid var(--op-gray-200);
  border-radius: var(--op-radius);
  padding: 18px 20px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.op-faq-item:hover {
  border-color: var(--op-teal);
}

.op-faq-item__q {
  font-size: 15px;
  font-weight: 700;
  color: var(--op-gray-800);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.op-faq-item__q::after {
  content: '+';
  font-size: 20px;
  color: var(--op-teal);
  font-weight: 600;
  flex-shrink: 0;
  margin-left: 12px;
}

.op-faq-item.open .op-faq-item__q::after {
  content: '-';
}

.op-faq-item__a {
  font-size: 14px;
  color: var(--op-gray-600);
  line-height: 1.7;
  margin: 12px 0 0 0;
  padding: 12px 0 0 0;
  border-top: 1px solid var(--op-gray-200);
  display: none;
}

.op-faq-item.open .op-faq-item__a {
  display: block;
}

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

@media (max-width: 768px) {
  .op-tool-hero {
    padding: 28px 16px 48px;
  }

  .op-tool-hero__title {
    font-size: 24px;
  }

  .op-tool-card {
    padding: 20px;
  }

  .op-tool-fields,
  .op-tool-fields--3col {
    grid-template-columns: 1fr;
  }

  .op-tool-fraction-row {
    grid-template-columns: 1fr auto 1fr;
  }

  .op-tool-content {
    padding: 36px 16px;
  }

  .op-faq {
    padding: 0 16px 36px;
  }

  .op-breadcrumb {
    font-size: 11px;
  }

  .op-def-grid,
  .op-example-grid {
    grid-template-columns: 1fr;
  }
}
