/* Percentage Calculator Stylesheet - Calculator Archive
   Faithful clone of clean Calculator.net layout + modern responsive interactive features */

:root {
  --pc-green: #38761d;
  --pc-green-hover: #2d6117;
  --pc-gray-btn: #8e9ca8;
  --pc-gray-btn-hover: #788591;
  --pc-box-bg: #f4f6f9;
  --pc-box-border: #d4dde6;
  --pc-input-border: #7f9db9;
  --pc-blue-header: #2b5a88;
  --pc-blue-link: #0044aa;
  --pc-blue-hover: #002277;
  --pc-result-bg: #eef7ed;
  --pc-result-border: #c3e6cb;
  --pc-result-text: #1e561f;
  --pc-font: Arial, Helvetica, sans-serif;
}

/* Page Layout */
.pc-page-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 12px 16px 48px;
  font-family: var(--pc-font);
  color: #333333;
}

/* Top Utility & Breadcrumb Bar */
.pc-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

.pc-breadcrumbs {
  font-size: 13px;
  color: #666;
}

.pc-breadcrumbs a {
  color: var(--pc-blue-link);
  text-decoration: none;
}

.pc-breadcrumbs a:hover {
  text-decoration: underline;
}

.pc-breadcrumbs .sep {
  margin: 0 4px;
  color: #999;
}

.pc-breadcrumbs .current {
  color: #333;
  font-weight: 500;
}

.pc-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pc-action-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.pc-action-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.pc-print-link {
  color: var(--pc-blue-link);
  background: none;
  border: none;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 6px;
}

.pc-print-link:hover {
  color: var(--pc-blue-hover);
}

/* Page Title */
.pc-page-title {
  font-size: 24px;
  font-weight: bold;
  color: #1a365d;
  margin: 0 0 16px;
}

/* 2-Column Main Layout */
.pc-main-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 860px) {
  .pc-main-layout {
    grid-template-columns: 1fr;
  }
}

/* Content Left Column */
.pc-content-col {
  min-width: 0;
}

/* Sub-Heading / Instruction */
.pc-section-title {
  font-size: 17px;
  font-weight: bold;
  color: #1a365d;
  margin: 22px 0 8px;
}

.pc-section-title:first-of-type {
  margin-top: 0;
}

.pc-instruction {
  font-size: 13px;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Form Card Panels - Matches Image 1 */
.pc-card {
  background-color: var(--pc-box-bg);
  border: 1px solid var(--pc-box-border);
  padding: 14px 18px;
  margin-bottom: 22px;
  border-radius: 2px;
}

/* Inline Form Row */
.pc-inline-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 12px;
}

.pc-input {
  padding: 5px 8px;
  font-size: 14px;
  border: 1px solid var(--pc-input-border);
  background-color: #ffffff;
  border-radius: 2px;
  color: #111;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pc-input:focus {
  outline: none;
  border-color: #2b5a88;
  box-shadow: 0 0 0 2px rgba(43, 90, 136, 0.15);
}

.pc-input-pct {
  width: 70px;
  text-align: right;
}

.pc-input-val {
  width: 95px;
  text-align: right;
}

.pc-input-res {
  width: 95px;
  text-align: right;
}

.pc-select {
  padding: 5px 8px;
  font-size: 14px;
  border: 1px solid var(--pc-input-border);
  background-color: #ffffff;
  border-radius: 2px;
  color: #111;
  cursor: pointer;
}

/* Button Row */
.pc-btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

/* Primary Green Calculate Button with Play Arrow */
.pc-btn-calc {
  background-color: var(--pc-green);
  color: #ffffff;
  border: 1px solid #285614;
  border-radius: 3px;
  padding: 6px 14px 6px 12px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: background-color 0.15s ease;
}

.pc-btn-calc:hover {
  background-color: var(--pc-green-hover);
}

.pc-play-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: #ffffff;
  color: var(--pc-green);
  border-radius: 50%;
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  font-weight: bold;
  padding-left: 1px;
}

/* Secondary Gray Clear Button */
.pc-btn-clear {
  background-color: var(--pc-gray-btn);
  color: #ffffff;
  border: 1px solid #6c7984;
  border-radius: 3px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
  transition: background-color 0.15s ease;
}

.pc-btn-clear:hover {
  background-color: var(--pc-gray-btn-hover);
}

/* Result Box */
.pc-result-banner {
  margin-top: 14px;
  padding: 10px 14px;
  background-color: var(--pc-result-bg);
  border: 1px solid var(--pc-result-border);
  border-radius: 3px;
  color: var(--pc-result-text);
  font-size: 14px;
  display: none;
  animation: pcFadeIn 0.25s ease;
}

.pc-result-banner.active {
  display: block;
}

.pc-result-headline {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}

.pc-result-steps {
  font-size: 13px;
  color: #333;
  margin-top: 6px;
  line-height: 1.5;
  border-top: 1px dashed #c0d8bf;
  padding-top: 6px;
}

