/* ========================================
   ToolsCrow Calculators - Global Styles
   ======================================== */

/* CSS Variables for theming */
:root {
  --primary: #274c77;
  --primary-light: #4a6fa5;
  --primary-dark: #1a365d;
  --secondary: #f4a261;
  --accent: #e76f51;
  --success: #2a9d8f;
  --warning: #e9c46a;
  --danger: #e63946;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --bg-sidebar: #f1f5f9;
  
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Base Styles
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ========================================
   Calculator Page Layout
   ======================================== */
.calculator-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
}

.calculator-container {
  display: flex;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 20px;
  gap: 24px;
}

/* Main content area */
.calculator-main {
  flex: 1;
  min-width: 0;
}

/* Sidebar */
.calculator-sidebar {
  width: 320px;
  flex-shrink: 0;
}

.sidebar-content {
  background: var(--bg-sidebar);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border-color);
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 8px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--primary);
  color: white;
}

.sidebar-nav i {
  width: 20px;
  text-align: center;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  width: 100%;
  padding: 12px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 16px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ========================================
   Calculator Card
   ======================================== */
.calc-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 24px;
}

.calc-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 28px 32px;
}

.calc-header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.2;
}

.calc-header p {
  font-size: 1rem;
  opacity: 0.9;
  max-width: 600px;
}

.calc-body {
  padding: 32px;
}

/* ========================================
   Form Elements
   ======================================== */
