/**
 * Global Styles for ShowMyIP.com
 * This file contains design system variables and base styles
 */

:root {  /* Color System */  --primary-brand-color: #f15a23;  --primary-hover-color: #d64a1a;  --primary-brand-color-darker: #2a2a2a;  --primary-accent: #f15a23;  --primary-accent-darker: #d84a18;  --secondary-color: #6c757d;    /* Secondary colors */  --secondary-a-color: #f5f5f5;  --secondary-b-color: #e0e0e0;  --secondary-c-color: #cccccc;    /* Text colors */  --text-color: #343a40;  --primary-text-color: #333333;  --secondary-text-color: #666666;  --light-text-color: #ffffff;  --heading-color: #212529;
  
  /* Background colors */
  --background-light: #ffffff;
  
  /* Semantic colors */
  --success-color: #28a745;
  --success-color-light: #d4edda;
  --warning-color: #ffc107;
  --warning-color-light: #fff3cd;
  --error-color: #dc3545;
  --error-color-light: #f8d7da;
  --info-color: #17a2b8;
  --info-color-light: #d1ecf1;
  
  /* Border colors */
  --light-border-color: #e5e5e5;
  --medium-border-color: #cccccc;
  --dark-border-color: #888888;
  
  /* Link colors */
  --link-color: #0066cc;
  --link-hover-color: #004499;
  --link-visited-color: #551a8b;
  
  /* Typography */
  --font-family-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-family-monospace: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-md: 1.125rem;   /* 18px */
  --font-size-lg: 1.25rem;    /* 20px */
  --font-size-xl: 1.5rem;     /* 24px */
  --font-size-2xl: 1.875rem;  /* 30px */
  --font-size-3xl: 2.25rem;   /* 36px */
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-loose: 1.75;
  
  /* Spacing */
  --spacing-xs: 0.25rem;  /* 4px */
  --spacing-sm: 0.5rem;   /* 8px */
  --spacing-md: 1rem;     /* 16px */
  --spacing-lg: 1.5rem;   /* 24px */
  --spacing-xl: 2rem;     /* 32px */
  --spacing-2xl: 3rem;    /* 48px */
  
  /* Layout */
  --max-width: 1200px;
  --site-width: 100%;
  --site-margin: 0 auto;
  --content-section-padding: var(--spacing-lg); /* Default to 1.5rem (24px), was 2rem */
  --border-radius: 8px;
  
  /* Border radius */
  --border-radius-small: 3px;
  --border-radius-standard: 5px;
  --border-radius-large: 8px;
  --border-radius-circle: 50%;
  
  /* Box shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  
  /* Focus states for accessibility */
  --focus-ring-color: rgba(77, 144, 254, 0.8);
  --focus-ring-width: 3px;
  
  /* Animation */
  --transition-fast: 150ms;
  --transition-normal: 300ms;
  --transition-slow: 500ms;
  
  /* Z-index layers */
  --z-index-dropdown: 1000;
  --z-index-sticky: 1020;
  --z-index-fixed: 1030;
  --z-index-modal-backdrop: 1040;
  --z-index-modal: 1050;
  --z-index-tooltip: 1070;

  /* Default light theme variables - using always */
  --current-background-color: var(--background-light);
  --current-text-color: var(--primary-text-color);
  --current-border-color: var(--light-border-color);
  --table-border-color: #dddddd;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Dark theme variables - Removed */

/* Light theme variables - now set directly in :root */

/* Global box sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Base element styles */
html {
  font-size: 16px;
  line-height: var(--line-height-normal);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-base);
  color: var(--current-text-color);
  background-color: var(--current-background-color);
  margin: 0;
  padding: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: calc(var(--spacing-sm) + var(--spacing-xs)); /* 12px */
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

h1 {
  font-size: var(--font-size-3xl);
}

h2 {
  font-size: var(--font-size-2xl);
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
}

h5 {
  font-size: var(--font-size-md);
}

h6 {
  font-size: var(--font-size-base);
}

p {
  margin-top: 0;
  margin-bottom: calc(var(--spacing-sm) + var(--spacing-xs)); /* 12px */
}

/* Links */
a {
  color: var(--link-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

a:visited {
  color: var(--link-visited-color);
}

a:focus {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 2px;
}

/* Lists */
ul, ol {
  margin-top: 0;
  margin-bottom: calc(var(--spacing-sm) + var(--spacing-xs)); /* 12px */
  padding-left: var(--spacing-lg); /* 24px, was var(--spacing-xl) */
}

li {
  margin-bottom: var(--spacing-xs);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Accessible focus styles */
:focus {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 2px;
}

/* Remove focus outline for mouse users, but keep for keyboard */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 2px;
}

/* Skip link for keyboard users */
.skip-link {
  background: var(--primary-brand-color);
  color: var(--light-text-color);
  font-weight: var(--font-weight-bold);
  left: 0;
  padding: var(--spacing-sm) var(--spacing-md);
  position: absolute;
  top: -999px;
  z-index: 9999;
}

.skip-link:focus {
  top: 0;
}

/* Container for site content */
.container, .container-fluid {
  width: 100%;
  padding-right: var(--spacing-md);
  padding-left: var(--spacing-md);
  margin-right: auto;
  margin-left: auto;
}

.container {
  width: 100%; /* Take full width available up to max-width */
}

/* Restrict overall desktop width to 940px (matches legacy layout) */
@media (min-width: 992px) {
  .container {
    max-width: 940px;
  }
}

/* Buttons */
.btn {
  display: inline-block;
  font-weight: var(--font-weight-medium);
  text-align: center;
  vertical-align: middle;
  user-select: none;
  padding: calc(var(--spacing-sm) + var(--spacing-xs)) calc(var(--spacing-md) + var(--spacing-xs)); /* Adjusted padding: 12px 20px */
  font-size: var(--font-size-base);
  line-height: 1.5;
  border-radius: var(--border-radius-standard);
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent; /* Ensure all buttons have a border for consistent height */
}

.btn:focus {
  outline: 0;
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.btn-primary {
  color: var(--light-text-color);
  background-color: var(--primary-brand-color);
  border: 1px solid var(--primary-brand-color);
}

.btn-primary:hover {
  background-color: var(--primary-brand-color-darker);
  border-color: var(--primary-brand-color-darker);
  text-decoration: none;
  color: var(--light-text-color);
}

.btn-secondary {
  color: var(--primary-brand-color);
  background-color: transparent;
  border: 1px solid var(--primary-brand-color);
}

.btn-secondary:hover {
  color: var(--light-text-color);
  background-color: var(--primary-accent);
  border-color: var(--primary-accent);
  text-decoration: none;
}

.btn-info {
  color: var(--light-text-color);
  background-color: var(--info-color);
  border: 1px solid var(--info-color);
}

.btn-info:hover {
  background-color: darken(var(--info-color), 10%);
  border-color: darken(var(--info-color), 10%);
  text-decoration: none;
  color: var(--light-text-color);
}

.btn-outline-info {
  color: var(--info-color);
  background-color: transparent;
  border: 1px solid var(--info-color);
}

.btn-outline-info:hover {
  color: var(--light-text-color);
  background-color: var(--info-color);
  border-color: var(--info-color);
  text-decoration: none;
}

.btn-sm {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  border-radius: var(--border-radius-small);
}

.btn.active {
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.btn-block {
  display: block;
  width: 100%;
}

/* Form elements */
.form-control {
  display: block;
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md); /* 8px 16px */
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--current-text-color);
  background-color: var(--current-background-color);
  background-clip: padding-box;
  border: 1px solid var(--current-border-color);
  appearance: none; /* Key for custom select styling */
  border-radius: var(--border-radius-standard);
  transition: border-color var(--transition-fast) ease-in-out, box-shadow var(--transition-fast) ease-in-out;
  min-height: calc(var(--line-height-normal) * var(--font-size-base) + (var(--spacing-sm) * 2) + 2px); /* Calculate height based on font and padding */
}

select.form-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right var(--spacing-md) center;
  background-size: 16px 12px;
  padding-right: calc(var(--spacing-md) * 2.5); /* Ensure space for arrow */
}

textarea.form-control {
  min-height: calc((var(--line-height-normal) * var(--font-size-base) + (var(--spacing-sm) * 2) + 2px) * 3); /* Default to 3 lines high */
  resize: vertical;
}

.form-control:focus {
  color: var(--current-text-color);
  background-color: var(--current-background-color);
  border-color: var(--primary-accent-darker);
  outline: 0;
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.form-control::placeholder {
  color: var(--secondary-text-color);
  opacity: 0.7;
}

.form-control:disabled,
.form-control[readonly] {
  background-color: var(--secondary-a-color);
  opacity: 0.7;
  cursor: not-allowed;
}

.form-label {
  display: inline-block;
  margin-bottom: var(--spacing-xs);
  font-weight: var(--font-weight-medium);
}

/* Basic Form Grouping */
.form-group {
  margin-bottom: var(--spacing-md); /* 1rem */
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-xs); /* 4px */
  font-weight: var(--font-weight-medium);
}

/* Form Check (for checkboxes and radios) */
.form-check {
  display: block; /* Or flex for inline alignment of input and label */
  position: relative;
  margin-bottom: var(--spacing-sm); /* 0.5rem */
  padding-left: 1.5rem; /* Space for the custom input */
}

.form-check-input {
  position: absolute;
  margin-left: -1.5rem;
  width: 1rem; /* Adjust size as needed */
  height: 1rem;
  margin-top: 0.25rem; /* Align with first line of label text */
}

.form-check-label {
  margin-bottom: 0; /* Remove bottom margin if label is part of form-check */
  font-weight: var(--font-weight-normal); /* Standard weight for check labels */
  cursor: pointer; /* Make label clickable */
}

/* Input Group for combining input and button/addon */
.input-group {
  position: relative;
  display: flex;
  flex-wrap: wrap; /* Allow wrapping for responsiveness if needed */
  align-items: stretch; /* Default for BS, makes items same height */
  width: 100%;
}

.input-group > .form-control {
  position: relative;
  flex: 1 1 auto; /* Allow input to grow and shrink */
  width: 1%; /* Prevent conflicts with other width utilities */
  min-width: 0; /* Override browser default */
  margin-bottom: 0; /* Remove bottom margin when in group */
}

.input-group > .form-control:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group > .form-control:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px; /* Overlap borders */
}

.input-group > .btn {
  position: relative;
  z-index: 2; /* Place buttons above input for border overlap */
}

.input-group > .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group > .btn:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px; /* Overlap borders */
}