.pc-result-steps strong {
  color: #1e561f;
}

/* Common Phrases Card Layout */
.pc-phrase-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed #d5dee6;
  font-size: 14px;
}

.pc-phrase-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pc-phrase-row:first-child {
  padding-top: 0;
}

.pc-phrase-row .pc-btn-calc {
  margin-left: auto;
}

.pc-phrase-result-tag {
  background: #eef7ed;
  border: 1px solid #c3e6cb;
  color: #1e561f;
  padding: 3px 8px;
  border-radius: 3px;
  font-weight: bold;
  font-size: 13px;
  display: inline-block;
  margin-left: 6px;
}

/* Percentage Difference Form */
.pc-diff-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
}

.pc-diff-form-row label {
  width: 65px;
  color: #333;
}

/* Interactive Charts Section */
.pc-charts-card {
  background: #ffffff;
  border: 1px solid #d4dde6;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.pc-charts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 8px;
}

.pc-charts-title {
  font-size: 15px;
  font-weight: bold;
  color: #1a365d;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pc-chart-tabs {
  display: flex;
  gap: 6px;
}

.pc-chart-tab {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #475569;
}

.pc-chart-tab.active {
  background: #2b5a88;
  color: #ffffff;
  border-color: #2b5a88;
}

.pc-chart-canvas-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 10px 0;
}

.pc-chart-legend {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pc-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pc-legend-color {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  display: inline-block;
}

/* Right Sidebar Column */
.pc-sidebar-col {
  width: 100%;
}

/* Search Box in Sidebar */
.pc-search-form {
  display: flex;
  margin-bottom: 16px;
  position: relative;
}

.pc-search-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  border-right: none;
  border-radius: 2px 0 0 2px;
  outline: none;
}

.pc-search-btn {
  background-color: var(--pc-blue-header);
  color: #ffffff;
  border: 1px solid var(--pc-blue-header);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 0 2px 2px 0;
  cursor: pointer;
}

.pc-search-btn:hover {
  background-color: #204569;
}

.pc-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  border-radius: 0 0 4px 4px;
}

.pc-search-dropdown.active {
  display: block;
}

.pc-search-item {
  padding: 7px 10px;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pc-search-item:hover {
  background-color: #f1f5f9;
}

.pc-search-cat {
  font-size: 11px;
  color: #64748b;
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 2px;
}

/* Sidebar Math Calculators Card */
.pc-side-card {
  border: 1px solid #b8c9db;
  border-radius: 3px;
  overflow: hidden;
  background: #ffffff;
  margin-bottom: 20px;
}

.pc-side-card-title {
  background-color: var(--pc-blue-header);
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  padding: 7px 12px;
}

.pc-side-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 10px 12px;
  gap: 8px 12px;
  font-size: 13px;
  background-color: #ffffff;
}

