:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

/* More specific reset - avoid affecting header */
.calculator-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* If you need global box-sizing, use this instead */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Remove universal margin/padding reset and apply only to specific elements */
.calculator-wrapper {
    margin: 0;
    padding: 0;
}

/* Modified body styles - less aggressive */
body:not(.custom-header-body) {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Alternative: Only apply to main content area */
.main-content {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0 20px;
}

/* ========================================
   HEADING STYLES - H1, H2, H3, H4
   ======================================== */

/* Desktop H1 */
h1 {
    font-size: 1.5rem;
    color: #000;
    margin-bottom: 1rem;
    font-weight: bold;
}

/* Desktop H2 - RED COLOR */
h2 {
    font-size: 1.375rem;
    color: #ff6b6b !important;
    margin-bottom: 1rem;
    font-weight: bold;
}

/* Desktop H3 */
h3 {
    font-size: 1.25rem;
    color: #000;
    margin-bottom: 1rem;
    font-weight: bold;
}

/* Desktop H4 */
h4 {
    font-size: 1.125rem;
    color: #000;
    margin-bottom: 1rem;
    font-weight: bold;
}

/* SUPER STRONG H2 COLOR RULES - Multiple selectors to catch all h2 elements */
h2,
.calculator-wrapper h2,
.calculator h2,
.main-content h2,
.container h2,
.content-wrapper h2,
h2.calculator-wrapper,
h2[class],
h2[id],
div h2,
section h2,
article h2,
*:not(style):not(script) h2 {
    color: #ff6b6b !important;
}

/* Scope typography to calculator area only */
.calculator-wrapper h1, 
.calculator-wrapper h3,
.calculator-wrapper h4 {
    color: #000;
    margin-bottom: 1rem;
    font-weight: bold;
}

.calculator-wrapper h2 {
    color: #ff6b6b !important;
    margin-bottom: 1rem;
    font-weight: bold;
}

.calculator h1 {
    font-size: 1.5rem;
    color: #000;
}

.calculator-wrapper h2 {
    font-size: 1.375rem;
    color: #ff6b6b !important;
}

.calculator-wrapper h3 {
    font-size: 1.25rem;
    color: #000;
}

.calculator-wrapper h4 {
    font-size: 1.125rem;
    color: #000;
}

.calculator-wrapper p {
    margin-bottom: 1rem;
    color: #000;
}

/* Calculator Styling */
.calculator {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    width: 100%;
    text-align: center;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 1.2rem;
}

.calculator label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #000;
    font-size: 1rem;
}

.calculator input, 
.calculator select, 
.calculator button {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    color: #000;
}

.calculator button {
    background-color: var(--teal);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    margin-top: 28px;
    font-size: 1rem;
}

.calculator button:hover {
    background-color: #3db9b1;
}

.calculator button.reset {
    background-color: #ff6b6b;
}

.calculator button.reset:hover {
    background-color: #555;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 1.5rem;
}

.results {
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
    display: none;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 1.5rem;
}

.result-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.result-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--teal);
    margin: 0.5rem 0;
}

/* Ad Styling */
.ad-container {
    background-color: #e9ecef;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--border-radius);
    overflow: hidden;
    color: var(--text-light);
    font-style: italic;
    font-size: 1rem;
}

#ad-left, #ad-right, #ad-tablet, #ad-mobile {
    display: none;
}

#ad-left, #ad-right {
    position: sticky;
    top: 20px;
}

/* Related Tools */
.related-tools {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.related-tools h2 {
    font-size: 1.25rem;
    color: #ff6b6b !important;
}

.tools-list {
    list-style: none;
}

.tools-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
    color: #000;
}

.tools-list li:last-child {
    border-bottom: none;
}

.tools-list a {
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
}

.tools-list a:hover {
    color: var(--secondary);
}

.tools-list i {
    font-size: 1.125rem;
}

/* Tabs */
.calculator .tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.calculator .tab {
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-light);
    font-weight: bold;
    width: auto;
    font-size: 1rem;
}

.calculator .tab.active {
    color: var(--accent);
    border-bottom: 3px solid var(--accent);
}

.calculator .tab-content {
    display: none;
}

.calculator .tab-content.active {
    display: block;
}

/* Chart Container */
.chart-container {
    height: 300px;
    margin: 1.5rem 0;
}