/* Small icon copy button */
.btn-copy-sm {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 var(--spacing-xs); /* 4px horizontal padding */
    vertical-align: middle; /* Align with text/inputs */
    display: inline-flex; /* For aligning img inside */
    align-items: center;
    justify-content: center;
    min-height: auto; /* Override general button min-height for small icon buttons */
    min-width: auto; /* Override general button min-width */
}

.btn-copy-sm img {
    width: 16px; /* Fixed size for the icon */
    height: 16px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.btn-copy-sm:hover img {
    opacity: 1;
}

.btn-copy-sm:focus {
    outline: var(--focus-ring-width) solid var(--focus-ring-color);
    outline-offset: 1px;
    border-radius: var(--border-radius-small); /* Add a bit of radius on focus for visibility */
}

/* Tables */
table {
  width: 100%;
  margin-bottom: var(--spacing-md);
  border-collapse: collapse;
}

th, td {
  padding: var(--spacing-sm);
  vertical-align: top;
  border-bottom: 1px solid var(--table-border-color);
}

th {
  font-weight: var(--font-weight-bold);
  text-align: left;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.05);
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.075);
}

/* Alerts */
.alert {
  position: relative;
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  border: 1px solid transparent;
  border-radius: var(--border-radius-standard);
}

.alert-success {
  color: #155724;
  background-color: var(--success-color-light);
  border-color: #c3e6cb;
}

