:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Times New Roman', Times, serif;
}

body {
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    background-color: var(--light-bg);
    padding: 0;
    margin: 0;
}

/* Heading styles with responsive font sizes */
h1 {
    color: #000;
    font-size: 1.5rem;
}

/* Global H2 styling - high specificity */
h2,
.calculator-ui h2,
#related-tools h2,
.result-container h2 {
    color: #ff6b6b !important;
    font-size: 1.375rem;
}

h3 {
    color: #000;
    font-size: 1.25rem;
}

h4 {
    color: #000;
    font-size: 1.125rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Ad Styling */
.ad-container {
    background-color: #f0f0f0;
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #000;
    margin-bottom: 20px;
}

#ad-left, #ad-right {
    width: 100%;
    height: 250px;
}

#ad-right {
    height: 600px;
}

#ad-tablet {
    width: 300px;
    height: 250px;
}

#ad-mobile {
    width: 320px;
    height: 100px;
}

/* Related Tools */
#related-tools {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

#related-tools h3 {
    margin-bottom: 15px;
    color: #000;
    font-size: 1.25rem;
}

.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;
}

.tools-list a:hover {
    color: var(--teal);
}

/* Calculator UI */
.calculator-ui {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.calculator-ui h2 {
    color: #ff6b6b !important;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.375rem;
}

.calc-type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.calc-type-btn {
    padding: 10px 15px;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    flex-grow: 1;
    text-align: center;
    transition: all 0.3s ease;
    color: #000;
    font-size: 1rem;
}

.calc-type-btn.active {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #000;
    font-size: 1rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Times New Roman', Times, serif;
    color: #000;
    font-size: 1rem;
}

.input-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
    transition: background-color 0.3s ease;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
    color: #000;
}

.btn-primary {
    background-color: #4ecdc4; /* Teal color for Calculate */
    color: white;
}

.btn-primary:hover {
    background-color: #3dbbb2;
}

.btn-secondary {
    background-color: #ff6b6b; /* Red color for Reset */
    color: white;
}

.btn-secondary:hover {
    background-color: #e55c5c;
}

.btn-export {
    background-color: #3d5a80;
    color: white;
    padding: 8px 15px;
    margin: 5px;
    font-size: 1rem;
}

.btn-export:hover {
    background-color: #2a3f5f;
}

.result-container {
    margin-top: 25px;
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: 4px;
    display: none;
}

.result-container h3 {
    margin-bottom: 10px;
    color: #000;
    font-size: 1.25rem;
}

.result-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #000;
}

.formula-display {
    margin: 15px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-left: 4px solid var(--accent);
    font-style: italic;
    color: #000;
    font-size: 1rem;
}

.export-options {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* Calculation Steps */
.calculation-steps {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid var(--accent);
    color: #000;
    font-size: 1rem;
    margin-bottom: 10px;
}

.step {
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 2px solid var(--teal);
    color: #000;
    font-size: 1rem;
}

/* Responsive Design */
/* Mobile (default) */
#ad-left, #ad-right, #ad-tablet {
    display: none;
}

#ad-mobile {
    display: flex;
    margin: 0 auto 20px;
}

.desktop-sidebar {
    display: none;
}

.mobile-tablet-tools {
    display: block;
}

@media (max-width: 767px) {
    .calculator-ui {
        font-size: 1rem;
        margin-top: 0px;
    }

    /* Mobile heading sizes */
    h1 {
        font-size: 1.25rem;
    }

    /* Mobile H2 styling with !important */
    h2,
    .calculator-ui h2,
    #related-tools h2,
    .result-container h2 {
        font-size: 1.125rem !important;
        color: #ff6b6b !important;
    }

    h3 {
        font-size: 1rem;
    }

    h4 {
        font-size: 0.9375rem;
    }

    #ad-mobile {
        display: flex;
        margin: 10px auto 20px;
    }

    #ad-left, 
    #ad-right, 
    #ad-tablet {
        display: none;
    }

    .mobile-tablet-tools {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }

    #related-tools h3 {
        font-size: 1rem;
    }

    .result-container h3 {
        font-size: 1rem;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .calculator-ui {
        font-size: 1rem;
        margin-top:0px;
    }
    
    /* Tablet heading sizes */
    h1 {
        font-size: 1.5rem;
    }
    
    /* Tablet H2 styling with !important */
    h2,
    .calculator-ui h2,
    #related-tools h2,
    .result-container h2 {
        font-size: 1.25rem !important;
        color: #ff6b6b !important;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    h4 {
        font-size: 1rem;
    }
    
    #ad-mobile, #ad-left, #ad-right {
        display: none;
    }
    
    #ad-tablet {
        display: flex;
        margin: 10px auto 20px;
    }
    
    .mobile-tablet-tools {
        width: 90%;
        max-width: 600px;
        margin: 0 auto;
    }
    
    #related-tools h3 {
        font-size: 1.125rem;
    }
    
    .result-container h3 {
        font-size: 1.125rem;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .calculator-content {
        display: grid;
        grid-template-columns: 300px 1fr 300px;
        gap: 24px;
        align-items: start;
    }
    
    #ad-mobile, #ad-tablet {
        display: none;
    }
    
    #ad-left, #ad-right {
        display: block;
    }
    
    /* Desktop heading sizes */
    h1 {
        font-size: 1.5rem;
    }
    
    /* Desktop H2 styling with !important */
    h2,
    .calculator-ui h2,
    #related-tools h2,
    .result-container h2 {
        font-size: 1.375rem !important;
        color: #ff6b6b !important;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h4 {
        font-size: 1.125rem;
    }
    
    .desktop-sidebar {
        display: flex;
        flex-direction: column;
    }
    
    .calculator-ui {
        margin: 0;
    }

    .mobile-tablet-tools {
        display: none;
    }
    
    /* Make the entire sidebar sticky */
    .desktop-sidebar {
        position: sticky;
        top: 20px;
        height: fit-content;
        max-height: 100vh;
        overflow-y: auto;
    }
}

/* 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;
    font-size: 1rem;
}

.mobile-table th {
    background-color: #4ecdc4;
    font-weight: bold;
    color: #000;
    font-size: 1rem;
}

.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}