:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
}

* {
    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-color: var(--light-bg);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

/* Main layout */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sidebar styles */
.sidebar {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    border: 1px solid var(--border-color);
    color: #000;
    text-align: center;
    font-size: 1rem;
}

#ad-left, #ad-right {
    width: 300px;
    height: 250px;
}

#ad-right {
    height: 600px;
}

#related-tools {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.tools-list {
    list-style: none;
}

.tools-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.tools-list li:last-child {
    border-bottom: none;
}

.tools-list a {
    color: #000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.tools-list a:hover {
    color: var(--teal);
}

/* Calculator styles */
#converter-tool {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 20px;
    flex: 1;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #000;
    text-align: center;
}

h2 {
    font-size: 1.375rem;
    margin: 15px 0 10px;
    color: #ff6b6b;
}

h3 {
    font-size: 1.25rem;
    margin: 10px 0;
    color: #000;
}

h4 {
    font-size: 1.125rem;
    color: #000;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #000;
    font-size: 1rem;
}

input, select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    color: #000;
}

.time-inputs {
    display: flex;
    gap: 10px;
}

.time-inputs input {
    text-align: center;
}

.time-inputs .time-label {
    font-size: 0.875rem;
    color: #000;
    text-align: center;
    margin-top: 5px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    color: #000;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    flex: 1;
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
    flex: 1;
}

.mode-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-btn {
    padding: 8px 15px;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    color: #000;
}

.mode-btn.active {
    background-color: var(--accent);
    color: white;
}

.results {
    background-color: var(--light-bg);
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    display: none;
    color: #000;
}

.export-options {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.export-options h3 {
    margin-bottom: 10px;
    font-size: 1.25rem;
    color: #000;
}

.export-btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.export-btn {
    padding: 8px 15px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.export-btn:hover {
    background-color: var(--primary);
}

@media (max-width: 767px) {
    .export-btn-group {
        flex-direction: column;
    }
    
    .export-btn {
        flex: 1;
        font-size: 0.875rem;
    }
}

/* Distance Options */
.distance-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.distance-btn {
    padding: 6px 12px;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    color: #000;
}

.distance-btn:hover {
    background-color: #e9ecef;
}

.distance-btn.active {
    background-color: var(--teal);
    color: white;
}

/* Mobile ads */
#ad-mobile {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 320px;
    height: 100px;
    margin: 20px auto 0;
    background-color: #f0f0f0;
    border: 1px solid var(--border-color);
    color: #000;
    font-size: 1rem;
}

#ad-tablet {
    display: none;
    justify-content: center;
    align-items: center;
    width: 300px;
    height: 250px;
    margin: 20px auto 0;
    background-color: #f0f0f0;
    border: 1px solid var(--border-color);
    color: #000;
    font-size: 1rem;
}

/* Spinner animation */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Related tools for mobile/tablet */
#related-tools-mobile {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

/* Pie Chart */
.pie-chart-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    position: relative;
}

.pie-chart {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(
        var(--teal) 0% 30%,
        var(--accent) 30% 65%,
        var(--secondary) 65% 100%
    );
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.pie-chart:hover {
    transform: scale(1.05);
}

.pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
    cursor: pointer;
    font-size: 1rem;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
    cursor: pointer;
    color: #000;
}

.legend-item:hover {
    opacity: 0.8;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Conversion Results */
.conversion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.conversion-item {
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #000;
    font-size: 1rem;
}

.conversion-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.conversion-value {
    font-weight: bold;
    color: #000;
    font-size: 1.25rem;
}

/* Distance Conversion Tables */
.distance-conversion-section {
    margin-top: 20px;
}

.distance-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.distance-table th {
    background-color: var(--accent);
    color: white;
    padding: 10px;
    text-align: left;
    font-size: 1rem;
}

.distance-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    color: #000;
    font-size: 1rem;
}

.distance-table tr:last-child td {
    border-bottom: none;
}

.distance-table tr:hover {
    background-color: #f5f5f5;
}

.distance-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1rem;
}

/* Treadmill-specific styles */
.treadmill-input-group {
    display: none;
}

.treadmill-presets {
    display: none;
    margin-bottom: 15px;
}

.treadmill-results {
    display: none;
}

.progress-container {
    margin: 15px 0;
}