.alert-warning {
  color: #856404;
  background-color: var(--warning-color-light);
  border-color: #ffeeba;
}

.alert-danger {
  color: #721c24;
  background-color: var(--error-color-light);
  border-color: #f5c6cb;
}

.alert-info {
  color: #0c5460;
  background-color: var(--info-color-light);
  border-color: #bee5eb;
}

/* Spinner/Loader */
.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: text-bottom;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner 0.75s linear infinite;
}

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

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

.sr-only-focusable:focus,
.sr-only-focusable:active {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Responsive utilities */
.clearfix::after {
  display: block;
  clear: both;
  content: "";
}

/* Responsive visibility classes */
.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

@media (min-width: 576px) {
  .d-sm-none {
    display: none !important;
  }
  .d-sm-block {
    display: block !important;
  }
}

@media (min-width: 768px) {
  .d-md-none {
    display: none !important;
  }
  .d-md-block {
    display: block !important;
  }
}

@media (min-width: 992px) {
  .d-lg-none {
    display: none !important;
  }
  .d-lg-block {
    display: block !important;
  }
}

/* Media queries for responsive design */
@media (min-width: 576px) {
  :root {
    --content-section-padding: var(--spacing-lg);
  }
}

@media (min-width: 768px) {
  h1 {
    font-size: var(--font-size-3xl);
  }
  h2 {
    font-size: var(--font-size-2xl);
  }
}

/* Lazy loading for images */
.lazy-image {
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.lazy-image.loaded {
  opacity: 1;
}

/* Add ARIA landmarks styling */
[role="banner"] {
  /* Header styling */
}

[role="navigation"] {
  /* Navigation styling */
}

[role="main"] {
  /* Main content styling */
}

[role="complementary"] {
  /* Sidebar styling */
}

[role="contentinfo"] {
  /* Footer styling */
}

/* Accessibility: Ensure all clickable elements have appropriate focus styles */
button:focus, 
a:focus, 
[role="button"]:focus,
input:focus, 
select:focus, 
textarea:focus {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 2px;
}

/* Buttons and links need better touch targets for mobile */
@media (max-width: 768px) {
  button, 
  a,
  [role="button"] {
    min-height: 44px; /* iOS minimum touch target size */
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Container and Layout Helpers */
/* Apply a consistent max-width and centering to the main page elements */
body header.container,
body main.container,
body footer .container {
    max-width: var(--max-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: var(--spacing-md) var(--spacing-md) !important; /* Reduced from lg top/bottom. Now 16px top/bottom, 16px L/R */
}

/* Ensure direct children of main.container don't overflow if they try to be wider */
body main.container > * {
    max-width: 100% !important; /* Prevent children from breaking the container width */
}

/* Content Sections */
.content-section,
.tool-card, /* Applying .content-section styles to .tool-card as well for consistency */
.collapsible-section,
.ip-data-explainer,
.rir-explainer {
    background-color: var(--card-bg-color, var(--current-background-color)); /* Use card-bg or fallback */
    padding: var(--content-section-padding); /* Uses variable, now defaults to 1.5rem (24px) */
    margin-bottom: var(--spacing-md); /* Reduced from lg. Now 1rem (16px) margin between sections */
    border: 1px solid var(--current-border-color);
    border-radius: var(--border-radius-standard);
    box-shadow: var(--shadow-sm);
}

/* Dark theme specific styles for sections - Removed */

/* Make sure collapsible content is always visible and styled like a card */
/* This targets sections that were previously collapsible */
.collapsible-section .collapsible-content,
details[open] summary ~ *, /* Content of open details */
details summary ~ * /* Ensure all content after summary is visible */ {
    display: block !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    visibility: visible !important;
}

/* Hide toggle indicators */
.collapsible-section .collapsible-header .collapse-arrow,
details > summary::marker, /* Hide the default arrow for details */
details > summary::-webkit-details-marker /* Hide for WebKit browsers */ {
    display: none !important;
}

/* Style the header of these "always open" sections if it's still present */
.collapsible-section .collapsible-header {
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-sm); /* Space between header and content */
    cursor: default !important; /* Not interactive */
    pointer-events: none; /* Disable pointer events as it's not clickable */
}
/* Remove hover effects from the now static header */
.collapsible-section .collapsible-header:hover {
    background-color: transparent !important; 
    color: inherit !important;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 20px;
  background-color: var(--secondary-a-color); /* A light grey */
  border-radius: var(--border-radius-standard);
  overflow: hidden;
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.progress {
  width: 0%; /* Dynamically set by JS or inline style */
  height: 100%;
  background-color: var(--primary-brand-color);
  transition: width var(--transition-slow) ease-in-out; /* Smooth transition */
}

/* IP Type specific text styles */
.ip-type-ipv4 {
  color: #28a745; /* Success color for IPv4 */
  font-weight: var(--font-weight-semibold);
}

.ip-type-ipv6 {
  color: #007bff; /* A standard blue for IPv6 */
  font-weight: var(--font-weight-semibold);
}

/* Simple margin bottom for tab-like elements if needed */
.iptab {
  margin-bottom: var(--spacing-md);
}

/* View Toggle Buttons styling */
.view-toggle-buttons {
    margin-bottom: var(--spacing-md);
    display: flex; /* Align buttons in a row */
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: var(--spacing-xs); /* Space between buttons */
}

/* Ensure buttons in toggle group don't get excessive margin if they are .btn */
.view-toggle-buttons .btn {
    /* margin-right: var(--spacing-xs); Removed, using gap on parent */
}

/* Button Group */
.button-group {
  display: flex;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  gap: var(--spacing-sm); /* Space between buttons in the group */
  margin-top: var(--spacing-md); /* Space above the button group */
  margin-bottom: var(--spacing-md); /* Space below the button group */
}

/* Basic Tab Styling */
.form-tabs {
  display: flex;
  border-bottom: 1px solid var(--current-border-color);
  margin-bottom: var(--spacing-md);
}

.tab-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  cursor: pointer;
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent; /* For active indicator */
  margin-bottom: -1px; /* Align with parent border */
  font-size: var(--font-size-base);
  color: var(--secondary-text-color);
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.tab-btn:hover {
  color: var(--primary-brand-color);
}

.tab-btn.active {
  color: var(--primary-brand-color);
  border-bottom-color: var(--primary-brand-color);
  font-weight: var(--font-weight-semibold);
}

.tab-content {
  display: none; /* Hidden by default, shown by JS */
  padding-top: var(--spacing-sm);
}

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

/* Advanced Options Toggle Pattern (from dns-lookup) */
.advanced-options-toggle {
  margin: var(--spacing-md) 0;
  text-align: right; /* Or left, or remove for block display */
}

.advanced-options-toggle a {
  color: var(--link-color);
  text-decoration: none;
  font-size: var(--font-size-sm);
  padding: var(--spacing-xs) 0; /* Add some padding for easier clicking */
  display: inline-block; /* Or block if it should take full width */
}

.advanced-options-toggle a:hover {
  text-decoration: underline;
}

.advanced-options-toggle a .fa {
  margin-left: var(--spacing-xs);
  transition: transform 0.2s ease-in-out;
}

.advanced-options {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  border-top: 1px solid transparent; /* Initially transparent */
  padding: 0 var(--spacing-sm); /* Padding when closed */
  margin-top: var(--spacing-sm);
}

.advanced-options.show {
  max-height: 1000px; /* Large enough for content */
  padding: var(--spacing-md) var(--spacing-sm);
  border-top-color: var(--current-border-color);
}

/* Data Explainer Table (generic style) */
.data-explainer-table {
    width: 100%;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border-collapse: collapse;
    overflow-x: auto; /* For responsiveness on small screens */
}

.data-explainer-table th,
.data-explainer-table td {
    border: 1px solid var(--current-border-color);
    padding: var(--spacing-sm) var(--spacing-md); /* Increased padding slightly */
    text-align: left;
    font-size: 0.95em;
    vertical-align: top;
}

.data-explainer-table th {
    background-color: var(--secondary-a-color); /* Lighter grey for table headers */
    font-weight: var(--font-weight-semibold); /* Semibold for better readability */
}

/* Collapsible sections - ensuring they are always open and styled as content blocks */
.collapsible-section {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--current-border-color);
    border-radius: var(--border-radius-standard);
    background-color: var(--card-bg-color, var(--current-background-color)); /* Use card-bg or fallback */
    padding: var(--content-section-padding);
    box-shadow: var(--shadow-sm);
}

.collapsible-trigger,
.collapsible-section .collapsible-header /* Generalizing for semantic headers */
{
    font-size: 1.1em; /* From original embedded style */
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-md); /* Space between header and content */
    padding: 0; /* Remove padding if it was part of a button look */
    background-color: transparent;
    border: none;
    text-align: left;
    width: 100%;
    color: var(--heading-color);
    cursor: default !important;
    pointer-events: none !important; /* Not interactive */
    display: block; /* Ensure it behaves like a header */
}

.collapsible-trigger .toggle-icon,
.collapsible-section .collapsible-header .collapse-arrow,
details > summary::marker, /* Hide the default arrow for details */
details > summary::-webkit-details-marker /* Hide for WebKit browsers */
{
    display: none !important; /* Hide any toggle icons */
}

.collapsible-content,
details[open] summary ~ *,
details summary ~ * /* Ensure all content after summary is visible */
{
    display: block !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    visibility: visible !important;
    padding: 0; /* Content itself might have padding, or use utility classes */
}

/* Styling for tables within these now-open sections (from ip-lookup embedded style) */
.collapsible-section .data-explainer-table {
    width: 100%;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border-collapse: collapse;
}

.collapsible-section .data-explainer-table th,
.collapsible-section .data-explainer-table td {
    border: 1px solid var(--current-border-color);
    padding: var(--spacing-sm);
    text-align: left;
    font-size: 0.95em;
}

.collapsible-section .data-explainer-table th {
    background-color: var(--secondary-b-color); /* A light grey for table headers */
    font-weight: var(--font-weight-bold);
}

.collapsible-section ul {
    list-style-type: disc;
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    padding-left: 0; /* Adjust if default ul padding is too much */
}

.collapsible-section h4 {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-size: 1.05em; /* From embedded */
}

/* URL Encoder/Decoder Specific Styles */
.url-encoder-decoder .io-pair {
    display: grid;
    grid-template-columns: 1fr; /* Default for small screens */
    gap: 1.5rem; /* Spacing between input and output */
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .url-encoder-decoder .io-pair {
        grid-template-columns: 1fr 1fr; /* Side by side on larger screens */
    }
}

.url-encoder-decoder textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.url-encoder-decoder .controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end; /* Align select and buttons nicely if they wrap */
    margin-bottom: 1.5rem;
}

.url-encoder-decoder .controls .form-group {
    flex: 1 1 250px; /* Allow select to take space */
    margin-bottom: 0; /* Remove bottom margin when in this flex group */
}
/* End URL Encoder/Decoder Specific Styles */

/* Basic Custom File Input (Bootstrap-like) */
.custom-file {
  position: relative;
  display: inline-block;
  width: 100%;
  height: calc(1.5em + 0.75rem + 2px); /* Should match .form-control height */
  margin-bottom: 0;
}

.custom-file-input {
  position: relative;
  z-index: 2;
  width: 100%;
  height: calc(1.5em + 0.75rem + 2px); /* Should match .form-control height */
  margin: 0;
  opacity: 0; /* Hidden, label is styled */
}

.custom-file-label {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  height: calc(1.5em + 0.75rem + 2px); /* Should match .form-control height */
  padding: 0.375rem 0.75rem; /* Should match .form-control padding */
  font-weight: var(--font-weight-normal); /* Normal weight */
  line-height: 1.5;
  color: var(--secondary-text-color);
  background-color: var(--background-light);
  border: 1px solid var(--current-border-color);
  border-radius: var(--border-radius-standard);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-file-input:focus ~ .custom-file-label {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 var(--focus-ring-width) rgba(241, 90, 35, 0.25); /* Matches .form-control focus */
}

/* Show filename when a file is chosen (requires JS to update label text) */
.custom-file-label::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: block;
  height: calc(1.5em + 0.75rem); /* Slightly less than full height */
  padding: 0.375rem 0.75rem;
  line-height: 1.5;
  color: var(--primary-text-color);
  content: "Browse";
  background-color: var(--secondary-b-color); /* A light grey for the button part */
  border-left: inherit;
  border-radius: 0 var(--border-radius-standard) var(--border-radius-standard) 0;
}

.custom-file-input:lang(en) ~ .custom-file-label::after {
 content: "Browse";
}
/* End Basic Custom File Input */ 