.form-group {
  margin-bottom: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

label .required {
  color: var(--danger);
  margin-left: 4px;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 400;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
  font-family: var(--font-sans);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(39, 76, 119, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:disabled,
select:disabled {
  background: var(--bg-secondary);
  cursor: not-allowed;
  opacity: 0.7;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 44px;
}

/* Input with icon */
.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.input-icon-wrapper input,
.input-icon-wrapper select {
  padding-left: 48px;
}

.input-prefix,
.input-suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 500;
}

.input-prefix {
  left: 16px;
}

.input-suffix {
  right: 16px;
}

.input-prefix + input {
  padding-left: 44px;
}

.input-suffix + input {
  padding-right: 44px;
}

/* Checkbox and Radio */
.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-inline,
.radio-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.checkbox-inline:hover,
.radio-inline:hover {
  background: var(--bg-secondary);
}

input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-inline label,
.radio-inline label {
  margin: 0;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
}

/* Toggle switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  width: 50px;
  height: 26px;
  background: var(--border-color);
  border-radius: 13px;
  position: relative;
  transition: var(--transition);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::after {
  left: 26px;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
  text-decoration: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(39, 76, 119, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(39, 76, 119, 0.4);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border-color);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #21867a 100%);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #c1121f 100%);
  color: white;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.btn-block {
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ========================================
   Results Section
   ======================================== */
.results-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 2px dashed var(--border-color);
}

.results-section.hidden {
  display: none;
}

.results-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-title i {
  color: var(--success);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.result-card {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
}

.result-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.result-card.highlight {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-color: var(--primary);
}

.result-card.highlight .result-label,
.result-card.highlight .result-value {
  color: white;
}

.result-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.result-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.result-card.highlight .result-value {
  font-size: 1.1rem;
}

/* Results table */
.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}

.results-table th,
.results-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.results-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.results-table td {
  color: var(--text-secondary);
}

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

.results-table .total-row {
  background: var(--bg-secondary);
  font-weight: 600;
}

.results-table .total-row td {
  color: var(--text-primary);
}

/* ========================================
   Info Sections (How to Use, FAQ)
   ======================================== */
.info-section {
  margin-top: 32px;
}

.info-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-section h2 i {
  color: var(--primary);
}

.steps-list {
  counter-reset: step;
  list-style: none;
}

.steps-list li {
  position: relative;
  padding-left: 60px;
  margin-bottom: 20px;
  min-height: 40px;
}

.steps-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.steps-list li strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.steps-list li p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.faq-question {
  width: 100%;
  padding: 18px 20px;
  background: var(--bg-secondary);
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.faq-question:hover {
  background: var(--border-color);
}

.faq-question i {
  transition: var(--transition);
  color: var(--primary);
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer p {
  padding: 18px 20px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========================================
   Related Tools Section
   ======================================== */
.related-tools {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 2px solid var(--border-color);
}

.related-tools h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
}

.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.related-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.related-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.related-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================
   Ad Spaces
   ======================================== */
.ad-space {
  padding: 20px;
  text-align: center;
  align-items: center;
  justify-content: center;
}

/* ========================================
   Alerts & Messages
   ======================================== */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert-success {
  background: rgba(42, 157, 143, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.alert-warning {
  background: rgba(233, 196, 106, 0.1);
  border: 1px solid var(--warning);
  color: #b38600;
}

.alert-danger {
  background: rgba(230, 57, 70, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.alert-info {
  background: rgba(39, 76, 119, 0.1);
  border: 1px solid var(--primary);
  color: var(--primary);
}

/* Error message */
.error-message {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-error {
  border-color: var(--danger) !important;
}

.input-error:focus {
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1) !important;
}

/* ========================================
   Progress Bars & Visual Elements
   ======================================== */
.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  overflow: hidden;
  margin: 12px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 6px;
  transition: width 0.5s ease;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--score) * 1%), var(--border-color) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.score-circle::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  background: var(--bg-card);
  border-radius: 50%;
}

.score-value {
  position: relative;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.score-info h4 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.score-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ========================================
   Tags & Badges
   ======================================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.tag-primary {
  background: var(--primary);
  color: white;
}

.tag-success {
  background: var(--success);
  color: white;
}

.tag-warning {
  background: var(--warning);
  color: #333;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
  .calculator-sidebar {
    width: 280px;
  }
}

@media (max-width: 768px) {
  .calculator-container {
    flex-direction: column;
    padding: 16px;
  }
  
  .calculator-sidebar {
    width: 100%;
    order: 2;
  }
  
  .sidebar-toggle {
    display: flex;
  }
  
    .sidebar-content {
        display: block !important;
    }
    
    .sidebar-content.active {
        display: block !important;
    }
  
  .calc-header {
    padding: 20px 24px;
  }
  
  .calc-header h1 {
    font-size: 1.5rem;
  }
  
  .calc-body {
    padding: 24px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
  
  .related-grid {
    grid-template-columns: 1fr;
  }
  
  .score-display {
    flex-direction: column;
    text-align: center;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .calc-header h1 {
    font-size: 1.25rem;
  }
  
  .calc-body {
    padding: 20px;
  }
  
  .result-value {
    font-size: 1.5rem;
  }
  
  .steps-list li {
    padding-left: 50px;
  }
  
  .steps-list li::before {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .calculator-sidebar,
  .sidebar-toggle,
  .ad-space,
  .btn-group {
    display: none !important;
  }
  
  .calc-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .results-section {
    display: block !important;
  }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.loading {
  animation: pulse 1.5s ease infinite;
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.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;
}

/* ========================================
   Additional Global Styles - Mobile Optimized & Enhanced
   ======================================== */

/* ========================================
   Improved Table Responsiveness
   ======================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.results-table th,
.results-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: normal;
    word-break: break-word;
}

@media (max-width: 768px) {
    .results-table th,
    .results-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .results-table {
        min-width: 400px;
    }
}

/* ========================================
   Enhanced Card Styles
   ======================================== */
.result-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.result-card:hover::before {
    left: 100%;
}

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

.result-card.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.result-card.highlight .result-label,
.result-card.highlight .result-value {
    color: white;
}

.result-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

@media (max-width: 768px) {
    .result-card {
        padding: 16px;
    }
    
    .result-value {
        font-size: 1.2rem;
    }
    
    .result-label {
        font-size: 0.7rem;
    }
}

/* ========================================
   Form Input Enhancements
   ======================================== */
input, select, textarea {
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(39, 76, 119, 0.1);
    outline: none;
}

input:hover:not(:disabled), 
select:hover:not(:disabled), 
textarea:hover:not(:disabled) {
    border-color: var(--primary-light);
}

/* Number input spinner styling */
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.5;
}

input[type="number"]:hover::-webkit-inner-spin-button,
input[type="number"]:hover::-webkit-outer-spin-button {
    opacity: 1;
}

/* ========================================
   Mobile Navigation Enhancements
   ======================================== */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
        width: 100%;
        padding: 14px 20px;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: var(--radius);
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 20px;
        align-items: center;
        justify-content: center;
        gap: 10px;
        transition: all 0.3s ease;
    }
    
    .sidebar-toggle:hover {
        background: var(--primary-light);
        transform: translateY(-1px);
    }
    
    .sidebar-toggle:active {
        transform: translateY(0);
    }
    
    .calculator-sidebar {
        width: 100%;
        order: 2;
        margin-top: 20px;
    }
    
    .sidebar-content {
        display: none;
        animation: slideDown 0.3s ease;
    }
    
    .sidebar-content.active {
        display: block;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ========================================
   Toast Notification Enhancement
   ======================================== */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast-notification.toast-success {
    border-left-color: var(--success);
}

.toast-notification.toast-error {
    border-left-color: var(--danger);
}

.toast-notification.toast-warning {
    border-left-color: var(--warning);
}

.toast-notification.toast-info {
    border-left-color: var(--primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .toast-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        padding: 12px 16px;
        font-size: 0.85rem;
    }
}

/* ========================================
   FAQ Accordion Enhancement
   ======================================== */
.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

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

.faq-question {
    width: 100%;
    padding: 18px 20px;
    background: var(--bg-secondary);
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: var(--border-color);
}

.faq-question i {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    padding: 0 20px;
}

.faq-item.active .faq-answer {
    max-height: 800px;
    padding: 0 20px 20px 20px;
}

.faq-answer p,
.faq-answer ul {
    margin: 12px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-answer ul {
    padding-left: 20px;
}

.faq-answer li {
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .faq-question {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
    
    .faq-item.active .faq-answer {
        padding: 0 16px 16px 16px;
    }
    
    .faq-answer p,
    .faq-answer li {
        font-size: 0.85rem;
    }
}

/* ========================================
   Loading Spinner
   ======================================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(39, 76, 119, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   Tooltip Enhancements
   ======================================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid var(--border-color);
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 8px);
}

@media (max-width: 768px) {
    [data-tooltip]:before {
        display: none;
    }
}

/* ========================================
   Print Styles Enhancement
   ======================================== */
@media print {
    .calculator-sidebar,
    .sidebar-toggle,
    .ad-space,
    .btn-group,
    .ad-space-sidebar,
    .related-tools {
        display: none !important;
    }
    
    .calc-card {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .results-section {
        display: block !important;
    }
    
    .result-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .results-table {
        break-inside: avoid;
    }
    
    a {
        text-decoration: none;
        color: black;
    }
}

/* ========================================
   Smooth Scroll Behavior
   ======================================== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 20px;
}

/* ========================================
   Custom Scrollbar for Webkit Browsers
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ========================================
   Loading Skeleton Animation
   ======================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--border-color) 20%,
        var(--bg-secondary) 40%,
        var(--bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}