/* Main Styles - Using Design Tokens from base.css */

/* Header Styles */

/* Header Styles */
.site-header {
    background-color: var(--brand) !important;
    color: white !important;
    padding: 4px 0;
    box-shadow: var(--shadow) !important;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}



.header-brand .site-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.header-content {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--space-3);
}

.header-content .breadcrumb {
    background-color: transparent !important;
    padding: 0 !important;
    border-bottom: none !important;
    color: white !important;
    font-size: var(--font-size-base);
}

.header-content .breadcrumb a {
    color: white !important;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.header-content .breadcrumb a:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

.header-content .breadcrumb span {
    color: white !important;
}

/* Landing Page Skeleton Styles - now handled by .tabs component */
.converter-category-tabs {
    margin-bottom: var(--space-4);
}

/* Layout is now handled by component classes in components.css */

/* Reduce top spacing for breadcrumb in all pages */
.breadcrumb {
    padding: 0 !important;
    margin-top: 0 !important;
    margin-bottom: var(--space-2) !important;
}

.layout-content {
    padding-top: 0 !important;
}

/* Sidebar styling is now handled by component classes in components.css */

/* Individual Converter Page Form Styling */
.converter-input {
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--bg);
    color: var(--text);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-fast);
    width: 100%;
}

.converter-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.25);
}

.converter-input.result-input {
    background-color: #f0ede9;
    color: #666;
    font-weight: 500;
    cursor: not-allowed;
}

.unit-select {
    background-color: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0;
    font-size: var(--font-size-base);
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: border-color var(--transition-fast);
    width: 100%;
    min-height: 150px;
}

.unit-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.25);
}

.unit-select option {
    padding: 4px 8px;
    background-color: var(--bg);
    color: var(--text);
}

.unit-select option:checked,
.unit-select option:selected {
    background-color: var(--brand) !important;
    color: white !important;
    font-weight: 500;
}

.unit-select option:hover {
    background-color: var(--bg-hover);
}

.unit-listbox {
    background-color: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0;
    font-size: var(--font-size-xs);
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: border-color var(--transition-fast);
    width: 100%;
    min-height: 150px;
}

.unit-listbox option {
    padding: 0;
    border-bottom: 1px solid var(--border-subtle);
    background-color: var(--bg);
    color: var(--text);
    cursor: pointer;
}

.unit-listbox option:hover {
    background-color: var(--bg-hover);
}

.unit-listbox option:selected {
    background-color: var(--primary);
    color: var(--primary-text);
    font-weight: 500;
}

/* Landing Page Tab System */
.category-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 2px solid var(--border);
    background: var(--bg);
}

.category-tab {
    flex: 1;
}

