/* CSS Variables */
:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
}

/* Base Styles */
* {
    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 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

/* Main Layout */
.main-wrapper {
}

/* Grid Layout */
.grid-container {
    display: grid;
    gap: 0 20px;
}

/* Sidebars */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ad-container {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #000;
}

/* Desktop Ads */
#ad-left {
    width: 300px;
    height: 250px;
}

#ad-right {
    width: 300px;
    height: 600px;
}

/* Tablet Ad */
#ad-tablet {
    width: 300px;
    height: 250px;
    margin: 0 auto;
    margin-top: 20px;
}

/* Mobile Ad */
#ad-mobile {
    width: 320px;
    height: 100px;
    margin: 0 auto;
    margin-top: 20px;
}

/* Related Tools - UPDATED STYLING */
#related-tools-desktop, #related-tools-mobile-tablet {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
    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;
}

.tools-list a:hover {
    color: var(--teal);
}

/* Main Content */
.main-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 0;
    color: #000;
}

/* Calculator Form */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    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;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row > div {
    flex: 1;
}

.info-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: var(--teal);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 0.75rem;
    margin-left: 5px;
    cursor: help;
}

.tooltip {
    display: none;
    position: absolute;
    background-color: var(--primary);
    color: white;
    padding: 10px;
    border-radius: 4px;
    z-index: 10;
    width: 250px;
    font-size: 0.875rem;
}

.info-icon:hover + .tooltip {
    display: block;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
    overflow: hidden;
    font-size: 1rem;
    color: #000;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

button:hover {
    opacity: 0.9;
}

/* Spinner animation */
.spinner {
    pointer-events: none;
}

.spinner::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    animation: spin 0.5s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Section */
.results {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--light-bg);
    border-radius: 5px;
    display: none;
    color: #000;
}

.result-item {
    margin-bottom: 15px;
    color: #000;
}

.pass {
    color: green;
    font-weight: bold;
}

.fail {
    color: var(--secondary);
    font-weight: bold;
}

/* Gauge */
.gauge-container {
    margin: 20px 0;
    text-align: center;
    color: #000;
}

.gauge {
    width: 100%;
    height: 30px;
    background: linear-gradient(to right, green, yellow, red);
    border-radius: 15px;
    position: relative;
    margin: 10px 0;
}

.gauge-marker {
    position: absolute;
    height: 40px;
    width: 2px;
    background-color: var(--primary);
    top: -5px;
}

/* Chart Container */
.chart-container {
    margin: 30px 0;
    height: 300px;
    position: relative;
}

/* Typography */
h1 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: #000;
    text-align: center;
}

h2 {
    font-size: 1.125rem;
    margin-bottom: 15px;
    color: #ff6b6b;
}

h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #000;
}

h4 {
    font-size: 0.9375rem;
    margin-bottom: 10px;
    color: #000;
}

/* Sticky Sidebars */
.sticky {
    position: sticky;
    top: 20px;
}

/* Responsive Typography */
@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;
    }
}

@media (min-width: 1025px) {
    h2 {
        font-size: 1.375rem;
        color: #ff6b6b;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.125rem;
    }
}

/* Mobile Layout (≤767px) */
.grid-container {
    grid-template-columns: 1fr;
}

/* Hide desktop and tablet ads on mobile */
#ad-left, #ad-right, #ad-tablet {
    display: none;
}

/* Show mobile ad */
#ad-mobile {
    display: flex;
}

/* Hide desktop related tools on mobile */
#related-tools-desktop {
    display: none;
}

/* Show mobile/tablet related tools */
#related-tools-mobile-tablet {
    display: block;
}

/* Tablet Layout (768px–1024px) */
@media (min-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    /* Hide desktop and mobile ads on tablet */
    #ad-left, #ad-right, #ad-mobile {
        display: none;
    }

    /* Show tablet ad */
    #ad-tablet {
        display: flex;
    }

    /* Hide desktop related tools on tablet */
    #related-tools-desktop {
        display: none;
    }

    /* Show mobile/tablet related tools */
    #related-tools-mobile-tablet {
        display: block;
    }

    /* Add space above tablet ad */
    #ad-tablet {
        margin-top: 10px;
    }
}

/* Desktop Layout (≥1025px) */
@media (min-width: 1025px) {
    .grid-container {
        grid-template-columns: 300px 1fr 300px;
    }

    /* Hide mobile and tablet ads on desktop */
    #ad-mobile, #ad-tablet {
        display: none;
    }

    /* Show desktop ads */
    #ad-left, #ad-right {
        display: flex;
    }

    /* Show desktop related tools */
    #related-tools-desktop {
        display: block;
    }

    /* Hide mobile/tablet related tools on desktop */
    #related-tools-mobile-tablet {
        display: none;
    }

    /* Make sidebars sticky */
    .sidebar-left .sticky {
        position: sticky;
        top: 20px;
    }

    .sidebar-right .sticky {
        position: sticky;
        top: 20px;
    }
}

/* 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;
    font-size: 1rem;
    color: #000;
}

.mobile-table th {
    background-color: #4ecdc4;
    font-weight: bold;
    color: #000;
}

.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}