: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);
}

.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.calculator {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    flex: 1;
}

.header h1 {
    font-size: 1.5rem;
    color: #000;
    margin-bottom: 1.5rem;
    text-align: center;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #000;
    position: relative;
}

.tab-btn.active {
    color: #000;
    font-weight: bold;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--secondary);
}

.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    color: #000;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #000;
}

.form-group select, 
.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    color: #000;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    flex: 1;
    color: #000;
}

.btn-calculate {
    background-color: #4ecdc4;
    color: white;
}

.btn-reset {
    background-color: #ff6b6b;
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.result-card {
    background-color: var(--light-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-family: 'Times New Roman', Times, serif;
}

.result-title {
    font-weight: bold;
    color: #000;
}

.result-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #000;
    margin: 1rem 0;
    text-align: center;
}

.step-by-step {
    margin: 1rem 0;
    padding: 1rem;
    background-color: white;
    border-radius: 4px;
    border-left: 4px solid var(--teal);
    color: #000;
}

.export-controls {
    margin-top: 1.5rem;
}

.export-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-pdf {
    background-color: #e74c3c;
    color: white;
}

.btn-img {
    background-color: var(--accent);
    color: white;
}

.btn-print {
    background-color: var(--primary);
    color: white;
}

.mini-tools {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mini-tool {
    background-color: var(--light-bg);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.mini-tool.active {
    border-color: var(--secondary);
    background-color: white;
}

.mini-tool:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.mini-tool-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #000;
}

.mini-tool-desc {
    font-size: 0.875rem;
    color: #000;
}

.tool-container {
    display: none;
}

.tool-container.active {
    display: block;
}

.tool-title {
    font-size: 1.125rem;
    color: #000;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-container {
    height: 300px;
    margin: 1.5rem 0;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-family: 'Times New Roman', Times, serif;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: #000;
}

th {
    background-color: var(--light-bg);
    font-weight: bold;
    color: #000;
    font-size: 1rem;
}

.loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--light-bg);
    border-top: 5px solid var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Ad containers */
.ad-container {
    display: none;
}

#ad-left, #ad-right {
    width: 300px;
}

#ad-tablet, #ad-mobile {
    display: flex;
    justify-content: center;
    margin: 1rem auto;
    width: 100%;
}

.ad-placeholder {
    background-color: var(--light-bg);
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    text-align: center;
    padding: 1rem;
}

#ad-left .ad-placeholder {
    height: 250px;
}

#ad-right .ad-placeholder {
    height: 600px;
}

#ad-tablet .ad-placeholder {
    width: 300px;
    height: 250px;
}

#ad-mobile .ad-placeholder {
    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-top: 1.5rem;
}

#related-tools ul {
    list-style: none;
}

#related-tools li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

#related-tools li:last-child {
    border-bottom: none;
}

#related-tools a {
    color: #000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

#related-tools a:hover {
    color: var(--teal);
}

/* Mobile Related Tools */
#related-tools-mobile {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    margin-top: 1.5rem;
}

#related-tools-mobile h3 {
    margin-bottom: 1rem;
    color: #ff6b6b;
    font-size: 1.125rem;
}

#related-tools-mobile ul {
    list-style: none;
}

#related-tools-mobile li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

#related-tools-mobile li:last-child {
    border-bottom: none;
}

#related-tools-mobile a {
    color: #000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

#related-tools-mobile a:hover {
    color: var(--teal);
}

/* Add h2 styling */
h2 {
    color: #ff6b6b;
}

/* Responsive design */
@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mini-tools {
        grid-template-columns: repeat(4, 1fr);
    }

    .section-title {
        font-size: 1.25rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .tab-btn {
        font-size: 1rem;
    }

    h2 {
        font-size: 1.25rem;
        color: #ff6b6b;
    }

    h3 {
        font-size: 1.125rem;
        color: #000;
    }

    h4 {
        font-size: 1rem;
        color: #000;
    }
}

@media (max-width: 767px) {
    .header h1 {
        font-size: 1.25rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .tool-title {
        font-size: 1.125rem;
    }

    .button-group {
        flex-direction: column;
    }

    .export-row {
        flex-direction: column;
    }

    .mini-tools {
        grid-template-columns: 1fr;
    }
    
    #related-tools-mobile {
        display: block;
    }

    .tab-btn {
        font-size: 0.875rem;
    }

    h2 {
        font-size: 1.125rem;
        color: #ff6b6b;
    }

    h3 {
        font-size: 1rem;
        color: #000;
    }

    h4 {
        font-size: 0.9375rem;
        color: #000;
    }
}

/* Desktop layout */
@media (min-width: 1025px) {
    .container {
        flex-direction: row;
    }

    .ad-container {
        display: block;
    }

    #ad-left, #ad-right {
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }

    #ad-tablet, #ad-mobile, #related-tools-mobile {
        display: none;
    }

    #related-tools {
        position: sticky;
        top: 280px; /* 250px ad height + 30px gap */
    }

    h2 {
        font-size: 1.375rem;
        color: #ff6b6b;
    }

    h3 {
        font-size: 1.25rem;
        color: #000;
    }

    h4 {
        font-size: 1.125rem;
        color: #000;
    }
}

/* Tablet layout */
@media (min-width: 768px) and (max-width: 1024px) {
    #ad-tablet {
        display: flex;
    }
    
    #ad-left, #ad-right, #ad-mobile {
        display: none;
    }

    #related-tools {
        display: none;
    }
    
    #related-tools-mobile {
        display: block;
    }

    h2 {
        font-size: 1.25rem;
        color: #ff6b6b;
    }

    h3 {
        font-size: 1.125rem;
        color: #000;
    }

    h4 {
        font-size: 1rem;
        color: #000;
    }
}

/* Mobile layout */
@media (max-width: 767px) {
    #ad-mobile {
        display: flex;
    }

    #ad-left, #ad-right, #ad-tablet, #related-tools {
        display: none;
    }
    
    #related-tools-mobile {
        display: block;
    }
}

/* 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;
}

.mobile-table th {
    background-color: #4ecdc4;
    font-weight: bold;
    font-size: 1rem;
}

.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}