/* =============================================================
   EvvyTools — Tool Page Styles
   Shared CSS for all tool pages. Loaded via tool-shell-top.php.
   ============================================================= */

/* ----- Tool Design Tokens ----- */
:root {
  --evvy-radius: 8px;
  --evvy-radius-lg: 12px;
  --evvy-radius-xl: 16px;
  --evvy-transition-fast: 0.15s ease;
  --evvy-transition-base: 0.25s ease;
  --evvy-transition-slow: 0.4s ease;
}

/* ----- Tool Page Header ----- */
.evvy-tool-header {
  background: var(--cluster-dark-bg, var(--bs-primary));
  color: #fff;
  padding: 1.25rem 0 2rem;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

/* Force ALL text white inside the dark hero — prevents global
   heading/body/link color rules from making text invisible. */
.evvy-tool-header,
.evvy-tool-header h1,
.evvy-tool-header p,
.evvy-tool-header a,
.evvy-tool-header span {
  color: #fff;
}

.evvy-tool-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.evvy-tool-header .tool-tagline {
  font-size: 1rem;
  opacity: 0.9;
  margin: 0;
}

/* Header inner layout: text + decorative graphic */
.evvy-tool-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.evvy-tool-header-text {
  flex: 1;
  min-width: 0;
}

.evvy-tool-header-graphic {
  flex-shrink: 0;
  margin-left: 2rem;
  opacity: 0.7;
}

/* Consistent page-width container (matches .evvy-tool-layout) */
.evvy-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Breadcrumb variant: light text on dark header bg */
.evvy-breadcrumb-light {
  padding: 0 0 0.25rem;
}

.evvy-tool-header .evvy-breadcrumb-light a {
  color: rgba(255, 255, 255, 0.8);
}

.evvy-tool-header .evvy-breadcrumb-light a:hover {
  color: #fff;
  text-decoration: underline;
}

.evvy-tool-header .evvy-breadcrumb-light .separator {
  color: rgba(255, 255, 255, 0.5);
}

.evvy-tool-header .evvy-breadcrumb-light .current {
  color: #fff;
}

/* ----- Breadcrumb ----- */
.evvy-breadcrumb {
  padding: 0.75rem 0;
  font-size: 0.8125rem;
}

.evvy-breadcrumb a {
  color: var(--evvy-text-secondary);
  text-decoration: none;
}

.evvy-breadcrumb a:hover {
  color: var(--cluster-dark, var(--bs-primary));
  text-decoration: underline;
}

.evvy-breadcrumb .separator {
  margin: 0 0.375rem;
  color: var(--evvy-text-secondary);
}

.evvy-breadcrumb .current {
  color: var(--evvy-text-primary);
  font-weight: 500;
}

/* ----- Tool Container (legacy, kept for non-tool pages) ----- */
.evvy-tool-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ----- Tool Layout (main content + sidebar) ----- */
.evvy-tool-layout {
  display: flex;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 0;
}

.evvy-tool-main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.evvy-tool-sidebar {
  flex-shrink: 0;
  width: 300px;
}

.evvy-tool-sidebar .evvy-ad-sidebar {
  position: sticky;
  top: 5rem;
}

/* ----- Ad Placements ----- */
.evvy-ad-unit {
  margin: 1rem 0;
}

.evvy-ad-leaderboard {
  text-align: center;
  max-width: 1200px;
  margin: 1rem auto 0;
  padding: 0.5rem 1rem 0;
}

.evvy-ad-midtool {
  margin: 2rem 0;
}

.evvy-ad-multiplex {
  margin: 2rem 0 1rem;
}

.evvy-ad-sidebar {
  margin: 0;
}

/* ----- Tool UI Card ----- */
.evvy-tool-ui {
  background: var(--evvy-surface);
  border: 1px solid var(--evvy-border);
  border-radius: var(--evvy-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ----- Tool Input Groups ----- */
.evvy-tool-ui .form-label {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
}

.evvy-tool-ui .form-text {
  font-size: 0.8125rem;
}

.evvy-tool-ui .input-group {
  margin-bottom: 0;
}

/* ----- Calculate / Action Button ----- */
.evvy-tool-btn {
  background: var(--cluster-dark, var(--bs-primary));
  color: #fff;
  border: none;
  border-radius: var(--evvy-radius);
  padding: 0.625rem 1.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.evvy-tool-btn:hover {
  opacity: 0.9;
  color: #fff;
}

.evvy-tool-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Dark mode — dark text on lightened cluster bg */
[data-bs-theme="dark"] .evvy-tool-btn {
  color: #1a1a2e;
}

[data-bs-theme="dark"] .evvy-tool-btn:hover {
  color: #1a1a2e;
}

/* ----- Result Card ----- */
.evvy-result {
  background: var(--cluster-surface, var(--evvy-surface));
  border: 2px solid var(--cluster-dark, var(--bs-primary));
  border-radius: var(--evvy-radius);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}

.evvy-result-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--evvy-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.evvy-result-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--cluster-dark, var(--bs-primary));
  line-height: 1.2;
}

.evvy-result-detail {
  font-size: 0.875rem;
  color: var(--evvy-text-secondary);
  margin-top: 0.25rem;
}

/* ----- Result Table ----- */
.evvy-result-table {
  width: 100%;
  font-size: 0.875rem;
  margin-top: 1rem;
}

.evvy-result-table th {
  font-weight: 600;
  color: var(--evvy-text-secondary);
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--evvy-border);
  text-align: left;
}

.evvy-result-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--evvy-border);
}

