/* ============================================
   Thailand Property Transfer Tax Calculator
   Premium Design System - Complete Redesign
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
  /* Color Palette - Modern Financial */
  --primary: #2C3E50;
  --primary-dark: #1a252f;
  --primary-light: #34495e;
  --secondary: #E67E22;
  --secondary-dark: #d35400;
  --accent: #F39C12;
  --accent-light: #f5b041;
  --success: #27AE60;
  --success-light: #2ecc71;
  --error: #E74C3C;
  --warning: #F39C12;

  /* Neutrals */
  --white: #FFFFFF;
  --gray-50: #F8F9FA;
  --gray-100: #F1F3F5;
  --gray-200: #E9ECEF;
  --gray-300: #DEE2E6;
  --gray-400: #CED4DA;
  --gray-500: #ADB5BD;
  --gray-600: #6C757D;
  --gray-700: #495057;
  --gray-800: #343A40;
  --gray-900: #212529;

  /* Semantic */
  --background: #F8F9FA;
  --card-bg: #FFFFFF;
  --text-primary: #2C3E50;
  --text-secondary: #6C757D;
  --text-muted: #ADB5BD;
  --border-color: #E9ECEF;
  --border-hover: #CED4DA;

  /* Typography */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Font Sizes - Fluid */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.775rem + 0.2vw, 0.875rem);
  --text-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
  --text-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.125rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
  --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem);

  /* Font Weights */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Spacing Scale (8px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ============================================
   LAYOUT - CONTAINER
   ============================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-10);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-12);
  }
}

/* ============================================
   HEADER
   ============================================ */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  text-align: center;
  padding: var(--space-16) var(--space-6);
  position: relative;
  overflow: hidden;
}

/* Subtle decorative pattern */
.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(243, 156, 18, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(243, 156, 18, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

/* Subtle grid pattern */
.header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.logo-icon {
  font-size: 2.5rem;
  color: var(--accent);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  line-height: 1;
}

.logo h1 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tagline {
  font-size: var(--text-lg);
  font-weight: var(--weight-normal);
  opacity: 0.9;
  margin: 0;
  line-height: 1.5;
}

/* ============================================
   AD SPACES - Subtle & Professional
   ============================================ */
.ad-container {
  padding: var(--space-6) 0;
  background: transparent;
}

.ad-space {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  opacity: 0.6;
  transition: opacity var(--transition-base);
}

.ad-space:hover {
  opacity: 0.8;
}

.ad-space p {
  color: var(--gray-500);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ad-leaderboard {
  width: 100%;
  max-width: 728px;
  height: 90px;
}

.ad-rectangle {
  width: 300px;
  height: 250px;
}

.ad-rectangle-inline {
  width: 300px;
  height: 250px;
  margin: var(--space-12) auto;
}

/* Static Banner Ads */
.static-ad-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.static-ad-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.ad-space:has(.static-ad-link) {
  background: transparent;
  border: none;
  opacity: 1;
}

.ad-space:has(.static-ad-link):hover {
  opacity: 0.9;
}

/* AdSense ads - remove placeholder styling when code is injected */
.ad-space:has(ins.adsbygoogle),
.ad-space:has(script) {
  background: transparent;
  border: none;
  opacity: 1;
}


/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
  padding: var(--space-12) 0 var(--space-16);
}

.main-content > .container {
  position: relative;
}

.intro-text {
  text-align: center;
  max-width: 650px;
  margin: 0 auto var(--space-12);
}

.intro-text p {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================
   CALCULATOR DISCLAIMER
   ============================================ */
.calculator-disclaimer {
  max-width: 1000px;
  margin: 0 auto var(--space-8);
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.08) 0%, rgba(243, 156, 18, 0.04) 100%);
  border: 1px solid rgba(243, 156, 18, 0.25);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
}

.calculator-disclaimer p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.calculator-disclaimer strong {
  color: var(--secondary-dark);
}

@media (min-width: 1280px) {
  .calculator-disclaimer {
    max-width: 1100px;
  }
}

/* ============================================
   CALCULATOR LAYOUT
   ============================================ */
.calculator-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  max-width: 1000px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    align-items: start;
  }
}

@media (min-width: 1280px) {
  .calculator-wrapper {
    max-width: 1100px;
    gap: var(--space-10);
  }
}