.tab-link {
    width: 100%;
    padding: var(--space-2) var(--space-1);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.tab-link:hover {
    background-color: var(--bg-hover);
    color: var(--brand);
}

.tab-link.active {
    border-bottom-color: var(--brand);
    color: var(--brand);
    background-color: var(--bg);
}

.tab-link:focus {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

/* Converter Panels */
.converter-panels {
    position: relative;
}

.converter-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.converter-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Right sidebar ad placeholder is now handled by component classes in components.css */

/* Landing Page Form Layout - now using component-based styling */

/* Landing page defaults: make wrapper un-framed using CSS variables */
.converter-page {
    --inputs-bg: var(--bg-muted);
    --inputs-padding: var(--space-2);
    --inputs-border: 1px solid var(--border);
    --inputs-radius: var(--radius-sm);
    --inputs-gap: var(--space-2);
}

/* Reframe .converter-inputs via variables (no !important needed) */
.converter-page .converter-form .converter-inputs {
    /* layout */
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--inputs-gap);

    /* visual frame driven by vars */
    background-color: var(--inputs-bg, var(--bg-muted));
    padding: var(--inputs-padding, var(--space-2));
    border: var(--inputs-border, 1px solid var(--border));
    border-radius: var(--inputs-radius, var(--radius-sm));
}

/* Let both rows contribute to the same grid (no HTML changes) */
.converter-page .converter-form .converter-inputs > .input-row,
.converter-page .converter-form .converter-inputs > .unit-selection-row {
    display: contents;
}

/* Make From/To stacks */
.converter-page .converter-form .converter-inputs .input-row .input-group:nth-child(1),
.converter-page .converter-form .converter-inputs .unit-selection-row .from-units { 
    grid-column: 1; 
}

.converter-page .converter-form .converter-inputs .input-row .input-group:nth-child(2),
.converter-page .converter-form .converter-inputs .unit-selection-row .to-units { 
    grid-column: 2; 
}

/* Ensure lists fill the column neatly */
.converter-page .converter-form .converter-inputs .unit-selection-row .unit-list { 
    width: 100%; 
}

/* Compact spacing (keeps UX consistent across tabs) */
.converter-page .converter-form .input-group { 
    padding: 6px 8px; 
    margin-bottom: 6px; 
}
.converter-page .converter-form .input-label { 
    margin-bottom: 4px; 
    font-size: 0.9rem;
}
.converter-page .converter-form .converter-input { 
    padding: 6px 8px; 
    min-height: 36px; 
    font-size: 0.9rem;
}

/* Consistent Page Title Styling for All Pages */
.page-title {
    font-size: var(--font-size-xl) !important;
}

/* Compact Styling for Landing Page (now handled by components) */

.converter-form .input-row {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

/* Dropdown styles now handled by .select component */

/* Selection styling now handled by .select component */

/* Layout now handled by .form and .input-group components */

/* Result input styling - now using component classes */

/* Converter form styling now handled by .form, .input-group, .input-label, .input-wrapper, and .input components */

/* Unit Selection Lists now handled by .select component and 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: 0;
}

/* Main Content Styles */
.main-content {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: calc(var(--space-3) * 0.3) var(--space-3) var(--space-3) var(--space-3);
    flex: 1;
}

/* Breadcrumb Styles */
.breadcrumb {
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: var(--font-size-base);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--space-3);
    font-size: var(--font-size-base);
}

/* Override any browser defaults for ordered lists */
.breadcrumb ol,
.breadcrumb-list {
    list-style-type: none !important;
    list-style: none !important;
    counter-reset: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin: 0 !important;
    padding: 0 !important;
}

.breadcrumb ol li,
.breadcrumb-list li {
    list-style-type: none !important;
    list-style: none !important;
    counter-increment: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.breadcrumb ol li::before,
.breadcrumb-list li::before {
    content: none !important;
}

.breadcrumb-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.breadcrumb-item:not(:last-child)::after {
    content: '›' !important;
    color: rgba(0, 0, 0, 0.5) !important;
    font-size: 14px !important;
    margin-left: 8px !important;
}

.breadcrumb a {
    color: var(--brand);
    text-decoration: none;
    transition: color var(--transition-fast);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    min-height: 44px;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.breadcrumb a:hover {
    color: var(--brand-hover);
    background-color: rgba(76, 175, 80, 0.1);
}

.breadcrumb a:focus {
    outline: 2px solid var(--brand);
    outline-offset: var(--focus-offset);
}

.breadcrumb-current {
    color: var(--muted);
    opacity: 0.7;
    font-weight: 500;
    padding: var(--space-1) var(--space-2);
    min-height: 44px;
    display: flex;
    align-items: center;
}

.breadcrumb span {
    color: var(--muted);
}

.content-wrapper {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
}

/* Converter Section (Left Column) */
.converter-section {
    flex: 1;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.converter-header {
    background-color: var(--bg);
    padding: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.converter-header h2 {
    color: var(--fg);
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin: 0;
}

.converter-icon {
    font-size: var(--font-size-2xl);
    color: var(--brand);
}

/* Tabs */
.converter-tabs {
    display: flex;
    background-color: var(--brand);
    border-bottom: 1px solid var(--brand-hover);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-button {
    background-color: var(--brand);
    color: white;
    border: none;
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    font-weight: 600;
    font-size: var(--font-size-sm);
    transition: background-color var(--transition-fast);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    touch-action: manipulation;
}

.tab-button:hover {
    background-color: var(--brand-hover);
}

.tab-button.active {
    background-color: var(--bg);
    color: var(--fg);
    border-bottom: 3px solid var(--brand);
}

.tab-button:focus-visible {
    outline: var(--focus);
    outline-offset: -2px;
}

/* Converter Content */
.converter-content {
    padding: var(--space-4);
}

.converter-panel {
    display: none;
}

.converter-panel.active {
    display: block;
}

.converter-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Input group styling now handled by .input-group, .input-label, .input, and .select components */



/* Find Units Section */
.find-units-section {
            background-color: var(--success-bg);
        padding: var(--space-5);
        border-top: 1px solid var(--border);
}

/* Educational Content */
.educational-content {
            background-color: var(--bg-muted);
        padding: var(--space-5);
        border-top: 1px solid var(--border);
        margin-top: var(--space-5);
}

.educational-content h3 {
    color: var(--success);
    margin-bottom: var(--space-4);
    font-size: 1.3em;
}

.educational-content h4 {
    color: var(--brand);
    margin: var(--space-5) 0 var(--space-3) 0;
    font-size: 1.1em;
}

.educational-content p {
    color: var(--fg);
    line-height: 1.6;
    margin-bottom: var(--space-4);
}

.educational-content ul {
    margin-left: var(--space-5);
    margin-bottom: var(--space-4);
}

.educational-content li {
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: var(--space-1);
}

.find-units-section h3 {
    color: var(--success);
    margin-bottom: var(--space-4);
    font-size: 1.2em;
}

.find-units-form {
    display: flex;
    gap: var(--space-5);
}

.find-units-form .input-group {
    flex: 1;
}

/* Sidebar (Right Column) */
.sidebar {
    width: 300px;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.sidebar-header {
    background-color: var(--brand);
    color: white;
    padding: var(--space-4) var(--space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.sidebar-header h3 {
    font-size: 1.2em;
    font-weight: bold;
}

.dropdown-arrow {
    font-size: var(--font-size-xs);
    transition: transform var(--transition-normal);
}

.sidebar-content {
    padding: var(--space-5);
}

.converter-category {
    margin-bottom: var(--space-6);
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: hidden;
}

.category-header {
    background-color: var(--bg-muted);
    padding: var(--space-3) var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background-color var(--transition-normal);
}

.category-header:hover {
    background-color: var(--bg-hover);
}

.category-header h4 {
    color: var(--fg);
    font-size: 1.1em;
    font-weight: bold;
    margin: 0;
}

.category-header .dropdown-arrow {
    font-size: var(--font-size-xs);
    transition: transform var(--transition-normal);
    color: var(--muted);
}

.converter-category.collapsed .category-header .dropdown-arrow {
    transform: rotate(-90deg);
}

.converter-category.collapsed .converter-links {
    display: none;
}

.converter-category h4 {
    color: var(--fg);
    font-size: 1.1em;
    margin-bottom: var(--space-3);
    font-weight: bold;
}

.converter-category.active h4 {
    color: var(--brand);
}

.converter-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.converter-grid {
    display: flex;
    gap: var(--space-4);
    width: 100%;
}

.converter-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.link-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.converter-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: var(--font-size-sm);
    padding: var(--space-1) 0;
    transition: color var(--transition-normal);
}

.converter-links a:hover {
    color: var(--brand);
}

.converter-category.active .converter-links a {
    color: var(--brand);
}

/* Sidebar Navigation Styles */
/* Optional: inside navigation too */
.sidebar-nav {
    margin-top: 0 !important;
    padding: 8px !important;
    background-color: #f7f6f3;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
}

.sidebar-nav-title {
    font-size: var(--font-size-sm) !important;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 2px !important;
    padding-bottom: 0 !important;
    border-bottom: 1px solid var(--border);
}

.sidebar-nav-section {
    margin-bottom: 0;
}

.sidebar-nav-section:last-child {
    margin-bottom: 0;
}

/* Collapsible Category Toggle */
.sidebar-nav-category-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 0 2px !important;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-xs) !important;
    font-weight: 600;
    color: var(--brand);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1 !important;
    margin: 0 !important;
}

.sidebar-nav-category-toggle:hover {
    background-color: var(--bg-hover);
}

.sidebar-nav-category-toggle:focus {
    outline: none;
    background-color: var(--bg-hover);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.category-name {
    font-weight: 600;
    color: var(--brand);
}

.toggle-icon {
    font-size: 12px;
    transition: transform var(--transition-fast);
}

/* Collapsible Content */
.sidebar-nav-content {
    padding: 0 1px !important;
    border-left: none;
    margin-left: 2px !important;
}

.sidebar-nav-content.collapsed {
    display: none;
}

/* Converter Grid Layout */
.converter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-left: 1px solid var(--border-light);
    padding-left: 0;
}

.converter-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
}

.sidebar-nav-link {
    display: block;
    padding: 0 1px !important;
    color: var(--muted);
    text-decoration: none;
    font-size: var(--font-size-xs) !important;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1 !important;
    margin: 0 !important;
}

.sidebar-nav-link:hover {
    background-color: var(--bg-hover);
    color: var(--brand);
    text-decoration: none;
}

.sidebar-nav-link:focus {
    outline: none;
    background-color: var(--bg-hover);
    color: var(--brand);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

/* Footer Styles */
.site-footer {
    background-color: var(--brand) !important;
    color: white !important;
    margin-top: auto;
}

.footer-single-line {
    text-align: center;
    padding: 4px 0;
    background-color: transparent;
    border-top: none;
}

.footer-single-line p {
    margin: 0;
    color: white !important;
    font-size: 12px;
    line-height: 1.2;
}

.footer-link {
    color: white !important;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: underline;
}

/* Original Footer Styles */
footer {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: white;
    padding: var(--space-2) 0;
    margin-top: auto;
}

.footer-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--space-5);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
}

.footer-section h3 {
    color: var(--success-light);
    margin-bottom: var(--space-4);
    font-size: 1.2em;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--space-2);
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.footer-section a:hover {
    color: var(--success-light);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-5);
    margin-top: var(--space-5);
    border-top: 1px solid var(--success-dark);
    color: var(--text-muted);
}

/* Ad Styles */
.footer-ad {
    text-align: center;
    padding: var(--space-3);
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    margin: var(--space-3) 0;
}

/* Form Elements */
input[readonly] {
    background-color: var(--bg-muted);
    color: var(--muted);
    cursor: not-allowed;
}

/* Error States */
.error {
    border-color: var(--error) !important;
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.3) !important;
}

.error-message {
    color: var(--error);
    font-size: 0.9em;
    margin-top: var(--space-1);
}

/* Success States */
.success {
    border-color: var(--brand) !important;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3) !important;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    .footer-ad, .main-nav {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .converter-section {
        border: 1px solid var(--border);
        break-inside: avoid;
    }
}

/* Focus Styles for Accessibility */
button:focus, input:focus, select:focus, a:focus {
    outline: var(--focus);
    outline-offset: var(--focus-offset);
}



/* Minimum Touch Targets */
button, input, select, a {
    min-height: 44px;
    min-width: 44px;
}

/* Screen Reader Only */
.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;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .converter-section {
        border: 2px solid var(--fg);
    }
    
    .tab-button.active {
        background: var(--fg);
        color: var(--bg);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Compact the whole sidebar: categories, toggles, items */
.all-converters-compact,
.all-converters-compact * { box-sizing: border-box; }

.all-converters-compact {
  --compact-font: 11px;
  --compact-pad-x: 2px;
  --compact-pad-y: 0px;
  --compact-gap: 0;
}

/* kill outer spacing + layout gaps */
.all-converters-compact .sidebar-nav,
.all-converters-compact .sidebar-nav-section,
.all-converters-compact .sidebar-nav-content,
.all-converters-compact .converter-grid,
.all-converters-compact .converter-column {
  margin: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
}

/* Keep margin for main container */
.all-converters-compact {
  margin: 0 !important;
}

/* titles, buttons, links, items — make dense */
.all-converters-compact .sidebar-nav-title,
.all-converters-compact .sidebar-nav-toggle,
.all-converters-compact .sidebar-nav-item,
.all-converters-compact .sidebar-nav-link {
  font-size: var(--compact-font) !important;
  line-height: 1.1 !important;
  padding: var(--compact-pad-y) var(--compact-pad-x) !important;
  margin: 0 !important;
  border: 0 !important;
  min-height: 0 !important;
  height: auto !important;
}

/* Increase font size for category titles specifically */
.all-converters-compact .sidebar-nav-category-toggle {
  font-size: 14px !important;
  font-weight: 600 !important;
}

/* Increase font size for category items by small amount */
.all-converters-compact .sidebar-nav-link {
  font-size: 12px !important;
}

/* toggle buttons shouldn't add extra height */
.all-converters-compact .sidebar-nav-toggle {
  display: inline-flex !important;
  align-items: center !important;
  background: none !important;
}

/* Category toggle buttons - remove padding and adjust flexbox */
.all-converters-compact .sidebar-nav-category-toggle {
  padding: 0px !important;
  margin: 0px !important;
  justify-content: flex-start !important;
  gap: 2px !important;
  min-height: 0 !important;
  height: auto !important;
}

/* lists: remove default spacing */
.all-converters-compact ul,
.all-converters-compact li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}

/* if any icon adds spacing */
.all-converters-compact .toggle-icon { margin-left: 2px !important; }

/* Custom scrollbar styling - light grey background */
.unit-listbox::-webkit-scrollbar,
select::-webkit-scrollbar,
.sidebar-nav-content::-webkit-scrollbar {
    width: 12px;
}

.unit-listbox::-webkit-scrollbar-track,
select::-webkit-scrollbar-track,
.sidebar-nav-content::-webkit-scrollbar-track {
    background: #f0f0f0; /* Light grey background */
    border-radius: 6px;
}

.unit-listbox::-webkit-scrollbar-thumb,
select::-webkit-scrollbar-thumb,
.sidebar-nav-content::-webkit-scrollbar-thumb {
    background: #c0c0c0; /* Medium grey thumb */
    border-radius: 6px;
    border: 2px solid #f0f0f0;
}

.unit-listbox::-webkit-scrollbar-thumb:hover,
select::-webkit-scrollbar-thumb:hover,
.sidebar-nav-content::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0; /* Darker grey on hover */
}

/* Firefox scrollbar styling */
.unit-listbox,
select,
.sidebar-nav-content {
    scrollbar-width: thin;
    scrollbar-color: #c0c0c0 #f0f0f0; /* thumb track */
}

/* Aggressive selection styling removed - now handled by .select--compact component */

/* Converter Page Styles */
.main-converter-section {
    margin-bottom: var(--space-6);
}

.converter-container {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--space-6);
    box-shadow: var(--shadow);
    margin-bottom: var(--space-4);
}