.pc-side-card-grid a {
  color: var(--pc-blue-link);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-side-card-grid a:hover {
  text-decoration: underline;
}

.pc-side-card-grid a.active {
  font-weight: bold;
  color: #000000;
}

.pc-side-card-more {
  padding: 6px 12px 10px;
  font-size: 13px;
  border-top: 1px solid #f0f4f8;
}

.pc-side-card-more a {
  color: var(--pc-blue-link);
  text-decoration: none;
}

.pc-side-card-more a:hover {
  text-decoration: underline;
}

.pc-side-card-footer {
  background-color: #f8fafc;
  padding: 8px 12px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.pc-side-card-footer a {
  color: var(--pc-blue-link);
  text-decoration: none;
}

.pc-side-card-footer a:hover {
  text-decoration: underline;
}

.pc-side-card-footer .sep {
  color: #94a3b8;
}

/* Saved Drawer Modal */
.pc-saved-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pc-saved-modal-backdrop.active {
  display: flex;
}

.pc-saved-modal {
  background: #ffffff;
  border-radius: 6px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.pc-saved-modal-header {
  background: var(--pc-blue-header);
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pc-saved-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
}

.pc-saved-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.pc-saved-list {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
}

.pc-saved-empty {
  text-align: center;
  color: #64748b;
  padding: 28px 0;
  font-size: 14px;
}

.pc-saved-item {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.pc-saved-item-info {
  font-size: 13px;
}

.pc-saved-item-title {
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 2px;
}

.pc-saved-item-time {
  font-size: 11px;
  color: #64748b;
}

.pc-saved-item-actions {
  display: flex;
  gap: 8px;
}

.pc-saved-load-btn {
  background: #2b5a88;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.pc-saved-del-btn {
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

/* Comprehensive SEO / AEO / GEO Section Styling */
.calc-seo-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid #dcdcdc;
  line-height: 1.65;
  font-size: 14px;
  color: #2d3748;
}

.calc-seo-section h2 {
  font-size: 20px;
  font-weight: bold;
  color: #1a365d;
  margin: 0 0 14px;
  line-height: 1.3;
}

.calc-seo-section h3 {
  font-size: 16px;
  font-weight: bold;
  color: #2c5282;
  margin: 20px 0 10px;
}

.calc-seo-section p {
  margin-bottom: 14px;
  text-align: justify;
}

.calc-seo-section ul {
  margin: 0 0 16px 20px;
}

.calc-seo-section li {
  margin-bottom: 6px;
}

.seo-formula-box {
  background-color: #f7fafc;
  border-left: 4px solid #3182ce;
  padding: 12px 16px;
  margin: 16px 0;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 13px;
  color: #2d3748;
  border-radius: 0 4px 4px 0;
  line-height: 1.6;
}

.seo-aeo-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px 16px;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.seo-aeo-card h4, .seo-aeo-card .aeo-q {
  font-size: 15px;
  font-weight: bold;
  color: #2b6cb0;
  margin: 0 0 8px;
}

.seo-aeo-card p, .seo-aeo-card .aeo-a {
  margin: 0;
  font-size: 13.5px;
  color: #4a5568;
}

.geo-insight-box {
  background-color: #fffaf0;
  border: 1px solid #feebc8;
  border-left: 4px solid #dd6b20;
  border-radius: 4px;
  padding: 14px 16px;
  margin: 18px 0;
}

.geo-insight-box h4, .geo-insight-box .geo-title {
  font-size: 15px;
  font-weight: bold;
  color: #c05621;
  margin: 0 0 8px;
}

.seo-table-wrap {
  overflow-x: auto;
  margin: 18px 0;
}

.seo-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.seo-summary-table th {
  background-color: #ebf4ff;
  color: #2c5282;
  font-weight: bold;
  padding: 8px 12px;
  border: 1px solid #cbd5e0;
  text-align: left;
}

.seo-summary-table td {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
}

.seo-summary-table tr:nth-child(even) {
  background-color: #f7fafc;
}

/* Animation */
@keyframes pcFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* RTL Support for Arabic */
[dir="rtl"] .pc-top-bar {
  direction: rtl;
}

[dir="rtl"] .pc-phrase-row .pc-btn-calc {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .pc-search-btn {
  border-radius: 2px 0 0 2px;
  border-left: 1px solid var(--pc-blue-header);
  border-right: none;
}

[dir="rtl"] .pc-search-input {
  border-radius: 0 2px 2px 0;
  border-left: none;
  border-right: 1px solid #7f9db9;
}

[dir="rtl"] .seo-formula-box {
  border-left: none;
  border-right: 4px solid #3182ce;
  border-radius: 4px 0 0 4px;
}

[dir="rtl"] .geo-insight-box {
  border-left: 1px solid #feebc8;
  border-right: 4px solid #dd6b20;
}

[dir="rtl"] .calc-seo-section ul {
  margin: 0 20px 16px 0;
}

/* Printable Report Modal */
.pc-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.pc-modal-card {
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.pc-modal-header {
  background-color: #003366;
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pc-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: bold;
  color: #ffffff;
}

.pc-modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.pc-modal-close:hover {
  opacity: 0.8;
}

.pc-modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
  background: #ffffff;
}

.pc-modal-footer {
  background-color: #f8fafc;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

/* Toast Notification */
.pc-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #1e293b;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pc-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Print Stylesheet */
@media print {
  /* When printing from the modal */
  body.pc-printing-modal .site-header,
  body.pc-printing-modal .site-footer,
  body.pc-printing-modal .pc-page-header,
  body.pc-printing-modal .pc-top-actions,
  body.pc-printing-modal .pc-page-title,
  body.pc-printing-modal .pc-main-layout,
  body.pc-printing-modal .calc-seo-section,
  body.pc-printing-modal .pc-saved-modal-backdrop,
  body.pc-printing-modal .pc-toast,
  body.pc-printing-modal .pc-modal-header,
  body.pc-printing-modal .pc-modal-footer {
    display: none !important;
  }

  body.pc-printing-modal {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.pc-printing-modal #pc-print-modal {
    display: block !important;
    position: static !important;
    background: transparent !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.pc-printing-modal .pc-modal-card {
    max-width: 100% !important;
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.pc-printing-modal .pc-modal-body {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  /* Default page print */
  .site-header,
  .site-footer,
  .pc-top-actions,
  .pc-sidebar-col,
  .pc-btn-calc,
  .pc-btn-clear,
  .pc-action-btn,
  .pc-print-link,
  .pc-saved-modal-backdrop,
  .pc-toast,
  .pc-chart-tabs {
    display: none !important;
  }

  .pc-main-layout {
    display: block !important;
  }

  .pc-page-container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .pc-card {
    border: 1px solid #999 !important;
    background: #fff !important;
    page-break-inside: avoid;
  }

  .pc-result-banner {
    display: block !important;
    border: 1px solid #333 !important;
    background: #f9f9f9 !important;
    color: #000 !important;
  }

  .calc-seo-section {
    page-break-before: always;
  }
}