/* ============================================
   CARD STYLES
   ============================================ */
.calculator-card,
.results-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
  border: 1px solid var(--border-color);
  transition: box-shadow var(--transition-base);
}

.calculator-card:hover,
.results-card:hover {
  box-shadow: var(--shadow-xl);
}

.calculator-card h2,
.results-card h2 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.calculator-card h2::before {
  content: '';
  display: block;
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--secondary) 100%);
  border-radius: var(--radius-full);
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-group {
  margin-bottom: var(--space-6);
}

.form-group:last-of-type {
  margin-bottom: 0;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

/* Tooltip Trigger */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--gray-200);
  color: var(--gray-600);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--weight-bold);
  cursor: help;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.tooltip-trigger:hover {
  background: var(--primary);
  color: var(--white);
  transform: scale(1.1);
}

/* Input Wrapper */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: var(--space-4);
  color: var(--gray-500);
  font-weight: var(--weight-semibold);
  font-size: var(--text-lg);
  pointer-events: none;
  z-index: 1;
}

/* Input Fields */
input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: var(--space-4) var(--space-4);
  padding-left: 2.75rem;
  font-size: var(--text-base);
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  appearance: none;
}

input[type="number"] {
  padding-left: var(--space-4);
}

input[type="text"]:hover,
input[type="number"]:hover,
select:hover {
  border-color: var(--border-hover);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(44, 62, 80, 0.1);
}

input::placeholder {
  color: var(--gray-400);
  font-weight: var(--weight-normal);
}

/* Select Wrapper */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--gray-500);
  pointer-events: none;
  transition: transform var(--transition-fast);
}

.select-wrapper:focus-within::after {
  transform: translateY(-50%) rotate(180deg);
}

select {
  padding-left: var(--space-4);
  padding-right: var(--space-10);
  cursor: pointer;
}

/* Helper & Error Text */
.helper-text {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: var(--space-2);
  line-height: 1.5;
}

.error-message {
  display: block;
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: var(--space-2);
  min-height: 1.25rem;
  font-weight: var(--weight-medium);
}

/* Calendar Section */
.calendar-section {
  margin-bottom: var(--space-6);
}

.calendars-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 600px) {
  .calendars-container {
    grid-template-columns: 1fr;
  }
}

.calendar-wrapper {
  display: flex;
  flex-direction: column;
}

.calendar-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.calendar {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}

.calendar-wrapper.error .calendar {
  border-color: var(--error);
}

.calendar-header {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.calendar-header select {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.calendar-header select:hover {
  border-color: var(--border-hover);
}

.calendar-header select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.1);
}

.calendar-month {
  flex: 1.5 !important;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-2);
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-day {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  font-size: var(--text-sm);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.calendar-day:hover:not(.empty):not(.disabled):not(.selected) {
  background: var(--gray-100);
}

.calendar-day.empty {
  cursor: default;
}

.calendar-day.today {
  font-weight: var(--weight-bold);
  color: var(--primary);
  background: rgba(44, 62, 80, 0.08);
}

.calendar-day.selected {
  background: var(--secondary);
  color: var(--white);
  font-weight: var(--weight-semibold);
}

.calendar-day.selected.today {
  background: var(--secondary);
  color: var(--white);
}

.calendar-day.disabled {
  color: var(--gray-300);
  cursor: not-allowed;
}

.selected-date {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: center;
}

.selected-date.has-date {
  background: linear-gradient(135deg, rgba(230, 126, 34, 0.1) 0%, rgba(230, 126, 34, 0.05) 100%);
  color: var(--secondary-dark);
  font-weight: var(--weight-medium);
}

/* Ownership Display Badge */
.ownership-display {
  margin-top: var(--space-4);
  margin-bottom: 0 !important;
  text-align: center;
}

.ownership-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.15) 0%, rgba(39, 174, 96, 0.05) 100%);
  border: 1px solid rgba(39, 174, 96, 0.3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.ownership-label {
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

.ownership-value {
  color: var(--success);
  font-weight: var(--weight-bold);
}

/* ============================================
   RADIO & CHECKBOX STYLES
   ============================================ */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 480px) {
  .radio-group {
    flex-direction: row;
  }
}

.radio-label,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  padding: var(--space-4);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  flex: 1;
}

