:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    width: 100%;
    padding: 0 1rem;
    flex: 1;
}

/* Typography */
h1 {
    font-size: 1.25rem;
    color: #000;
    text-align: center;
}

h2 {
    color: #ff6b6b;
    font-size: 1.125rem;
}

h3 {
    color: #000;
    font-size: 1rem;
}

h4 {
    color: #000;
    font-size: 0.9375rem;
}

.section-title {
    display: block;
    font-size: 1.25rem;
    color: #000;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--teal);
    font-weight: bold;
}

.sub-title {
    display: block;
    font-size: 1rem;
    color: #000;
    margin-bottom: 0.75rem;
    font-weight: bold;
}

@media (min-width: 768px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    h4 { font-size: 1rem; }
    .section-title { font-size: 1.25rem; }
    .sub-title { font-size: 1.125rem; }
}

@media (min-width: 1025px) {
    h2 { font-size: 1.375rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
}

@media (max-width: 767px) {
    h2 { font-size: 1.125rem; }
}

/* Layout */
.main-layout {
    display: grid;
    gap: 1.5rem;
}

/* Calculator Styles */
.calculator {
    background-color: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.calculator-section {
    background-color: var(--light-bg);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #000;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s;
    color: #000;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}

/* Modern Formula Selector */
.formula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.formula-option {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #000;
}

.formula-option:hover {
    border-color: var(--teal);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.formula-option.active {
    border-color: var(--accent);
    background-color: rgba(61, 90, 128, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.formula-icon {
    font-size: 1.375rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.formula-name {
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: #000;
}

.formula-desc {
    font-size: 0.85rem;
    color: #000;
}

/* Unit toggle */
.unit-toggle {
    display: flex;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.unit-toggle button {
    flex: 1;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: #000;
}

.unit-toggle button.active {
    background-color: var(--accent);
    color: white;
}

/* Height and weight groups */
.height-weight-group {
    display: flex;
    gap: 1rem;
}

.height-weight-group .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Results */
.results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 480px) {
    .results {
        grid-template-columns: repeat(2, 1fr);
    }
}

.result-card {
    background-color: white;
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
    border-left: 4px solid var(--teal);
    transition: transform 0.3s ease;
    color: #000;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

.result-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--accent);
    margin: 0.5rem 0;
}

/* Buttons */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    padding: 0.85rem 1.6rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    flex: 1;
    min-width: 120px;
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
    flex: 1;
    min-width: 120px;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    flex: 1;
    min-width: 120px;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-3px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Ad Zones */
.ad-container {
    background: linear-gradient(145deg, #eef2f5, #e2e8ec);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #000;
    font-style: italic;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

#ad-left {
    width: 300px;
    height: 250px;
}

#ad-right {
    width: 300px;
    height: 600px;
}

#ad-tablet {
    width: 300px;
    height: 250px;
    margin: 0 auto;
}

#ad-mobile {
    width: 320px;
    height: 100px;
    margin: 0 auto;
}

/* Related Tools */
.related-tools {
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.related-tools .section-title {
    margin-bottom: 1.25rem;
}

.tools-list {
    list-style: none;
}

.tools-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.tools-list li:last-child {
    border-bottom: none;
}

.tools-list a {
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tools-list a:hover {
    color: var(--secondary);
}

/* Chart container */
.chart-container {
    margin-top: 1.5rem;
    height: 250px;
    position: relative;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
}

/* Result unit toggle */
.result-unit-toggle {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    align-items: center;
    gap: 1rem;
}

.unit-toggle-btn {
    background: white;
    border: 2px solid var(--accent);
    border-radius: 30px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #000;
}

.unit-toggle-btn.active {
    background-color: var(--accent);
    color: white;
}

.unit-toggle-btn span {
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 15px;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Compact Barometer */
.barometer-container {
    margin: 1.5rem 0;
    background: white;
    border-radius: 10px;
    padding: 1.2rem;
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
}

.barometer-title {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: bold;
}

.barometer {
    position: relative;
    width: 100%;
    height: 60px;
    background: linear-gradient(90deg, #4CAF50, #FFC107, #FF5722);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.barometer-scale {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    margin-top: 5px;
    color: #000;
    font-size: 0.75rem;
}

.barometer-needle {
    position: absolute;
    top: -5px;
    width: 2px;
    height: 70px;
    background: var(--primary);
    transform-origin: bottom center;
    transition: transform 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

.barometer-needle::after {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 4px rgba(0,0,0,0.2);
}

.barometer-value {
    text-align: center;
    margin-top: 0.8rem;
    font-size: 1rem;
    font-weight: bold;
    color: var(--accent);
}

.barometer-label {
    text-align: center;
    color: #000;
    margin-top: 0.3rem;
    font-size: 0.9rem;
}

/* Responsive Layouts */
/* Mobile (default) */
.main-layout {
    grid-template-areas:
        "calculator"
        "mobile-ad"
        "related-tools";
}

#ad-left, #ad-right, #ad-tablet {
    display: none;
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .main-layout {
        grid-template-areas:
            "calculator"
            "tablet-ad"
            "related-tools";
    }
    
    #ad-tablet {
        display: flex;
        margin-top: 10px;
    }
    
    #ad-mobile, #ad-left, #ad-right {
        display: none;
    }
    
    .btn-group {
        flex-wrap: nowrap;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .main-layout {
        grid-template-columns: 300px 1fr 300px;
        grid-template-areas: "left-sidebar calculator right-sidebar";
    }
    
    #ad-left, #ad-right {
        display: flex;
    }
    
    #ad-mobile, #ad-tablet {
        display: none;
    }
    
    /* Fix for sticky alignment */
    #left-sidebar {
        position: sticky;
        top: 20px;
        display: flex;
        flex-direction: column;
        gap: 20px;
        height: 100vh;
        overflow-y: auto;
    }
    
    .related-tools-desktop {
        margin-top: 0;
    }
    
    .related-tools-mobile {
        display: none;
    }
    
    #ad-right {
        position: sticky;
        top: 20px;
    }
}

/* Assign grid areas */
#converter-tool { grid-area: calculator; }
#ad-mobile { grid-area: mobile-ad; }
#ad-tablet { grid-area: tablet-ad; }
.related-tools-mobile { grid-area: related-tools; }
#ad-left { grid-area: left-sidebar; }
#ad-right { grid-area: right-sidebar; }

/* Hidden results */
.results-section {
    display: none;
}

/* Plain report styling */
.plain-report {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    color: #000;
}
.plain-report h1 {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: #000;
}
.plain-report h2 {
    color: #ff6b6b;
}
.plain-report .result {
    font-weight: bold;
}
.plain-report .section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #ccc;
}
/* Add breadcrumb styles */
.breadcrumb {
    padding: 0px 10px;
    color: #000;
    margin-bottom: 5px;
    font-size: 1rem;
}

.breadcrumb a {
    color: #000;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--secondary);
    text-decoration: underline;
}
    .mobile-table {
      overflow-x: auto;
      margin: 20px 0;
      border: 1px solid #eee;
      border-radius: 8px;
    }
    .mobile-table table {
      width: 100%;
      min-width: 600px;
      border-collapse: collapse;
    }
    .mobile-table th, .mobile-table td {
      padding: 12px 15px;
      text-align: left;
      border-bottom: 1px solid #eee;
      color: #000;
    }
    .mobile-table th {
      background-color: #4ecdc4;
      font-weight: bold;
      font-size: 1rem;
    }
    .mobile-table tr:nth-child(even) {
      background-color: #fafafa;
    }