/* Scoped styles for the Illetékkalkulátor overlay */

/* The overlay itself should be transparent so backdrop blur shows through */
#overlay-illetekkalkulator.offcanvas {
  background: transparent !important;
}

/* Offcanvas body transparent so blur shows through */
#overlay-illetekkalkulator .offcanvas-body {
  overflow-y: auto;
  background: transparent !important;
  contain: paint;
  -webkit-overflow-scrolling: touch;
}

/* Calculator card - frosted glass effect */
#overlay-illetekkalkulator .illetek-card {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255,255,255,0.3) inset;
  padding: 2rem;
  max-width: 580px;
  margin: 0 auto;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* When this overlay is shown, keep main page content visible but non-interactive for blur effect */
body:has(#overlay-illetekkalkulator.show) main,
body:has(#overlay-illetekkalkulator.show) > section:not(.offcanvas),
body:has(#overlay-illetekkalkulator.show) .scroll-contact,
body:has(#overlay-illetekkalkulator.showing) main,
body:has(#overlay-illetekkalkulator.showing) > section:not(.offcanvas),
body:has(#overlay-illetekkalkulator.showing) .scroll-contact {
  pointer-events: none !important;
}

/* Calculator type tabs */
.illetek-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 0.75rem;
  padding: 0.25rem;
}

.illetek-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.illetek-tab:hover {
  color: #334155;
}

.illetek-tab.active {
  background: #fff;
  color: var(--hero-blue, #173d6b);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.illetek-tab svg {
  display: none;
}

@media (min-width: 480px) {
  .illetek-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }
  .illetek-tab svg {
    display: inline-block;
  }
}

/* Tab content panels */
.illetek-tab-content {
  display: none;
}

.illetek-tab-content.active {
  display: block;
}

/* Calculator panels */
.illetek-panel {
  display: none;
}

.illetek-panel.active {
  display: block;
}

/* Header styling */
.illetek-header {
  text-align: center;
  margin-bottom: 2rem;
}

.illetek-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--hero-blue, #173d6b);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  font-family: "Cormorant Unicase", serif;
}

.illetek-header p {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0;
}

/* Input styling */
.illetek-input-group {
  margin-bottom: 1.5rem;
}

.illetek-input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.illetek-input-group label .input-hint {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: #64748b;
  text-transform: none;
  letter-spacing: normal;
  margin-top: 0.25rem;
}

.illetek-input-group label .slider-value {
  float: right;
  font-weight: 500;
  color: var(--hero-blue, #173d6b);
}

/* Range slider styling */
.illetek-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  outline: none;
  margin: 0.75rem 0;
}

.illetek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--hero-blue, #173d6b);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.illetek-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.illetek-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--hero-blue, #173d6b);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* Slider tick marks container */
.slider-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 12px; /* Half of thumb width to align ticks with positions */
  margin-top: -4px;
  margin-bottom: 0.25rem;
}

.slider-tick {
  width: 2px;
  height: 8px;
  background: rgba(148, 163, 184, 0.5);
  border-radius: 1px;
}

.slider-tick:first-child,
.slider-tick:last-child {
  height: 10px;
  background: rgba(148, 163, 184, 0.7);
}

.illetek-input {
  font-size: 1.5rem !important;
  font-weight: 600;
  text-align: center;
  padding: 1rem !important;
  border: 2px solid #e2e8f0 !important;
  border-radius: 0.75rem !important;
  transition: all 0.2s ease;
}

.illetek-input:focus {
  border-color: var(--hero-blue, #173d6b) !important;
  box-shadow: 0 0 0 4px rgba(23, 61, 107, 0.1) !important;
}

.illetek-input::placeholder {
  font-weight: 400;
  color: #94a3b8;
}

/* Fraction input wrapper for ownership share */
.fraction-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.fraction-input {
  width: 80px !important;
  flex: 0 0 auto;
}

.fraction-separator {
  font-size: 1.5rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1;
}

/* Procedure type selector */
.illetek-types {
  margin-bottom: 1.5rem;
}

.illetek-types label.section-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.illetek-type-option {
  display: flex;
  align-items: flex-start;
  padding: 0.875rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}

.illetek-type-option:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.illetek-type-option.selected {
  border-color: var(--hero-blue, #173d6b);
  background: rgba(23, 61, 107, 0.05);
}

.illetek-type-option input[type="radio"] {
  margin-top: 0.25rem;
  margin-right: 0.75rem;
  accent-color: var(--hero-blue, #173d6b);
}

.illetek-type-option .option-content {
  flex: 1;
}

.illetek-type-option .option-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.95rem;
  margin-bottom: 0.125rem;
}

.illetek-type-option .option-desc {
  font-size: 0.8rem;
  color: #64748b;
}

/* Calculate button */
.illetek-submit {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 0.75rem;
  background: var(--hero-blue, #173d6b);
  border: none;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.illetek-submit:hover {
  background: #0f2d4d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(23, 61, 107, 0.3);
}

/* Result display */
#illetek-result {
  animation: illetek-fade-in 0.3s ease-out;
}

.illetek-result-card {
  background: linear-gradient(135deg, var(--hero-blue, #173d6b) 0%, #1e4a7a 100%);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  margin-top: 1.5rem;
}

.illetek-result-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

.illetek-result-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.5rem;
}

.illetek-result-type {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  color: #fff;
  margin-bottom: 0.75rem;
}

.illetek-result-explanation {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

/* Secondary result card (smaller) */
.illetek-result-secondary {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  margin-top: 0.75rem;
}

.illetek-result-secondary .illetek-result-amount {
  font-size: 1.75rem;
}

/* Vagyonszerzési result also gets animation */
#vagyonszerzes-result {
  animation: illetek-fade-in 0.3s ease-out;
}

/* Info section - collapsible */
.illetek-info {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.illetek-info summary {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.illetek-info summary::-webkit-details-marker {
  display: none;
}

.illetek-info summary::before {
  content: "▶";
  font-size: 0.65rem;
  transition: transform 0.2s ease;
}

.illetek-info[open] summary::before {
  transform: rotate(90deg);
}

.illetek-info-content {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  color: #64748b;
}

.illetek-info-content ul {
  margin: 0.5rem 0 0 0;
  padding-left: 1rem;
}

.illetek-info-content li {
  margin-bottom: 0.25rem;
}

/* Disclaimer */
.illetek-disclaimer {
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

/* Close button styling for glass background */
#overlay-illetekkalkulator .offcanvas-close {
  filter: invert(1);
}

#overlay-illetekkalkulator .offcanvas-back {
  color: #fff;
}

@keyframes illetek-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (max-width: 575.98px) {
  .illetek-card {
    padding: 1.5rem;
    border-radius: 1rem;
    margin: 0 -0.5rem;
  }
  
  .illetek-input {
    font-size: 1.25rem !important;
  }
  
  .illetek-result-amount {
    font-size: 2rem;
  }
}