.converter-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.converter-inputs {
    display: flex;
    flex-direction: row;
    gap: var(--space-8);
    align-items: flex-start;
    justify-content: space-between;
}

/* Converter inputs and input groups now handled by component classes */

.input-label {
    font-weight: 600;
    color: var(--fg);
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2);
    /* Subtle background for From/To labels */
    background-color: #f7f6f3;   /* soft contrast */
    padding: 6px 10px;           /* breathing space */
    border-radius: 4px;          /* softer look */
    display: inline-block;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.converter-input {
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: var(--font-size-base);
    background: white;
    transition: border-color var(--transition-fast);
}

.converter-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.unit-select {
    padding: 0 !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 11.2px !important;
    line-height: 1.2;
    font-family: var(--font-family);
    background-color: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 200px; /* Fixed height to show multiple options */
    overflow-y: auto; /* Enable vertical scrolling */
    resize: none; /* Prevent resizing */
    width: 100%;
}

.unit-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.25);
}

.unit-select option {
    padding: 2px 6px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    height: auto !important;
    min-height: auto !important;
    border: none !important;
    background-color: var(--bg) !important;
    color: var(--text) !important;
    cursor: pointer;
    transition: background-color var(--transition-fast) !important;
}

.unit-select option:hover {
    background-color: var(--bg-hover);
}