.radio-label:hover,
.checkbox-label:hover {
  border-color: var(--primary);
  background: rgba(44, 62, 80, 0.02);
}

.radio-label input,
.checkbox-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-custom,
.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-400);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.radio-custom {
  border-radius: var(--radius-full);
}

.checkbox-custom {
  border-radius: var(--radius-sm);
}

/* Selected State */
.radio-label input:checked + .radio-custom,
.checkbox-label input:checked + .checkbox-custom {
  border-color: var(--primary);
  background: var(--primary);
}

.radio-label input:checked ~ span:last-child,
.checkbox-label input:checked ~ span:last-child {
  color: var(--primary);
  font-weight: var(--weight-semibold);
}

.radio-label:has(input:checked),
.checkbox-label:has(input:checked) {
  border-color: var(--primary);
  background: rgba(44, 62, 80, 0.04);
}

/* Check/Radio marks */
.radio-custom::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--white);
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition-fast);
}

.checkbox-custom::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  opacity: 0;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.radio-label input:checked + .radio-custom::after,
.checkbox-label input:checked + .checkbox-custom::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.radio-label input:checked + .radio-custom::after {
  transform: scale(1);
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.button-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

@media (min-width: 480px) {
  .button-group {
    flex-direction: row;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  font-family: var(--font-heading);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  min-height: 52px;
  text-decoration: none;
}

.btn-icon {
  font-size: 1.125rem;
  line-height: 1;
}

/* Primary Button - Gradient */
.btn-primary {
  flex: 2;
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(230, 126, 34, 0.35);
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 126, 34, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(230, 126, 34, 0.3);
}

/* Secondary Button */
.btn-secondary {
  flex: 1;
  background: var(--white);
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--gray-400);
  background: var(--gray-50);
  color: var(--text-primary);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

/* ============================================
   RESULTS SECTION
   ============================================ */
.results-section {
  display: block;
}

/* Results Placeholder - Shown Initially */
.results-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  min-height: 400px;
}

.placeholder-icon {
  color: var(--primary);
  margin-bottom: var(--space-6);
  opacity: 0.6;
}

.placeholder-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.placeholder-text {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 300px;
  line-height: 1.6;
  margin-bottom: var(--space-8);
}

.placeholder-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-start;
}

.placeholder-feature {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.feature-icon {
  font-size: var(--text-base);
  opacity: 0.7;
}

/* Loading State */
.results-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  min-height: 400px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--space-6);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.results-loading p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

/* Results Content - Hidden Initially */
.results-content {
  display: none;
}

.results-content.active {
  display: block;
  animation: fadeInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-content h2 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.results-content h2::before {
  content: '';
  display: block;
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--success) 0%, var(--success-light) 100%);
  border-radius: var(--radius-full);
}

.results-block {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--gray-100);
}

.results-block:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.results-block h3 {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tax-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: var(--space-4);
  margin-top: calc(var(--space-4) * -1);
}

/* Summary Grid */
.summary-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border-left: 4px solid var(--primary);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

.summary-item.highlight {
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.1) 0%, rgba(243, 156, 18, 0.05) 100%);
  border: 1px solid rgba(243, 156, 18, 0.3);
  margin-top: var(--space-2);
}

.summary-label {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.summary-value {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: 'Inter', monospace;
}

.summary-item.highlight .summary-value {
  color: var(--secondary);
  font-weight: var(--weight-bold);
}

/* Tax Breakdown Table */
.table-responsive {
  overflow-x: auto;
  margin: 0 calc(var(--space-4) * -1);
  padding: 0 var(--space-4);
}

.tax-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}

.tax-table thead th {
  background: var(--primary);
  color: var(--white);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.tax-table thead th:first-child {
  border-radius: var(--radius-md) 0 0 0;
}

.tax-table thead th:last-child {
  border-radius: 0 var(--radius-md) 0 0;
}

.tax-table tbody tr {
  transition: background var(--transition-fast);
}

.tax-table tbody tr:nth-child(even) {
  background: var(--gray-50);
}

.tax-table tbody tr:hover {
  background: rgba(44, 62, 80, 0.04);
}

.tax-table tbody td {
  padding: var(--space-4);
  color: var(--text-primary);
  border-bottom: 1px solid var(--gray-100);
}

.tax-table .amount {
  font-weight: var(--weight-semibold);
  font-family: 'Inter', monospace;
  color: var(--text-primary);
}

.tax-table .amount.waived {
  color: var(--gray-400);
  font-style: italic;
  font-weight: var(--weight-normal);
}

.tax-table .amount.exempt {
  color: var(--success);
}

/* Total Row */
.tax-table tfoot tr {
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.12) 0%, rgba(230, 126, 34, 0.08) 100%);
}

