:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
    --shadow: 0 2px 8px 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-color: var(--light-bg);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

/* Main Content Area */
.main-content {
   
}

/* Calculator Styling */
.calculator {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 20px;
}

h1 {
    font-size: 1.25rem;
    color: #000;
    margin-bottom: 20px;
    text-align: center;
}

h2 {
    font-size: 1.125rem;
    color: #ff6b6b;
    margin: 20px 0 15px;
    padding-bottom: 8px;
}

h3 {
    font-size: 1rem;
    color: #000;
    margin: 15px 0 10px;
}

h4 {
    font-size: 1.125rem;
    color: #000;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #000;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    color: #000;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(61, 90, 128, 0.2);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-col {
    flex: 1;
    padding: 0 10px;
    min-width: 200px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    overflow: hidden;
    color: #000;
}

.btn-calculate {
    background-color: var(--teal);
    color: white;
}

.btn-calculate:hover {
    background-color: #3bb4ad;
}

.btn-reset {
    background-color: var(--secondary);
    color: white;
}

.btn-reset:hover {
    background-color: #ff5252;
}

.btn-export {
    background-color: var(--accent);
    color: white;
    padding: 8px 15px;
    font-size: 1rem;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn-export:hover {
    background-color: #2c4870;
}

/* 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 0.8s ease-in-out infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Styling */
.results {
    margin-top: 30px;
    display: none;
}

.results.active {
    display: block;
}

.zone-card {
    background-color: var(--light-bg);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid var(--teal);
}

.zone-card h4 {
    margin-bottom: 10px;
    color: #000;
}

.zone-card p {
    margin-bottom: 5px;
    color: #000;
}

.zone-bpm {
    font-weight: bold;
    color: #000;
}

.zone-graph {
    margin-top: 20px;
    height: 40px;
    background: linear-gradient(to right, 
        #4ecdc4 0%, #4ecdc4 20%, 
        #45b7d1 20%, #45b7d1 40%, 
        #3d5a80 40%, #3d5a80 60%, 
        #ff9e5e 60%, #ff9e5e 80%, 
        #ff6b6b 80%, #ff6b6b 100%);
    border-radius: 4px;
    position: relative;
}

.zone-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.875rem;
    color: #000;
}

/* Heart Rate Pie Chart */
.heart-rate-pie-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 25px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.pie-chart-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.pie-chart {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(
        #4ecdc4 0% 20%,
        #45b7d1 20% 40%,
        #3d5a80 40% 60%,
        #ff9e5e 60% 80%,
        #ff6b6b 80% 100%
    );
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    line-height: 1.2;
    font-size: 0.8rem;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 300px;
}

.legend-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
    cursor: pointer;
    color: #000;
}

.legend-item:hover {
    background-color: var(--light-bg);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 10px;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-text {
    flex: 1;
    font-size: 1rem;
    color: #000;
}

.legend-percentage {
    font-weight: bold;
    color: #000;
    font-size: 1rem;
}

.zone-details {
    margin-top: 20px;
    width: 100%;
    max-width: 500px;
}

.zone-detail-card {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #4ecdc4;
    display: none;
}

.zone-detail-card.active {
    display: block;
}

.zone-detail-card h4 {
    margin-bottom: 8px;
    color: #000;
}

.zone-detail-card p {
    margin-bottom: 5px;
    font-size: 1rem;
    color: #000;
}

/* Export Section */
.export-section {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.export-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

/* Related Tools Styling */
#related-tools {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.tools-list {
    list-style: none;
}

.tools-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    color: #000;
}

.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);
}

/* Plain Text Results for Export */
#plain-text-results {
    display: none;
    white-space: pre-line;
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.6;
    padding: 20px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: #000;
}

/* Ad Zones */
.ad-zone {
    background-color: white;
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    text-align: center;
    margin-bottom: 20px;
}

#ad-left, #ad-right {
    width: 300px;
}

#ad-left {
    height: 250px;
}

#ad-right {
    height: 600px;
}

#ad-tablet, #ad-mobile {
    display: none;
    margin: 0 auto;
}

#ad-tablet {
    width: 300px;
    height: 250px;
}

#ad-mobile {
    width: 320px;
    height: 100px;
}

/* 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 Layout (≤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;
    }
    
    #ad-mobile, #related-tools {
        display: block;
    }
    
    #ad-left, #ad-right, #ad-tablet, .left-sidebar #related-tools {
        display: none;
    }
    
    #ad-mobile {
        margin-top: 20px;
    }
    
    #related-tools {
        margin: 20px auto 20px;
    }

    .pie-chart-wrapper {
        flex-direction: column;
    }

    .pie-legend {
        max-width: 100%;
    }
}

/* Tablet Layout (768px–1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .main-content {
        display: flex;
        flex-direction: column;
    }
    
    h2 {
        font-size: 1.25rem;
        color: #ff6b6b;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    h4 {
        font-size: 1rem;
    }
    
    #ad-tablet, #related-tools {
        display: block;
    }
    
    #ad-left, #ad-right, #ad-mobile, .left-sidebar #related-tools {
        display: none;
    }
    
    #ad-tablet {
        margin-top: 20px;
    }
    
    #related-tools {
        margin: 20px auto 20px;
    }
}

/* Desktop Layout (≥1025px) */
@media (min-width: 1025px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.375rem;
        color: #ff6b6b;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h4 {
        font-size: 1.125rem;
    }
    
    .main-content {
        display: grid;
        grid-template-columns: 300px 1fr 300px;
        gap: 20px;
        align-items: flex-start;
    }
    
    .calculator {
        grid-column: 2;
    }
    
    .left-sidebar {
        grid-column: 1;
        position: sticky;
        top: 20px;
        align-self: flex-start;
        height: fit-content;
    }
    
    .right-sidebar {
        grid-column: 3;
        position: sticky;
        top: 20px;
        align-self: flex-start;
        height: fit-content;
    }
    
    #ad-left, #ad-right, .left-sidebar #related-tools {
        display: flex;
        flex-direction: column;
    }
    
    #ad-tablet, #ad-mobile, .container > #related-tools {
        display: none;
    }
}

.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;
    color: #000;
}

.mobile-table td {
    font-size: 1rem;
}

.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}