/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    height: 100%;
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, var(--bg) 0%, #241a16 50%, var(--bg) 100%);
    min-height: 100vh;
}

:root {
    --bg: #2a1f1a;
    --card: #3d2e26;
    --text: #f4ede6;
    --accent: #d66821;
    --input: #4a3830;
    --border: #5c453a;
    --error: #ff6b5a;
    --desc-bg: rgba(255, 140, 66, 0.12);
    --desc-border: rgba(255, 140, 66, 0.25);
    --success: #e67e22; /* Warm orange instead of green */
    --warning: #f39c12; /* Warm amber */
    --info: #d68910; /* Warm gold */
    --secondary: #8b4513; /* Warm brown */
    --light-accent: #ffaa66;
    --hover-bg: rgba(255, 140, 66, 0.08);
}

/* Navigation Styles */
.navbar {
    background: linear-gradient(135deg, var(--card) 0%, #362a22 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 60px;
}

.nav-brand {
    color: var(--accent);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand:hover {
    color: var(--light-accent);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: var(--hover-bg);
    color: var(--accent);
    transform: translateY(-1px);
}

/* Remove animation for Home button specifically */
.nav-link[title="Home Page"],
.nav-link[title="Home Page"]:hover,
.nav-link[title="Home Page"]:active,
.nav-link[title="Home Page"]:focus,
.nav-link[title="Home Page"]:visited,
a[href="{{ url_for('index') }}"].nav-link,
a[href="{{ url_for('index') }}"].nav-link:hover,
a[href="{{ url_for('index') }}"].nav-link:active,
a[href="{{ url_for('index') }}"].nav-link:focus,
a[href*="/index"].nav-link,
a[href*="/index"].nav-link:hover,
a[href*="/index"].nav-link:active,
a[href*="/index"].nav-link:focus,
.nav-links a:first-child,
.nav-links a:first-child:hover,
.nav-links a:first-child:active,
.nav-links a:first-child:focus {
    transform: none !important;
    transition: background-color 0.3s ease, color 0.3s ease !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Converter Navigation Bar */
.converter-nav-bar {
    background: linear-gradient(135deg, rgba(61, 46, 38, 0.95) 0%, rgba(54, 42, 34, 0.95) 100%);
    border-bottom: 1px solid rgba(92, 69, 58, 0.5);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    position: fixed;
    top: 60px;
    width: 100%;
    z-index: 999;
    backdrop-filter: blur(8px);
}

.converter-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    position: relative;
}

/* Desktop converter navigation */
.converter-nav-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* Mobile dropdown toggle button */
.converter-dropdown-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--accent) 0%, #ff6b42 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 140, 66, 0.3);
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.converter-dropdown-toggle:hover {
    background: linear-gradient(135deg, #ff6b42 0%, var(--accent) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.4);
}

.converter-dropdown-toggle i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.converter-dropdown-toggle.active i:last-child {
    transform: rotate(180deg);
}

/* Mobile dropdown menu */
.converter-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--card) 0%, #362a22 100%);
    border-top: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1500; /* Increased z-index for mobile */
    animation: slideDown 0.3s ease;
    max-height: 70vh;
    overflow-y: auto;
}

.converter-dropdown-menu.active {
    display: block;
}

.converter-dropdown-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1rem;
}

.converter-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, var(--input) 0%, rgba(61, 46, 38, 0.8) 100%);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    min-width: 120px;
    justify-content: center;
}