.tax-table tfoot td {
  padding: var(--space-4);
  font-weight: var(--weight-bold);
  border-bottom: none;
}

.tax-table tfoot td:first-child {
  border-radius: 0 0 0 var(--radius-md);
}

.tax-table tfoot td:last-child {
  border-radius: 0 0 var(--radius-md) 0;
}

.tax-table .amount.total {
  color: var(--secondary);
  font-size: var(--text-lg);
}

/* Withholding Tax Breakdown */
.tax-table tr.sub-row {
  background: var(--gray-50);
}

.tax-table tr.sub-row:hover {
  background: var(--gray-50);
}

.withholding-breakdown {
  padding: var(--space-4);
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--secondary);
}

.breakdown-title {
  font-weight: var(--weight-semibold);
  color: var(--primary);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.breakdown-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  padding: var(--space-1) 0;
  border-bottom: 1px dashed var(--gray-200);
}

.breakdown-item:last-child {
  border-bottom: none;
}

.breakdown-item span:first-child {
  color: var(--text-secondary);
}

.breakdown-item span:last-child {
  font-family: 'Inter', monospace;
  font-weight: var(--weight-medium);
  color: var(--primary);
}

.breakdown-item.total {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 2px solid var(--gray-300);
  border-bottom: none;
}

.breakdown-item.total span:first-child {
  font-weight: var(--weight-semibold);
  color: var(--primary);
}

.breakdown-item.total span:last-child {
  font-weight: var(--weight-bold);
  color: var(--secondary);
  font-size: var(--text-base);
}

/* Cost Cards */
.cost-cards {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 480px) {
  .cost-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.cost-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  transition: transform var(--transition-base);
}

.cost-card:hover {
  transform: translateY(-2px);
}

.cost-card.seller {
  background: linear-gradient(135deg, #FDEDEA 0%, #FCEAE6 100%);
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.cost-card.buyer {
  background: linear-gradient(135deg, #E8F8F0 0%, #E3F6EB 100%);
  border: 1px solid rgba(39, 174, 96, 0.2);
}

.cost-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.cost-details {
  flex: 1;
  min-width: 0;
}

.cost-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.cost-value {
  display: block;
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  font-family: 'Inter', monospace;
  line-height: 1.2;
}

.cost-note {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Print Section */
.print-section {
  text-align: center;
  padding-top: var(--space-6);
  border-top: 1px solid var(--gray-100);
  margin-top: var(--space-6);
}

/* ============================================
   INFORMATION SECTION
   ============================================ */
.info-section {
  background: var(--white);
  padding: var(--space-20) 0;
}

.info-section h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-12);
  letter-spacing: -0.02em;
}

/* Info Grid */
.info-grid {
  display: grid;
  gap: var(--space-6);
  margin-bottom: var(--space-20);
}

@media (min-width: 768px) {
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .info-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.info-card {
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  transition: all var(--transition-slow);
  text-align: left;
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}

.info-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.25);
}

.info-card h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.info-card p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.7;
}

/* Tax Details Section */
.tax-details {
  margin-bottom: var(--space-20);
}

.tax-accordion {
  max-width: 800px;
  margin: 0 auto;
}

.accordion-item {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
  transition: all var(--transition-base);
}

.accordion-item:hover {
  border-color: var(--primary);
}

.accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-5) var(--space-6);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast);
  text-align: left;
}

.accordion-header:hover {
  background: var(--gray-50);
}

.accordion-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.accordion-icon {
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: var(--weight-bold);
  transition: transform var(--transition-base);
  line-height: 1;
}