/* Export Buttons */
.export-options {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.export-btn {
    flex: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--light-bg);
    color: #000;
    border: 1px solid var(--border-color);
    font-size: 1rem;
}

.export-btn:hover {
    background-color: #e2e6ea;
}

/* Schedule Toggle */
.schedule-toggle {
    display: flex;
    gap: 10px;
    margin: 1rem 0;
    background: var(--light-bg);
    padding: 10px;
    border-radius: 4px;
}

.schedule-toggle button {
    flex: 1;
    padding: 8px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    color: #000;
    font-size: 1rem;
}

.schedule-toggle button.active {
    background: var(--teal);
    color: white;
    border-color: var(--teal);
}

/* Table Styling */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 1rem;
}

.schedule-table th {
    background-color: var(--light-bg);
    padding: 0.8rem;
    text-align: left;
    font-weight: bold;
    position: sticky;
    top: 0;
    font-size: 1rem;
    color: #000;
}

.schedule-table td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    color: #000;
    font-size: 1rem;
}

.schedule-table tr:nth-child(even) {
    background-color: #fcfcfc;
}

.schedule-table .highlight {
    background-color: rgba(78, 205, 196, 0.1);
    font-weight: bold;
}

/* Spinner styling */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.schedule-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.export-notice {
    background-color: #f8f9fa;
    border-left: 4px solid var(--teal);
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 1rem;
    color: #000;
}

.date-cell {
    white-space: nowrap;
}

/* Add breadcrumb styles */
.breadcrumb {
    padding: 0 10px;
    color: var(--gray);
    margin-bottom: 5px;
    font-size: 1rem;
}

.breadcrumb a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 1rem;
}

.breadcrumb a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