.progress-bar {
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background-color: var(--teal);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 1rem;
    color: #000;
}

.toggle-view {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.toggle-btn {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 1rem;
    color: #000;
}

.toggle-btn:hover {
    background-color: #e9ecef;
}

.toggle-btn.active {
    background-color: var(--accent);
    color: white;
}

.toggle-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.toggle-btn:last-child {
    border-radius: 0 4px 4px 0;
}

/* Note for treadmill mode */
.treadmill-note {
    font-size: 1rem;
    color: #000;
    font-style: italic;
    margin-bottom: 15px;
    text-align: center;
    background-color: #f0f8ff;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid var(--teal);
}

/* Validation messages */
.validation-message {
    font-size: 1rem;
    padding: 8px;
    border-radius: 4px;
    margin-top: 5px;
    display: none;
}

.validation-error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 3px solid #f44336;
}

.validation-warning {
    background-color: #fff3e0;
    color: #ef6c00;
    border-left: 3px solid #ff9800;
}

/* Treadmill Slider Styles */
#treadmill-speed-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#treadmill-speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

#treadmill-speed-slider::-webkit-slider-thumb:hover {
    background: var(--primary);
    transform: scale(1.1);
}

#treadmill-speed-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

#treadmill-speed-slider::-moz-range-thumb:hover {
    background: var(--primary);
    transform: scale(1.1);
}

#treadmill-speed-slider::-webkit-slider-track {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
}

#treadmill-speed-slider::-moz-range-track {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    border: none;
}

/* Treadmill Incline Slider Styles */
#treadmill-incline-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#treadmill-incline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

#treadmill-incline-slider::-webkit-slider-thumb:hover {
    background: var(--primary);
    transform: scale(1.1);
}

#treadmill-incline-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

#treadmill-incline-slider::-moz-range-thumb:hover {
    background: var(--primary);
    transform: scale(1.1);
}

#treadmill-incline-slider::-webkit-slider-track {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
}

#treadmill-incline-slider::-moz-range-track {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    border: none;
}

/* Treadmill speed input container */
.treadmill-speed-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.treadmill-speed-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.treadmill-speed-limits {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #000;
}

/* Sticky sidebar for desktop */
@media (min-width: 1025px) {
    .sidebar {
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }
}

/* Responsive styles */
/* Tablet (768px - 1024px) */
@media (min-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
        color: #ff6b6b;
    }

    h3 {
        font-size: 1.125rem;
    }

    h4 {
        font-size: 1rem;
    }

    .main-content {
        display: grid;
        grid-template-columns: 1fr;
    }

    #ad-tablet {
        display: flex;
    }

    #ad-mobile {
        display: none;
    }

    #related-tools-mobile {
        display: block;
    }

    .calculator-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .mode-btn {
        font-size: 1rem;
    }
}

/* Mobile (≤767px) */
@media (max-width: 767px) {
    h1 {
        font-size: 1.25rem;
    }

    h2 {
        font-size: 1.125rem;
        color: #ff6b6b;
    }

    h3 {
        font-size: 1rem;
    }

    h4 {
        font-size: 0.9375rem;
    }

    #related-tools-mobile {
        display: block;
    }
    
    #ad-mobile {
        margin-top: 20px;
    }

    .distance-table {
        font-size: 1rem;
    }

    .distance-table th,
    .distance-table td {
        padding: 6px 8px;
        font-size: 1rem;
    }

    .treadmill-speed-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .treadmill-speed-inputs input[type="range"] {
        order: 1;
    }

    .treadmill-speed-inputs input[type="number"] {
        order: 2;
        width: 100%;
    }

    .treadmill-speed-inputs select {
        order: 3;
        width: 100%;
    }

    .mode-btn {
        font-size: 0.875rem;
    }
}

/* Desktop (≥1025px) */
@media (min-width: 1025px) {
    .main-content {
        grid-template-columns: 300px 1fr 300px;
        gap: 30px;
    }

    .sidebar {
        display: flex;
    }

    #ad-mobile, #ad-tablet, #related-tools-mobile {
        display: none;
    }
}

/* 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;
    font-size: 1rem;
}

.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;
    font-size: 1rem;
    color: #000;
}

.mobile-table th {
    background-color: #4ecdc4;
    font-weight: bold;
    color: white;
}

.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}