.evvy-result-table tr:last-child td {
  border-bottom: none;
}

/* ----- Tool Action Bar (share, export, save) ----- */
.evvy-tool-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--evvy-border);
}

.evvy-tool-actions .btn {
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
}

/* ----- Subscriber Badge / Lock ----- */
.evvy-premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--evvy-subscriber-color, #d4a017);
  background: rgba(212, 160, 23, 0.1);
  border-radius: 999px;
  padding: 0.125rem 0.5rem;
}

.evvy-premium-lock {
  position: relative;
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

.evvy-premium-lock::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--evvy-surface);
  opacity: 0.6;
  border-radius: var(--evvy-radius);
}

.evvy-premium-lock .evvy-premium-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
}

/* When user is subscriber, unlock premium sections */
body.is-subscriber .evvy-premium-lock {
  opacity: 1;
  pointer-events: auto;
  user-select: auto;
}

body.is-subscriber .evvy-premium-lock::after,
body.is-subscriber .evvy-premium-lock .evvy-premium-overlay {
  display: none;
}

/* ----- Related Tools Section ----- */
.evvy-related-tools {
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

.evvy-related-tools h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.evvy-related-tool-card {
  background: var(--evvy-surface);
  border: 1px solid var(--evvy-border);
  border-radius: var(--evvy-radius);
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--evvy-text-primary);
  display: block;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.evvy-related-tool-card:hover {
  border-color: var(--cluster-dark, var(--bs-primary));
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  color: var(--evvy-text-primary);
}

.evvy-related-tool-card h5 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.evvy-related-tool-card p {
  font-size: 0.8125rem;
  color: var(--evvy-text-secondary);
  margin: 0;
}

/* ----- Tool Intro (above tool UI) ----- */
.evvy-tool-intro {
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--evvy-text-secondary);
}

.evvy-tool-intro p {
  margin-bottom: 0.75rem;
}

.evvy-tool-intro p:last-child {
  margin-bottom: 0;
}

.evvy-tool-intro-tip {
  background: var(--cluster-surface, #EEF3F8);
  border-left: 3px solid var(--cluster-dark, var(--bs-primary));
  border-radius: 0 var(--evvy-radius) var(--evvy-radius) 0;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--evvy-text-primary);
}

.evvy-tool-intro-tip i {
  color: var(--cluster-dark, var(--bs-primary));
  margin-right: 0.25rem;
}

[data-bs-theme="dark"] .evvy-tool-intro-tip {
  background: rgba(255, 255, 255, 0.05);
}

/* ----- SEO Content Area ----- */
.evvy-tool-content {
  margin-top: 2rem;
  margin-bottom: 2rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--evvy-text-primary);
}

.evvy-tool-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.evvy-tool-content h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.evvy-tool-content p {
  margin-bottom: 1rem;
}

.evvy-tool-content ul,
.evvy-tool-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.evvy-tool-content li {
  margin-bottom: 0.375rem;
}

/* ----- Share URL Toast ----- */
.evvy-share-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: var(--evvy-text-primary);
  color: var(--evvy-surface);
  padding: 0.625rem 1.25rem;
  border-radius: var(--evvy-radius);
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 1050;
  pointer-events: none;
}

.evvy-share-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ----- Responsive ----- */
@media (max-width: 991.98px) {
  .evvy-tool-sidebar {
    display: none;
  }

  .evvy-tool-layout {
    display: block;
    padding: 1rem 1rem 0;
  }

  .evvy-tool-header-graphic {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .evvy-tool-header h1 {
    font-size: 1.375rem;
  }

  .evvy-tool-ui {
    padding: 1rem;
  }

  .evvy-result-value {
    font-size: 1.375rem;
  }

  .evvy-tool-actions {
    justify-content: center;
  }
}
