: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;
}

body {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    background-color: var(--light-bg);
}

h1 {
    color: #000;
    font-size: 1.5rem;
}

h2 {
    color: #ff6b6b;
    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;
}

/* Calculator Layout */
.calculator-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 10px;
}

/* Sidebar Styles */
.sidebar {
    display: none;
}

.ad-container {
    background-color: white;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-light);
    margin-bottom: 20px;
    border-radius: 8px;
}

#ad-left, #ad-right {
    width: 300px;
    height: 250px;
}

#ad-right {
    height: 600px;
}

#ad-tablet {
    width: 300px;
    height: 250px;
}

#ad-mobile {
    width: 320px;
    height: 100px;
}

#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 {
    color: #000;
    margin-bottom: 15px;
    text-align: left;
    font-size: 1.375rem;
}

.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);
}

/* Calculator Form Styles */
.calculator {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.calculator h1 {
    color: #000;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #000;
    font-size: 1rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    color: #000;
    font-size: 1rem;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: background-color 0.3s;
    flex: 1;
    color: #000;
    font-size: 1rem;
}

#calculate-btn {
    background-color: var(--teal);
    color: white;
}

#reset-btn {
    background-color: var(--secondary);
    color: white;
}

button:hover {
    opacity: 0.9;
}

/* Results Section */
.results {
    display: none;
    margin-top: 30px;
}

.results h2 {
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: 1.25rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.card {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.card h3 {
    color: #000;
    margin-bottom: 10px;
    font-size: 1rem;
}

.card p {
    font-size: 1.25rem;
    font-weight: bold;
    color: #000;
}

/* Tabs for Results */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom: 3px solid var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Table Styles */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    color: #000;
}

.schedule-table th, .schedule-table td {
    padding: 10px;
    text-align: right;
    border: 1px solid var(--border-color);
    color: #000;
}

.schedule-table th {
    background-color: var(--light-bg);
    color: #000;
    font-size: 1rem;
}

.schedule-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Chart Containers */
.chart-container {
    height: 300px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
}

/* Export Options */
.export-options {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.export-btn {
    background-color: var(--accent);
    color: white;
    padding: 10px 15px;
    font-size: 1rem;
}

/* Responsive Design */
@media (min-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    h4 {
        font-size: 1rem;
    }
    
    .calculator h1 {
        font-size: 1.5rem;
    }
    
    .results h2 {
        font-size: 1.5rem;
    }
    
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #ad-tablet {
        display: flex;
        margin: 20px auto 0 auto;
    }
    
    #related-tools {
        margin-top: 20px;
    }
    
    #ad-mobile {
        display: none;
    }
}

@media (min-width: 1025px) {
    .calculator-container {
        flex-direction: row;
    }
    
    .sidebar {
        display: block;
        width: 300px;
    }
    
    .sticky {
        position: sticky;
        top: 20px;
    }
    
    .main-content {
        flex: 1;
    }
    
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .summary-cards {
        grid-template-columns: repeat(4, 1fr);
    }
    
    #ad-tablet, #ad-mobile {
        display: none;
    }
    
    #ad-left, #ad-right {
        display: flex;
    }
    
    /* Remove top margin from desktop ads */
    .sidebar .ad-container {
        margin-top: 0;
    }
    
    /* Hide the related tools in main content on desktop */
    .main-content #related-tools {
        display: none;
    }
}

@media (max-width: 767px) {
    h1 {
        font-size: 1.25rem;
    }
    
    h2 {
        font-size: 1.125rem;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    h4 {
        font-size: 0.9375rem;
    }
    
    .tab-btn {
        font-size: 0.875rem;
    }
    
    #ad-mobile {
        display: flex;
        margin: 20px auto 0 auto;
    }
    
    #related-tools {
        margin-top: 20px;
    }
    
    #ad-tablet {
        display: none;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    /* Hide the related tools in sidebar on mobile */
    .sidebar #related-tools {
        display: none;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        text-align: left;
    }
    
    /* Horizontal scrolling for mobile */
    .table-responsive {
        overflow-x: auto;
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    
    .schedule-table {
        min-width: 600px;
    }
    
    .chart-responsive {
        overflow-x: auto;
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    
    .chart-container {
        min-width: 300px;
    }
    
    .summary-responsive {
        overflow-x: auto;
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    
    .card {
        min-width: 250px;
    }
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 10px;
}

.pagination button {
    padding: 8px 15px;
    flex: 0;
    font-size: 1rem;
}

/* Print styles */
@media print {
    body * {
        visibility: hidden;
    }
    .results, .results * {
        visibility: visible;
    }
    .results {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .tabs, .export-options, .pagination {
        display: none;
    }
    .tab-content {
        display: block !important;
    }
    .schedule-table {
        font-size: 0.625rem;
    }
    .schedule-table th, .schedule-table td {
        padding: 4px;
    }
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #000;
}
.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--teal);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background-color: var(--teal);
    color: white;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000;
    font-size: 1rem;
}

/* 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;
}
.mobile-table th {
    background-color: #4ecdc4;
    font-weight: bold;
}
.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}