.converter-nav-btn i {
    font-size: 1rem;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.converter-nav-btn:hover {
    background: linear-gradient(135deg, var(--accent) 0%, #ff6b42 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.25);
    border-color: var(--accent);
}

.converter-nav-btn:hover i {
    opacity: 1;
    transform: scale(1.05);
}

.converter-nav-btn.active {
    background: linear-gradient(135deg, var(--accent) 0%, #ff6b42 100%);
    color: white !important;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 140, 66, 0.3), 0 4px 12px rgba(255, 140, 66, 0.25);
    transform: translateY(-2px);
    font-weight: 600;
}

.converter-nav-btn.active i {
    opacity: 1;
    color: white !important;
    transform: scale(1.1);
}

.converter-nav-btn.active span {
    color: white !important;
    font-weight: 600;
}

/* Enhanced Current Page Highlighting for Individual Converter Pages */
.converter-nav-btn.current-page {
    background: linear-gradient(135deg, #ff4500 0%, #ff6b42 100%) !important;
    color: white !important;
    border-color: #ff4500 !important;
    box-shadow: 0 0 0 3px rgba(255, 69, 0, 0.4), 0 6px 16px rgba(255, 69, 0, 0.35) !important;
    transform: translateY(-3px) scale(1.02) !important;
    font-weight: 700 !important;
    position: relative;
}

.converter-nav-btn.current-page::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff4500, #ff6b42, #ff8c42, #ff4500);
    border-radius: 12px;
    z-index: -1;
    animation: currentPageGlow 2s ease-in-out infinite alternate;
}

.converter-nav-btn.current-page i {
    opacity: 1 !important;
    color: white !important;
    transform: scale(1.15) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.converter-nav-btn.current-page span {
    color: white !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Mobile Navigation Current Page Highlighting */
.mobile-nav-link.current-page {
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.25) 0%, rgba(255, 107, 66, 0.3) 100%) !important;
    border-left: 4px solid #ff4500 !important;
    color: #ff4500 !important;
    font-weight: 700 !important;
    padding-left: 2.5rem !important;
    position: relative;
    box-shadow: inset 0 0 10px rgba(255, 69, 0, 0.1);
}

.mobile-nav-link.current-page::before {
    content: '●';
    position: absolute;
    left: 1rem;
    color: #ff4500;
    font-size: 0.8rem;
    animation: currentPagePulse 1.5s ease-in-out infinite;
}

.mobile-nav-link.current-page i {
    opacity: 1 !important;
    color: #ff4500 !important;
    transform: scale(1.15) !important;
}

.mobile-nav-link.current-page span {
    color: #ff4500 !important;
    font-weight: 700 !important;
}

/* Dropdown Current Page Highlighting */
.converter-dropdown-content .converter-nav-btn.current-page {
    background: linear-gradient(135deg, #ff4500 0%, #ff6b42 100%) !important;
    color: white !important;
    border-color: #ff4500 !important;
    box-shadow: 0 0 0 2px rgba(255, 69, 0, 0.4), 0 4px 12px rgba(255, 69, 0, 0.3) !important;
    transform: scale(1.02) !important;
    font-weight: 700 !important;
}

/* Animations for Current Page Indicators */
@keyframes currentPageGlow {
    0% {
        opacity: 0.6;
        box-shadow: 0 0 5px rgba(255, 69, 0, 0.4);
    }
    100% {
        opacity: 1;
        box-shadow: 0 0 15px rgba(255, 69, 0, 0.6);
    }
}

@keyframes currentPagePulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Ensure current-page styling takes precedence over active styling */
.converter-nav-btn.current-page,
.mobile-nav-link.current-page {
    animation: none !important; /* Override any existing animations */
}

/* Main Content */
.main-content {
    margin-top: 120px; /* Updated to account for both navigation bars (60px + 60px) */
    min-height: calc(100vh - 180px); /* Updated to account for both navbars */
    padding: 2rem 1rem;
}

/* Remove top padding for individual converter pages */
.main-content .container {
    padding-top: 0;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-header h1 {
    color: var(--accent);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-header p {
    font-size: 1.1rem;
    color: rgba(244, 237, 230, 0.8);
    margin: 0;
}

/* Converter Section */
.converter-section {
    max-width: 800px;
    margin: 0 auto 3rem;
}

/* Info Section for Individual Pages */
.info-section {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.info-card {
    background: linear-gradient(145deg, var(--card) 0%, #362a22 100%);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.info-card h3 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Scales, Frequencies, Angles Info */
.scale-info, .frequency-info, .angle-info, .volume-info {
    display: grid;
    gap: 1.5rem;
}

.scale-item, .freq-item, .angle-item, .volume-item {
    background: rgba(255, 140, 66, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--accent);
}

.scale-item h4, .freq-item h4, .angle-item h4, .volume-item h4 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* Reference Tables */
.reference-table {
    overflow-x: auto;
}

.reference-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.reference-table th,
.reference-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.reference-table th {
    background: rgba(255, 140, 66, 0.1);
    color: var(--accent);
    font-weight: bold;
}

.reference-table tr:hover {
    background: rgba(255, 140, 66, 0.05);
}

/* Formulas */
.formulas {
    display: grid;
    gap: 1rem;
}

.formula-item {
    background: rgba(255, 140, 66, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.formula-item h4 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.formula-item p {
    font-family: 'Courier New', monospace;
    background: var(--input);
    padding: 0.5rem;
    border-radius: 4px;
    margin: 0;
}

/* Applications */
.applications {
    display: grid;
    gap: 1rem;
}

/* Horizontal layout for ALL info-cards on individual converter pages */
.converter-page .info-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Make each info-card content display horizontally on converter pages */
.converter-page .formulas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.converter-page .scale-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.converter-page .applications {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.converter-page .reference-table {
    overflow-x: auto;
    width: 100%;
}

.converter-page .reference-table table {
    min-width: 800px;
    width: 100%;
}

/* Ensure consistent styling for all app areas in converter pages */
.converter-page .app-item,
.converter-page .app-sector,
.converter-page .app-area {
    background: rgba(255, 140, 66, 0.05);
    padding: 1rem;
    border-radius: 8px;
}

.converter-page .formula-item,
.converter-page .scale-item {
    background: rgba(255, 140, 66, 0.05);
    padding: 1rem;
    border-radius: 8px;
}

/* Keep original styles for non-converter pages */
.app-item, .app-sector, .app-area {
    background: rgba(255, 140, 66, 0.05);
    padding: 1rem;
    border-radius: 8px;
}


/* About Page Styles */
.about-section {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    gap: 2rem;
}

.about-card {
    background: linear-gradient(145deg, var(--card) 0%, #362a22 100%);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.about-card h2 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.values-grid, .target-audience, .differentials {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.value-item, .audience-item, .differential-item {
    background: rgba(255, 140, 66, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.value-item h3, .audience-item h3, .differential-item h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
    background: rgba(255, 140, 66, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
}

.stat-item h3 {
    color: var(--accent);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.roadmap {
    display: grid;
    gap: 1rem;
}

.roadmap-item {
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--border);
}

.roadmap-item.completed {
    background: rgba(230, 126, 34, 0.1); /* Changed from green to warm orange */
    border-left-color: var(--success);
}

.roadmap-item.in-progress {
    background: rgba(243, 156, 18, 0.1); /* Changed to warmer amber */
    border-left-color: var(--warning);
}

.roadmap-item.planned {
    background: rgba(139, 69, 19, 0.1); /* Changed from gray to warm brown */
    border-left-color: var(--secondary);
}

/* Contact Page Styles */
.contact-section {
    max-width: 1000px;
    margin: 0 auto;
}

.contact-intro {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.1rem;
    color: rgba(244, 237, 230, 0.9);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.contact-form-container, .contact-info {
    background: linear-gradient(145deg, var(--card) 0%, #362a22 100%);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.contact-form-container h2, .contact-info h2 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 140, 66, 0.2);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--error);
    box-shadow: 0 0 0 2px rgba(255, 107, 90, 0.2);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto !important;
    margin: 0;
}

.submit-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #ff6b42 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.form-success {
    text-align: center;
    padding: 2rem;
    background: rgba(230, 126, 34, 0.1); /* Changed from green to warm orange */
    border: 1px solid var(--success);
    border-radius: 10px;
}

.form-success i {
    font-size: 3rem;
    color: var(--success); /* Now uses warm orange instead of green */
    margin-bottom: 1rem;
}

.form-success h3 {
    color: var(--success); /* Now uses warm orange instead of green */
    margin-bottom: 1rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--accent);
    margin-top: 0.25rem;
}

.contact-details h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.contact-details p {
    margin-bottom: 0.25rem;
}

.contact-details small {
    color: rgba(244, 237, 230, 0.7);
}

.faq-section, .support-section {
    background: linear-gradient(145deg, var(--card) 0%, #362a22 100%);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

.faq-section h2, .support-section h2 {
    color: var(--accent);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.faq-item {
    background: rgba(255, 140, 66, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-item:hover {
    background: rgba(255, 140, 66, 0.08);
    transform: translateY(-2px);
}

.faq-item h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.support-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.support-option {
    text-align: center;
    background: rgba(255, 140, 66, 0.05);
    padding: 2rem;
    border-radius: 10px;
}

.support-option i {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.support-option h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.support-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 1rem;
}

.support-link:hover {
    background: var(--accent);
    color: white;
}

/* Converter Boxes - Main Page */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 1rem 2rem;
}

.container h1 {
    text-align: center;
    color: var(--accent);
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Homepage specific spacing adjustments */
.container h1 {
    margin-bottom: 1rem; /* Reduced from 3rem to 1rem for homepage only */
}

.intro-text {
    text-align: center;
    font-size: 1.2rem;
    color: rgba(244, 237, 230, 0.9);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    font-weight: 300;
}

.converters-flex {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    align-items: start; /* Allow boxes to have different heights */
}

.converter-box {
    background: linear-gradient(145deg, var(--card) 0%, #362a22 100%);
    border-radius: 25px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
    word-wrap: break-word;
    hyphens: auto;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 350px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Individual converter pages should not have excessive min-height */
.converter-section .converter-box {
    min-height: auto;
    padding: 1.5rem 1.5rem 1rem 1.5rem; /* Reduced bottom padding */
}

.converter-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(255, 140, 66, 0.15);
}

.converter-box h2 {
    color: var(--accent);
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.converter-box .row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    min-height: 42px;
}

.converter-box select {
    flex: 1;
    padding: 0.5rem;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    transition: all 0.3s ease;
    min-width: 120px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.converter-box select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 140, 66, 0.2);
}

.converter-box input[type="number"] {
    flex: 1;
    padding: 0.5rem;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    transition: all 0.3s ease;
    min-width: 100px;
    max-width: 100%;
}

.converter-box input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 140, 66, 0.2);
}

.result-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0; /* Allow shrinking */
}

.result-container input {
    width: 100%;
    padding: 0.5rem;
    padding-right: 2rem;
    background: linear-gradient(135deg, var(--input) 0%, #3d2f27 100%);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 0; /* Allow shrinking */
}

.result-container input:hover {
    background: linear-gradient(135deg, #5a4236 0%, #453127 100%);
    transform: translateY(-1px);
}

.result-container input.copied {
    background: linear-gradient(135deg, var(--success) 0%, #d68910 100%);
    border-color: var(--success);
    color: white;
    transform: scale(1.02);
}

.copy-icon {
    position: absolute;
    right: 0.5rem;
    font-size: 1rem;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
}

.result-container:hover .copy-icon {
    opacity: 1;
    transform: scale(1);
}

.copy-icon.copied {
    color: white;
    transform: scale(1.1);
}

.swap-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #ff6b42 100%);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Don't shrink the swap button */
}

.swap-btn:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
}

.converter-box .error {
    color: var(--error);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    text-align: center;
    padding: 0.4rem;
    background: rgba(255, 107, 90, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--error);
    display: none;
    flex-shrink: 0; /* Don't shrink error messages */
}

.converter-box .error.show {
    display: block;
    animation: slideIn 0.3s ease;
}

.converter-box .description {
    background: var(--desc-bg);
    border: 1px solid var(--desc-border);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    border-left: 4px solid var(--accent);
    overflow: hidden; /* Prevent description overflow */
    word-wrap: break-word; /* Allow long words to wrap */
    hyphens: auto; /* Enable hyphenation */
    flex: 1; /* Take remaining space */
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow shrinking if needed */
}

.converter-box .description p {
    margin-bottom: 0.5rem;
    color: var(--text);
    line-height: 1.4;
    word-wrap: break-word; /* Ensure paragraphs wrap properly */
    overflow-wrap: break-word; /* Modern property for word wrapping */
    font-size: 0.85rem;
}

.converter-box .description p:last-of-type {
    margin-bottom: 0.75rem;
}

.converter-box .description strong {
    color: var(--accent);
    font-weight: 600;
    word-wrap: break-word; /* Allow bold text to wrap */
}

.converter-box .description small {
    color: rgba(244, 237, 230, 0.8);
    font-style: italic;
    display: block;
    margin-top: auto; /* Push to bottom */
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 140, 66, 0.2);
    word-wrap: break-word; /* Allow small text to wrap */
    overflow-wrap: break-word;
    line-height: 1.3; /* Improve readability of small text */
    font-size: 0.75rem;
}

/* Individual Converter Pages - New Layout */
.converter-controls .units-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: center;
}

.converter-controls .values-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Footer Styles */
.footer {
    background: linear-gradient(135deg, var(--card) 0%, #362a22 100%);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    padding: 2rem 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.footer-content p {
    color: rgba(244, 237, 230, 0.8);
    margin: 0;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.footer-link {
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.footer-link:hover {
    color: var(--accent);
    background: var(--hover-bg);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.2);
}

.footer-link i {
    font-size: 1.1rem;
    color: var(--accent);
    transition: all 0.3s ease;
}

.footer-link:hover i {
    color: var(--light-accent);
    transform: scale(1.1);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.converter-box.converting {
    animation: pulse 0.6s ease;
}

/* Homepage Specific Styles - Enhanced Design */
.intro-text {
    text-align: center;
    font-size: 1.2rem;
    color: rgba(244, 237, 230, 0.9);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    font-weight: 300;
}

.converters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
    align-items: stretch;
}

.converter-card {
    background: linear-gradient(145deg, var(--card) 0%, #362a22 100%);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.converter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, #ff6b42 50%, var(--light-accent) 100%);
    border-radius: 20px 20px 0 0;
}

.converter-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 64px rgba(255, 140, 66, 0.25);
    border-color: var(--accent);
}

.converter-card h2 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.converter-card h2 a {
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 140, 66, 0.05) 100%);
    border: 2px solid transparent;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.converter-card h2 a::before {
    content: '🔄';
    font-size: 1.4rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 2px 4px rgba(255, 140, 66, 0.3));
    /* animation: float 3s ease-in-out infinite; - Removed homepage loading animation */
}

.converter-card h2 a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.converter-card:hover h2 a {
    color: var(--light-accent);
    background: linear-gradient(135deg, rgba(255, 140, 66, 0.08) 0%, rgba(255, 140, 66, 0.15) 100%);
    border-color: rgba(255, 140, 66, 0.3);
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(255, 140, 66, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.converter-card:hover h2 a::before {
    transform: rotate(360deg) scale(1.2);
    filter: drop-shadow(0 4px 8px rgba(255, 140, 66, 0.5));
}

.converter-card:hover h2 a::after {
    transform: translateX(-50%) scaleX(1);
}

/* Individual card link themes with unique icons */
.converter-card:nth-child(1) h2 a::before {
    content: '🌡️';
}

.converter-card:nth-child(2) h2 a::before {
    content: '📏';
}

.converter-card:nth-child(3) h2 a::before {
    content: '🧪';
}

.converter-card:nth-child(4) h2 a::before {
    content: '💨';
}

.converter-card:nth-child(5) h2 a::before {
    content: '📐';
}

.converter-card:nth-child(6) h2 a::before {
    content: '🎵';
}

.converter-card:nth-child(7) h2 a::before {
    content: '🔨';
}

/* Unique hover colors for each converter */
.converter-card:nth-child(1):hover h2 a {
    color: #ff6b42;
    border-color: rgba(255, 107, 66, 0.4);
    background: linear-gradient(135deg, rgba(255, 107, 66, 0.08) 0%, rgba(255, 107, 66, 0.15) 100%);
}

.converter-card:nth-child(2):hover h2 a {
    color: #4CAF50;
    border-color: rgba(76, 175, 80, 0.4);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.08) 0%, rgba(76, 175, 80, 0.15) 100%);
}

.converter-card:nth-child(3):hover h2 a {
    color: #2196F3;
    border-color: rgba(33, 150, 243, 0.4);
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.08) 0%, rgba(33, 150, 243, 0.15) 100%);
}

.converter-card:nth-child(4):hover h2 a {
    color: #9C27B0;
    border-color: rgba(156, 39, 176, 0.4);
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.08) 0%, rgba(156, 39, 176, 0.15) 100%);
}

.converter-card:nth-child(5):hover h2 a {
    color: #FF9800;
    border-color: rgba(255, 152, 0, 0.4);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.08) 0%, rgba(255, 152, 0, 0.15) 100%);
}

.converter-card:nth-child(6):hover h2 a {
    color: #E91E63;
    border-color: rgba(233, 30, 99, 0.4);
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.08) 0%, rgba(233, 30, 99, 0.15) 100%);
}

.converter-card:nth-child(7):hover h2 a {
    color: #795548;
    border-color: rgba(121, 85, 72, 0.4);
    background: linear-gradient(135deg, rgba(121, 85, 72, 0.08) 0%, rgba(121, 85, 72, 0.15) 100%);
}

/* Floating animation for icons */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-3px) rotate(5deg);
    }
}

/* Pulse effect on card hover for links - DISABLED for homepage */
/* .converter-card:hover h2 a {
    animation: linkPulse 0.6s ease-out;
} */

@keyframes linkPulse {
    0% {
        transform: translateY(-2px) scale(1);
    }
    50% {
        transform: translateY(-4px) scale(1.02);
    }
    100% {
        transform: translateY(-2px) scale(1);
    }
}

/* Enhanced focus states for accessibility */
.converter-card h2 a:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow:
        0 0 0 3px rgba(255, 140, 66, 0.3),
        0 8px 25px rgba(255, 140, 66, 0.2);
    background: linear-gradient(135deg, rgba(255, 140, 66, 0.08) 0%, rgba(255, 140, 66, 0.15) 100%);
}

/* Mobile responsiveness for enhanced links */
@media (max-width: 768px) {
    .converter-card h2 a {
        padding: 0.4rem 0.8rem;
        gap: 0.5rem;
        font-size: 1.1rem;
    }

    .converter-card h2 a::before {
        font-size: 1.2rem;
    }
}

/* Updated Homepage Converter Cards - Optimized for Medium Screens */
.converters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
    align-items: stretch;
}

.converter-card {
    background: linear-gradient(145deg, var(--card) 0%, #362a22 100%);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 240px;
    max-height: 280px;
}

.converter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, #ff6b42 50%, var(--light-accent) 100%);
    border-radius: 16px 16px 0 0;
}

.converter-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 12px 48px rgba(255, 140, 66, 0.2);
    border-color: var(--accent);
}

.converter-card h2 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.converter-description {
    color: rgba(244, 237, 230, 0.85);
    line-height: 1.4;
    margin-bottom: 1rem;
    flex: 1;
    font-size: 0.88rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Inline description inside converter boxes */
.converter-inline-description {
    color: rgba(244, 237, 230, 0.75);
    font-size: 0.8rem;
    line-height: 1.3;
    text-align: center;
    margin: 0.5rem 0 0.3rem 0; /* Reduced margins */
    padding: 0 1rem;
    font-style: italic;
}

.converter-units {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.unit-tag {
    background: linear-gradient(135deg, var(--accent) 0%, #ff6b42 100%);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(255, 140, 66, 0.25);
}

.converter-card:hover .unit-tag {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(255, 140, 66, 0.35);
}

/* Beautiful Action Buttons */
.converter-actions {
    margin-top: auto;
    padding-top: 0.5rem;
}

.converter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    text-align: center;
    letter-spacing: 0.3px;
}

.converter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s;
}

.converter-btn:hover::before {
    left: 100%;
}

.converter-btn.primary {
    background: linear-gradient(135deg, var(--accent) 0%, #ae4120 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 140, 66, 0.3);
}

.converter-btn.primary .arrow {
    font-size: 1.2rem;
    transition: all 0.3s ease;
    font-style: normal;
    font-weight: bold;
}

.converter-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 140, 66, 0.4);
    background: linear-gradient(135deg, #ff6b42 0%, var(--accent) 100%);
}

.converter-btn.primary:hover .arrow {
    transform: translateX(5px);
}

.converter-btn.primary:focus {
    outline: none;
    box-shadow:
        0 8px 30px rgba(255, 140, 66, 0.4),
        0 0 0 3px rgba(255, 140, 66, 0.3);
}

/* Updated Converter Card Headers - Clean Design */
.converter-header {
    display: block; /* Changed from flex to block for proper centering */
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 140, 66, 0.1);
}

.converter-header h1 {
    color: var(--accent);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    padding: 0;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Keep existing h2 styles for backward compatibility */
.converter-header h2 {
    color: var(--accent);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}


/* Individual converter icon themes */
.converter-card:nth-child(1) .converter-icon {
    background: linear-gradient(135deg, #ff6b42 0%, #ff8c42 100%);
}

.converter-card:nth-child(2) .converter-icon {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
}

.converter-card:nth-child(3) .converter-icon {
    background: linear-gradient(135deg, #2196F3 0%, #42A5F5 100%);
}

.converter-card:nth-child(4) .converter-icon {
    background: linear-gradient(135deg, #9C27B0 0%, #AB47BC 100%);
}

.converter-card:nth-child(5) .converter-icon {
    background: linear-gradient(135deg, #FF9800 0%, #FFB74D 100%);
}

.converter-card:nth-child(6) .converter-icon {
    background: linear-gradient(135deg, #E91E63 0%, #EC407A 100%);
}

.converter-card:nth-child(7) .converter-icon {
    background: linear-gradient(135deg, #795548 0%, #8D6E63 100%);
}

/* Remove old link styling that's no longer needed */
.converter-card h2 a::before,
.converter-card h2 a::after {
    display: none;
}

.converter-card h2 a {
    display: none; /* Hide any remaining link styling */
}

/* Enhanced mobile responsiveness for new header design */
@media (max-width: 768px) {
    .converter-header {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }

    .converter-icon {
        font-size: 1.6rem;
        min-width: 2.5rem;
        height: 2.5rem;
        padding: 0.4rem;
    }

    .converter-header h2 {
        font-size: 1.15rem;
    }

    .converter-btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .converter-header {
        gap: 0.4rem;
    }

    .converter-icon {
        font-size: 1.4rem;
        min-width: 2.2rem;
        height: 2.2rem;
        padding: 0.3rem;
    }

    .converter-header h2 {
        font-size: 1.1rem;
    }

    .converter-btn {
        padding: 0.75rem 0.8rem;
        font-size: 0.85rem;
        min-height: 42px;
    }
}

/* Individual Converter Page Themes - Unique Identities */

/* Temperature Converter Theme - Red-Orange */
.page-temperature {
    --page-accent: #ff6b42;
    --page-accent-light: #ff8c42;
    --page-accent-dark: #e55a36;
    --page-gradient: linear-gradient(135deg, #ff6b42 0%, #ff8c42 100%);
    --page-shadow: rgba(255, 107, 66, 0.3);
    --page-hover-shadow: rgba(255, 107, 66, 0.4);
    --page-bg-accent: rgba(255, 107, 66, 0.08);
    --page-border-accent: rgba(255, 107, 66, 0.25);
}

/* Distance Converter Theme - Green */
.page-distance {
    --page-accent: #4CAF50;
    --page-accent-light: #66BB6A;
    --page-accent-dark: #43A047;
    --page-gradient: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    --page-shadow: rgba(76, 175, 80, 0.3);
    --page-hover-shadow: rgba(76, 175, 80, 0.4);
    --page-bg-accent: rgba(76, 175, 80, 0.08);
    --page-border-accent: rgba(76, 175, 80, 0.25);
}

/* Volume Converter Theme - Blue */
.page-volume {
    --page-accent: #2196F3;
    --page-accent-light: #42A5F5;
    --page-accent-dark: #1E88E5;
    --page-gradient: linear-gradient(135deg, #2196F3 0%, #42A5F5 100%);
    --page-shadow: rgba(33, 150, 243, 0.3);
    --page-hover-shadow: rgba(33, 150, 243, 0.4);
    --page-bg-accent: rgba(33, 150, 243, 0.08);
    --page-border-accent: rgba(33, 150, 243, 0.25);
}

/* Pressure Converter Theme - Purple */
.page-pressure {
    --page-accent: #9C27B0;
    --page-accent-light: #AB47BC;
    --page-accent-dark: #8E24AA;
    --page-gradient: linear-gradient(135deg, #9C27B0 0%, #AB47BC 100%);
    --page-shadow: rgba(156, 39, 176, 0.3);
    --page-hover-shadow: rgba(156, 39, 176, 0.4);
    --page-bg-accent: rgba(156, 39, 176, 0.08);
    --page-border-accent: rgba(156, 39, 176, 0.25);
}

/* Angle Converter Theme - Orange */
.page-angle {
    --page-accent: #FF9800;
    --page-accent-light: #FFB74D;
    --page-accent-dark: #FB8C00;
    --page-gradient: linear-gradient(135deg, #FF9800 0%, #FFB74D 100%);
    --page-shadow: rgba(255, 152, 0, 0.3);
    --page-hover-shadow: rgba(255, 152, 0, 0.4);
    --page-bg-accent: rgba(255, 152, 0, 0.08);
    --page-border-accent: rgba(255, 152, 0, 0.25);
}

/* Frequency Converter Theme - Pink */
.page-frequency {
    --page-accent: #E91E63;
    --page-accent-light: #EC407A;
    --page-accent-dark: #D81B60;
    --page-gradient: linear-gradient(135deg, #E91E63 0%, #EC407A 100%);
    --page-shadow: rgba(233, 30, 99, 0.3);
    --page-hover-shadow: rgba(233, 30, 99, 0.4);
    --page-bg-accent: rgba(233, 30, 99, 0.08);
    --page-border-accent: rgba(233, 30, 99, 0.25);
}

/* Hardness Converter Theme - Brown */
.page-hardness {
    --page-accent: #795548;
    --page-accent-light: #8D6E63;
    --page-accent-dark: #6D4C41;
    --page-gradient: linear-gradient(135deg, #795548 0%, #8D6E63 100%);
    --page-shadow: rgba(121, 85, 72, 0.3);
    --page-hover-shadow: rgba(121, 85, 72, 0.4);
    --page-bg-accent: rgba(121, 85, 72, 0.08);
    --page-border-accent: rgba(121, 85, 72, 0.25);
}

/* Apply theme styling to converter pages */
[class*="page-"] .page-header h1 {
    color: var(--page-accent);
    background: var(--page-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

[class*="page-"] .page-header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--page-gradient);
    border-radius: 2px;
}

[class*="page-"] .converter-box {
    border: 2px solid var(--page-border-accent);
    background: linear-gradient(145deg, var(--card) 0%, var(--page-bg-accent) 100%);
}

[class*="page-"] .converter-box:hover {
    border-color: var(--page-accent);
    box-shadow: 0 8px 32px var(--page-shadow);
}

[class*="page-"] .converter-header h2 {
    color: var(--page-accent);
}

[class*="page-"] .swap-btn {
    background: var(--page-gradient);
    box-shadow: 0 4px 15px var(--page-shadow);
}

[class*="page-"] .swap-btn:hover {
    box-shadow: 0 8px 25px var(--page-hover-shadow);
}

[class*="page-"] select:focus,
[class*="page-"] input:focus {
    border-color: var(--page-accent);
    box-shadow: 0 0 0 2px var(--page-bg-accent);
}

[class*="page-"] .result-container input {
    border-color: var(--page-accent);
    color: var(--page-accent);
}

[class*="page-"] .result-container input.copied {
    background: var(--page-gradient);
    border-color: var(--page-accent);
}

[class*="page-"] .copy-icon {
    color: var(--page-accent);
}

[class*="page-"] .info-card h3 {
    color: var(--page-accent);
}

[class*="page-"] .scale-item,
[class*="page-"] .freq-item,
[class*="page-"] .angle-item,
[class*="page-"] .volume-item {
    border-left-color: var(--page-accent);
    background: var(--page-bg-accent);
}

[class*="page-"] .scale-item h4,
[class*="page-"] .freq-item h4,
[class*="page-"] .angle-item h4,
[class*="page-"] .volume-item h4 {
    color: var(--page-accent);
}

[class*="page-"] .reference-table th {
    background: var(--page-bg-accent);
    color: var(--page-accent);
}

[class*="page-"] .formula-item {
    border-left-color: var(--page-accent);
    background: var(--page-bg-accent);
}

[class*="page-"] .formula-item h4 {
    color: var(--page-accent);
}

[class*="page-"] .app-item h4,
[class*="page-"] .app-sector h4,
[class*="page-"] .app-area h4 {
    color: var(--page-accent);
}

/* Page-specific icon styling */
[class*="page-"] .page-header h1 i {
    background: var(--page-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px var(--page-shadow));
}

.centered-title {
        text-align: center;
    }

/* Homepage-specific converter card styling - bigger icons next to titles */
body:has(.converters-grid) .converter-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 140, 66, 0.1);
    text-align: left;
}

body:has(.converters-grid) .converter-icon {
    font-size: 2.5rem;
    min-width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.2);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

body:has(.converters-grid) .converter-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    flex: 1;
}

body:has(.converters-grid) .converter-card:hover .converter-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(255, 140, 66, 0.3);
}

/* Enhanced individual converter icon themes for homepage */
body:has(.converters-grid) .converter-card:nth-child(1) .converter-icon {
    background: linear-gradient(135deg, #ff6b42 0%, #ff8c42 100%);
}

body:has(.converters-grid) .converter-card:nth-child(2) .converter-icon {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
}

body:has(.converters-grid) .converter-card:nth-child(3) .converter-icon {
    background: linear-gradient(135deg, #2196F3 0%, #42A5F5 100%);
}

body:has(.converters-grid) .converter-card:nth-child(4) .converter-icon {
    background: linear-gradient(135deg, #9C27B0 0%, #AB47BC 100%);
}

body:has(.converters-grid) .converter-card:nth-child(5) .converter-icon {
    background: linear-gradient(135deg, #FF9800 0%, #FFB74D 100%);
}

body:has(.converters-grid) .converter-card:nth-child(6) .converter-icon {
    background: linear-gradient(135deg, #E91E63 0%, #EC407A 100%);
}

body:has(.converters-grid) .converter-card:nth-child(7) .converter-icon {
    background: linear-gradient(135deg, #795548 0%, #8D6E63 100%);
}

/* Mobile responsiveness for homepage converter headers */
@media (max-width: 768px) {
    body:has(.converters-grid) .converter-header {
        gap: 0.8rem;
    }

    body:has(.converters-grid) .converter-icon {
        font-size: 2.2rem;
        min-width: 3rem;
        height: 3rem;
    }

    body:has(.converters-grid) .converter-header h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    body:has(.converters-grid) .converter-header {
        gap: 0.6rem;
        flex-direction: column;
        text-align: center;
    }

    body:has(.converters-grid) .converter-icon {
        font-size: 2rem;
        min-width: 2.8rem;
        height: 2.8rem;
    }

    body:has(.converters-grid) .converter-header h2 {
        font-size: 1.15rem;
    }

    body:has(.converters-grid) .converter-btn {
        padding: 0.75rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Homepage-specific unit-tag styling - non-button colors */
body:has(.converters-grid) .unit-tag {
    display: none; /* Hide unit tags on homepage */
}

/* Homepage-specific converter card responsive design */
body:has(.converters-grid) .converter-card {
    display: flex;
    flex-direction: column;
    min-height: 200px; /* Reduced minimum height */
    max-height: none; /* Remove max height restriction */
    height: auto; /* Allow natural height */
    padding: 1.5rem;
}

body:has(.converters-grid) .converter-description {
    flex: 1; /* Take available space */
    margin-bottom: 1.5rem; /* Ensure space for button */
    min-height: auto; /* Remove fixed height */
    height: auto; /* Allow natural height */
    -webkit-line-clamp: none; /* Remove line clamping */
    display: block; /* Change from -webkit-box to block */
    overflow: visible; /* Allow full text to show */
}

body:has(.converters-grid) .converter-actions {
    margin-top: auto; /* Push to bottom */
    flex-shrink: 0; /* Don't shrink the action area */
}

body:has(.converters-grid) .converter-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    min-height: 44px; /* Ensure minimum touch target */
}

/* Responsive grid adjustments for homepage */
@media (max-width: 1200px) {
    body:has(.converters-grid) .converters-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    body:has(.converters-grid) .converters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 500px;
        margin: 0 auto 4rem;
    }

    body:has(.converters-grid) .converter-card {
        min-height: 180px;
        padding: 1.25rem;
    }

    body:has(.converters-grid) .converter-header h2 {
        font-size: 1.15rem;
    }

    body:has(.converters-grid) .converter-description {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }

    body:has(.converters-grid) .converter-btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body:has(.converters-grid) .converter-card {
        min-height: 160px;
        padding: 1rem;
    }

    body:has(.converters-grid) .converter-header {
        margin-bottom: 0.75rem;
    }

    body:has(.converters-grid) .converter-header h2 {
        font-size: 1.1rem;
    }

    body:has(.converters-grid) .converter-description {
        font-size: 0.82rem;
        margin-bottom: 1rem;
        line-height: 1.3;
    }

    body:has(.converters-grid) .converter-btn {
        padding: 0.75rem 0.8rem;
        font-size: 0.85rem;
        min-height: 42px;
    }
}

/* Mobile Unified Navigation Menu */
.mobile-nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--card) 0%, #362a22 100%);
    border-top: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1500; /* Increased z-index for mobile */
    animation: slideDown 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-nav-menu.active {
    display: block;
}

.mobile-nav-content {
    padding: 1rem 0;
}

.mobile-nav-section {
    margin-bottom: 1.5rem;
}

.mobile-nav-section:last-child {
    margin-bottom: 0;
}

.mobile-nav-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 1rem 0.75rem 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 140, 66, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-nav-section-title i {
    font-size: 1.1rem;
    opacity: 0.8;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.mobile-nav-link i {
    font-size: 1.2rem;
    min-width: 20px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    background: rgba(255, 140, 66, 0.1);
    border-left-color: var(--accent);
    color: var(--accent);
    padding-left: 2rem;
}

.mobile-nav-link:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.mobile-nav-link.active {
    background: rgba(255, 140, 66, 0.15);
    border-left-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.mobile-nav-link.active i {
    opacity: 1;
    color: var(--accent);
}

.mobile-nav-link.active span {
    color: var(--accent) !important;
    font-weight: 600;
}

/* Mobile Navigation Menu - Responsive Adjustments */
@media (max-width: 768px) {
    /* Hide the desktop nav-links on mobile */
    .nav-links {
        display: none !important;
    }

    /* Show the hamburger menu on mobile */
    .nav-toggle {
        display: flex;
    }

    /* Hide desktop converter navigation buttons on mobile */
    .converter-nav-buttons {
        display: none !important;
    }

    /* Show converter dropdown toggle on mobile */
    .converter-dropdown-toggle {
        display: flex !important;
    }

    /* Ensure converter dropdown menu works on mobile */
    .converter-dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, var(--card) 0%, #362a22 100%);
        border-top: 1px solid var(--border);
        border-radius: 0 0 12px 12px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(10px);
        z-index: 1500;
        animation: slideDown 0.3s ease;
        max-height: 70vh;
        overflow-y: auto;
    }

    .converter-dropdown-menu.active {
        display: block !important;
    }

    /* Ensure main navigation dropdown works on mobile */
    .mobile-nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, var(--card) 0%, #362a22 100%);
        border-top: 1px solid var(--border);
        border-radius: 0 0 12px 12px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(10px);
        z-index: 1500;
        animation: slideDown 0.3s ease;
        max-height: 80vh;
        overflow-y: auto;
    }

    .mobile-nav-menu.active {
        display: block !important;
    }

    /* Adjust main content for mobile - account for both navbars */
    .main-content {
        margin-top: 120px !important;
        padding-top: 0;
    }

    /* Mobile nav content styling */
    .mobile-nav-content {
        padding: 1rem 0;
    }

    .mobile-nav-section {
        margin-bottom: 1.5rem;
    }

    .mobile-nav-section:last-child {
        margin-bottom: 0;
    }

    .mobile-nav-section-title {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        color: var(--accent);
        font-size: 1rem;
        font-weight: 700;
        margin: 0 1rem 0.75rem 1rem;
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(255, 140, 66, 0.2);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mobile-nav-section-title i {
        font-size: 1.1rem;
        opacity: 0.8;
    }

    .mobile-nav-link {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1.5rem;
        color: var(--text);
        text-decoration: none;
        font-size: 0.95rem;
        font-weight: 500;
        transition: all 0.3s ease;
        border-left: 3px solid transparent;
    }

    .mobile-nav-link i {
        font-size: 1.2rem;
        min-width: 20px;
        opacity: 0.8;
        transition: all 0.3s ease;
    }

    .mobile-nav-link:hover {
        background: rgba(255, 140, 66, 0.1);
        border-left-color: var(--accent);
        color: var(--accent);
        padding-left: 2rem;
    }

    .mobile-nav-link:hover i {
        opacity: 1;
        transform: scale(1.1);
    }

    .mobile-nav-link.active {
        background: rgba(255, 140, 66, 0.15);
        border-left-color: var(--accent);
        color: var(--accent);
        font-weight: 600;
    }

    .mobile-nav-link.active i {
        opacity: 1;
        color: var(--accent);
    }

    .mobile-nav-link.active span {
        color: var(--accent) !important;
        font-weight: 600;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.5rem;
    }

    .nav-brand {
        font-size: 1.1rem;
    }

    /* Ensure dropdowns work on very small screens too */
    .mobile-nav-menu.active {
        display: block !important;
    }

    .converter-dropdown-menu.active {
        display: block !important;
    }

    /* Adjust main content for very small mobile screens */
    .main-content {
        margin-top: 120px !important; /* Keep both navbars accounted for */
        padding-top: 0;
    }
}