.accordion-header[aria-expanded="true"] .accordion-icon {
  transform: rotate(45deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.accordion-content p {
  padding: 0 var(--space-6) var(--space-6);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.8;
}

.accordion-content ol,
.accordion-content ul {
  padding: 0 var(--space-6) var(--space-6);
  padding-left: calc(var(--space-6) + 20px);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.8;
  margin: 0;
}

.accordion-content li {
  margin-bottom: var(--space-2);
}

.accordion-content li:last-child {
  margin-bottom: 0;
}

.accordion-item.active .accordion-content {
  max-height: 400px;
}

.accordion-item.active {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* FAQ Section */
.faq-section {
  margin-bottom: var(--space-20);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  padding: var(--space-6);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
  transition: all var(--transition-base);
}

.faq-item:hover {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.faq-question {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.faq-question::before {
  content: 'Q';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}

.faq-answer {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.8;
  padding-left: calc(24px + var(--space-3));
}

/* Notes Section */
.notes-section {
  background: linear-gradient(135deg, rgba(44, 62, 80, 0.04) 0%, rgba(44, 62, 80, 0.02) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  border: 1px solid var(--border-color);
}

.notes-section h2 {
  margin-bottom: var(--space-6);
  text-align: left;
  font-size: var(--text-xl);
}

.notes-list {
  list-style: none;
  max-width: 800px;
}

.notes-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.7;
}

.note-icon {
  color: var(--primary);
  font-size: var(--text-base);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.9);
  padding: var(--space-12) 0 var(--space-8);
}

.footer-content {
  text-align: center;
}

.footer-main {
  margin-bottom: var(--space-8);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-semibold);
  color: var(--white);
  margin-bottom: var(--space-4);
  font-size: var(--text-base);
}

.footer-brand .logo-icon {
  font-size: 1.25rem;
  color: var(--accent);
}

.footer-disclaimer {
  font-size: var(--text-xs);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.6);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copyright {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   TOOLTIPS
   ============================================ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  visibility: hidden;
  opacity: 0;
  transition: all var(--transition-fast);
  z-index: 100;
  pointer-events: none;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: var(--space-3) var(--space-4);
  background: var(--gray-800);
  color: var(--white);
  font-size: var(--text-xs);
  font-weight: var(--weight-normal);
  line-height: 1.5;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
}

[data-tooltip]::after {
  content: '';
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border: 6px solid transparent;
  border-top-color: var(--gray-800);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  body {
    background: white;
    font-size: 12pt;
    color: black;
  }

  .header {
    background: none !important;
    color: black;
    padding: 24pt 0;
  }

  .logo-icon {
    color: black;
  }

  .ad-container,
  .info-section,
  .footer,
  .calculator-section,
  .print-section,
  .btn,
  .intro-text {
    display: none !important;
  }

  .main-content {
    padding: 0;
  }

  .calculator-wrapper {
    display: block;
    max-width: none;
  }

  .results-section {
    display: block !important;
  }

  .results-card {
    box-shadow: none;
    border: 1px solid #ccc;
    padding: 24pt;
  }

  .tax-table thead th {
    background: #f0f0f0 !important;
    color: black !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .tax-table tfoot tr {
    background: #f5f5f5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cost-card {
    background: #f5f5f5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   MOBILE SPECIFIC (< 768px)
   ============================================ */
@media (max-width: 767px) {
  .header {
    padding: var(--space-10) var(--space-4);
  }

  .logo {
    flex-direction: column;
    gap: var(--space-2);
  }

  .logo h1 {
    font-size: var(--text-xl);
    text-align: center;
  }

  .tagline {
    font-size: var(--text-base);
  }

  .calculator-card,
  .results-card {
    padding: var(--space-6);
    border-radius: var(--radius-lg);
  }

  .calculator-card h2,
  .results-card h2 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-6);
  }

  .tax-table {
    font-size: var(--text-xs);
  }

  .tax-table th,
  .tax-table td {
    padding: var(--space-3);
  }

  .cost-value {
    font-size: var(--text-lg);
  }

  .ad-leaderboard {
    max-width: 320px;
    height: 50px;
  }

  .info-section {
    padding: var(--space-12) 0;
  }

  .info-card {
    padding: var(--space-6);
  }

  .notes-section {
    padding: var(--space-6);
  }

  .faq-item {
    padding: var(--space-5);
  }

  .accordion-header {
    padding: var(--space-4);
  }

  .accordion-content p {
    padding: 0 var(--space-4) var(--space-4);
  }
}