.unit-listbox {
    background-color: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0;
    font-size: var(--font-size-xs);
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: border-color var(--transition-fast);
    width: 100%;
    min-height: 150px;
}

.unit-listbox option {
    padding: 0;
    border-bottom: 1px solid var(--border-subtle);
    background-color: var(--bg);
    color: var(--text);
    cursor: pointer;
}

.unit-listbox option:hover {
    background-color: var(--bg-hover);
}

.unit-listbox option:selected {
    background-color: var(--primary);
    color: var(--primary-text);
    font-weight: 500;
}

.unit-select option:selected,
.unit-select option:checked {
    background-color: #007bff !important;
    color: white !important;
    font-weight: 600 !important;
}

.input-description {
    font-size: var(--font-size-sm);
    color: var(--fg-muted);
    margin-top: var(--space-1);
}

.convert-button-group {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin: var(--space-4) 0;
}

.convert-button,
.swap-button {
    padding: var(--space-3) var(--space-4);
    border: none;
    border-radius: 4px;
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.convert-button {
    background-color: var(--brand);
    color: white;
}

.convert-button:hover {
    background-color: var(--brand-hover);
}

.swap-button {
    background-color: var(--bg-muted);
    color: var(--fg);
    border: 1px solid var(--border);
}

.swap-button:hover {
    background-color: var(--bg-hover);
}

.convert-icon,
.swap-icon {
    font-size: var(--font-size-lg);
}


.converter-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.option-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.option-checkbox {
    margin: 0;
}

.option-text {
    font-size: var(--font-size-sm);
    color: var(--fg);
}

/* Responsive design for converter form */
@media (max-width: 768px) {
    .converter-container {
        padding: var(--space-4);
    }
    
    /* Stack converter inputs vertically on mobile */
    .converter-inputs {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    /* Mobile stack for converter page grid layout */
    .converter-page .converter-form .converter-inputs { 
        grid-template-columns: 1fr; 
    }
    
    .convert-button-group {
        flex-direction: column;
    }
    
    .convert-button,
    .swap-button {
        width: 100%;
        justify-content: center;
    }
}

/* Normalize listbox across all tabs - now handled by components */
.unit-list { 
    display: flex;
}

.unit-listbox {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    background-color: #fff;
    padding: 0;
    margin: 0;
    box-shadow: none;
}