/* MOBILE: max-width 767px */
@media (max-width: 767px) {
    /* Mobile H1 */
    h1 {
        font-size: 1.25rem;
        color: #000;
    }
    
    /* Mobile H2 - RED COLOR */
    h2 {
        font-size: 1.125rem;
        color: #ff6b6b !important;
    }
    
    /* Mobile H3 */
    h3 {
        font-size: 1rem;
        color: #000;
    }
    
    /* Mobile H4 */
    h4 {
        font-size: 0.9375rem;
        color: #000;
    }
    
    /* STRONG H2 COLOR FOR MOBILE */
    h2,
    .calculator-wrapper h2,
    .calculator h2,
    .main-content h2,
    .container h2,
    .content-wrapper h2,
    h2.calculator-wrapper,
    h2[class],
    h2[id],
    div h2,
    section h2,
    article h2,
    *:not(style):not(script) h2 {
        color: #ff6b6b !important;
        font-size: 1.125rem !important;
    }
    
    .calculator-wrapper h1 { 
        font-size: 1.25rem;
        color: #000;
    }
    .calculator-wrapper h2 { 
        font-size: 1.125rem;
        color: #ff6b6b !important;
    }
    .calculator-wrapper h3 { 
        font-size: 1rem;
        color: #000;
    }
    .calculator-wrapper h4 { 
        font-size: 0.9375rem;
        color: #000;
    }
    
    .calculator {
        transform: none !important;
        transition: none !important;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
        padding: 1rem;
        margin-top: 0px !important;
    }
    
    .container {
        padding: 10px;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .calculator input, 
    .calculator select, 
    .calculator button {
        padding: 0.7rem;
        max-width: 100%;
        box-sizing: border-box;
        word-wrap: break-word;
        font-size: 1rem;
    }
    
    .calculator .tab {
        font-size: 0.875rem;
    }
    
    .results {
        max-width: 100%;
        overflow-x: auto;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .schedule-table-container {
        max-width: 100%;
        overflow-x: auto;
    }
    
    .export-options {
        flex-direction: column;
        gap: 8px;
    }
    
    .export-btn {
        min-width: auto;
        width: 100%;
    }
    
    .calculator .tabs {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .calculator .tab {
        flex-shrink: 0;
        min-width: auto;
    }
    
    #ad-mobile {
        display: flex;
        height: 100px;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .mobile-tablet-tools {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-top: 20px;
    }
    
    .left-sidebar .related-tools {
        display: none;
    }
    
    .schedule-table {
        font-size: 1rem;
    }
    
    .schedule-table th, 
    .schedule-table td {
        padding: 0.5rem;
        font-size: 1rem;
    }
    
    .button-group {
        grid-template-columns: 1fr;
        margin-top: 0;
    }
    
    .calculator-grid {
        gap: 15px;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 8px;
    }
    
    .calculator {
        padding: 1rem;
        margin-top: 0px !important;
    }
    
    .calculator input, 
    .calculator select, 
    .calculator button {
        padding: 0.6rem;
        font-size: 1rem;
    }
    
    .form-group {
        margin-bottom: 0.8rem;
    }
}

/* TABLET: 768px to 1024px */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Tablet H1 */
    h1 {
        font-size: 1.5rem;
        color: #000;
    }
    
    /* Tablet H2 - RED COLOR */
    h2 {
        font-size: 1.25rem;
        color: #ff6b6b !important;
    }
    
    /* Tablet H3 */
    h3 {
        font-size: 1.125rem;
        color: #000;
    }
    
    /* Tablet H4 */
    h4 {
        font-size: 1rem;
        color: #000;
    }
    
    /* STRONG H2 COLOR FOR TABLET */
    h2,
    .calculator-wrapper h2,
    .calculator h2,
    .main-content h2,
    .container h2,
    .content-wrapper h2,
    h2.calculator-wrapper,
    h2[class],
    h2[id],
    div h2,
    section h2,
    article h2,
    *:not(style):not(script) h2 {
        color: #ff6b6b !important;
        font-size: 1.25rem !important;
    }
    
    .calculator-wrapper h2 { 
        font-size: 1.25rem;
        color: #ff6b6b !important;
    }
    .calculator-wrapper h3 { 
        font-size: 1.125rem;
        color: #000;
    }
    .calculator-wrapper h4 { 
        font-size: 1rem;
        color: #000;
    }
    
    .content-wrapper {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .calculator {
        width: 100%;
        margin-top: 0px !important;
    }
    
    #ad-tablet {
        display: flex;
        height: 250px;
        width: 300px;
        margin: 0 auto;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .mobile-tablet-tools {
        align-items: center;
        gap: 20px;
        width: 100%;
        margin-top: 20px;
    }
    
    .left-sidebar .related-tools {
        display: none;
    }
}

/* DESKTOP: min-width 1025px */
@media (min-width: 1025px) {
    /* Desktop H1 */
    h1 {
        font-size: 1.5rem;
        color: #000;
    }
    
    /* Desktop H2 - RED COLOR */
    h2 {
        font-size: 1.375rem;
        color: #ff6b6b !important;
    }
    
    /* Desktop H3 */
    h3 {
        font-size: 1.25rem;
        color: #000;
    }
    
    /* Desktop H4 */
    h4 {
        font-size: 1.125rem;
        color: #000;
    }
    
    /* STRONG H2 COLOR FOR DESKTOP */
    h2,
    .calculator-wrapper h2,
    .calculator h2,
    .main-content h2,
    .container h2,
    .content-wrapper h2,
    h2.calculator-wrapper,
    h2[class],
    h2[id],
    div h2,
    section h2,
    article h2,
    *:not(style):not(script) h2 {
        color: #ff6b6b !important;
        font-size: 1.375rem !important;
    }
    
    .content-wrapper {
        flex-direction: row;
    }
    
    .left-sidebar {
        width: 300px;
        order: 1;
        position: sticky;
        top: 20px;
        height: fit-content;
        align-self: flex-start;
    }
    
    .calculator {
        flex: 1;
        order: 2;
    }
    
    .right-sidebar {
        width: 300px;
        order: 3;
        position: sticky;
        top: 20px;
        height: fit-content;
        align-self: flex-start;
    }
    
    #ad-left, #ad-right {
        display: flex;
        position: static;
    }
    
    #ad-left {
        height: 250px;
        margin-bottom: 20px;
    }
    
    #ad-right {
        height: 600px;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .mobile-tablet-tools {
        display: none;
    }
    
    .left-sidebar .related-tools {
        display: block;
        position: sticky;
        top: 300px;
    }
    
    .calculator-grid > div:last-child {
        display: block;
    }
}

.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;
    font-size: 1rem;
    color: #000;
}
.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}

/* NUCLEAR OPTION - Place at the very end to override everything */
h2 { color: #ff6b6b !important; }
body h2 { color: #ff6b6b !important; }
html h2 { color: #ff6b6b !important; }
* h2 { color: #ff6b6b !important; }