:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
}

* {
    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: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0px 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-grid {
    display: grid;
    gap: 20px;
}

.sidebar {
    display: none;
}

.ad-container {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #000;
    text-align: center;
    font-style: italic;
    overflow: hidden;
    font-family: 'Times New Roman', Times, serif;
}

#converter-tool {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    font-family: 'Times New Roman', Times, serif;
}

.calculator-header {
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Times New Roman', Times, serif;
}

h1 {
    font-size: 1.25rem;
    color: #000;
    font-family: 'Times New Roman', Times, serif;
}

h2 {
    color: #ff6b6b;
    font-size: 1.125rem;
}

h3 {
    color: #000;
    font-size: 1rem;
}

h4 {
    color: #000;
    font-size: 0.9375rem;
}

.section-title {
    font-size: 1.25rem;
    color: #000;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
    font-family: 'Times New Roman', Times, serif;
    font-weight: bold;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
    font-family: 'Times New Roman', Times, serif;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: 'Times New Roman', Times, serif;
}

label {
    font-weight: bold;
    color: #000;
    font-size: 1.125rem;
    font-family: 'Times New Roman', Times, serif;
}

input, select {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: 'Times New Roman', Times, serif;
    color: #000;
}

input:focus, select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(61, 90, 128, 0.2);
}

.advanced-toggle {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    text-align: left;
    padding: 10px 0;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Times New Roman', Times, serif;
}

.advanced-section {
    display: none;
    background-color: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin-top: 10px;
    font-family: 'Times New Roman', Times, serif;
}

.advanced-section.active {
    display: block;
}

.buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    flex: 1;
    font-family: 'Times New Roman', Times, serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    color: #000;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
    border: 1px solid var(--secondary);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.results {
    background-color: var(--light-bg);
    border-radius: 10px;
    padding: 25px;
    margin-top: 20px;
    display: none;
    font-family: 'Times New Roman', Times, serif;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    font-family: 'Times New Roman', Times, serif;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-heading {
    font-size: 1rem;
    color: #000;
    margin-bottom: 10px;
    font-family: 'Times New Roman', Times, serif;
    font-weight: bold;
}

.card .value {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--accent);
    font-family: 'Times New Roman', Times, serif;
}

.visualization {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 30px;
}

.chart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    height: 300px;
    display: flex;
    flex-direction: column;
    font-family: 'Times New Roman', Times, serif;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: #000;
    position: relative;
    font-family: 'Times New Roman', Times, serif;
    transition: all 0.3s;
    font-size: 1rem;
}

.tab-btn.active {
    color: var(--accent);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent);
}

.tab-btn:hover {
    color: var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-family: 'Times New Roman', Times, serif;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.breakdown-table th {
    background-color: var(--light-bg);
    padding: 12px 15px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid var(--border-color);
    font-size: 1rem;
    color: #000;
}

.breakdown-table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    color: #000;
}

.breakdown-table tr:last-child td {
    border-bottom: none;
}

.breakdown-table tr:nth-child(even) {
    background-color: rgba(248, 249, 250, 0.5);
}

.export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.export-btn {
    padding: 10px 15px;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Times New Roman', Times, serif;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    color: #000;
}

.export-btn:hover {
    background-color: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#related-tools {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 20px;
    font-family: 'Times New Roman', Times, serif;
    margin-top: 15px;
}

#mobile-tools {
    display: none;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 10px;
    margin-top: 20px;
    font-family: 'Times New Roman', Times, serif;
}

.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: left;
    gap: 10px;
}

.tools-list a:hover {
    color: var(--teal);
}

#ad-left, #ad-right, #ad-tablet, #ad-mobile {
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Times New Roman', Times, serif;
}

#ad-left {
    width: 300px;
    height: 250px;
}

#ad-right {
    width: 300px;
    height: 600px;
}

#ad-tablet {
    width: 300px;
    height: 250px;
    margin: 0 auto;
}

#ad-mobile {
    width: 320px;
    height: 100px;
    margin: 0 auto;
}

/* Print styles */
@media print {
    .no-print, .chart-container, .tabs, .export-buttons {
        display: none !important;
    }
    .results {
        display: block !important;
        box-shadow: none;
        padding: 0;
        background: none;
    }
    .main-grid {
        grid-template-columns: 1fr !important;
    }
    .container {
        padding: 0;
        max-width: 100%;
    }
    .tab-content {
        display: block !important;
    }
    .tab-btn {
        display: none;
    }
    .tabs {
        border: none;
        margin-bottom: 10px;
    }
    body {
        background: white;
    }
    .print-only {
        display: block !important;
    }
    .print-header {
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #333;
    }
    .summary-cards {
        grid-template-columns: repeat(4, 1fr);
    }
    .breakdown-table {
        font-size: 0.875rem;
    }
}

@media (min-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.125rem;
    }

    h4 {
        font-size: 1rem;
    }

    .tab-btn {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .input-group {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-cards {
        grid-template-columns: repeat(4, 1fr);
    }

    .visualization {
        grid-template-columns: 1fr 1fr;
    }

    #ad-tablet {
        display: flex;
        margin-top: 10px;
    }

    #ad-mobile {
        display: none;
    }
    
    #mobile-tools {
        display: block;
    }
}

@media (min-width: 1025px) {
    .main-grid {
        grid-template-columns: 300px 1fr 300px;
    }

    .sidebar {
        display: block;
    }

    .sticky {
        position: sticky;
        top: 20px;
    }

    #ad-left, #ad-right {
        display: flex;
    }

    #ad-tablet, #ad-mobile {
        display: none;
    }
    
    #mobile-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;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    #ad-mobile {
        display: flex;
        width: calc(100vw - 1rem);
        max-width: 320px;
    }

    #ad-tablet {
        display: none;
    }
    
    #converter-tool {
        margin-bottom: 10px;
        padding: 15px;
    }
    
    .results {
        margin-top: 10px;
        margin-bottom: 10px;
        padding: 15px;
    }
    
    #mobile-tools {
        display: block;
    }
    
    .container {
        padding: 0.25rem;
    }
    
    .breakdown-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .breakdown-table thead,
    .breakdown-table tbody,
    .breakdown-table th,
    .breakdown-table td,
    .breakdown-table tr {
        display: block;
    }
    
    .breakdown-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .breakdown-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 5px;
        background: white;
        display: block;
        white-space: normal;
    }
}

.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--primary);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.monthly-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 15px;
    width: 100%;
    max-width: 100%;
}

.print-only {
    display: none;
}

.report-container {
    display: none;
}

/* Breadcrumb styles */
.breadcrumb {
    padding: 0px 10px;
    color: #000;
    margin-bottom: 5px;
    font-size: 1rem;
    max-width: 100%;
    overflow: hidden;
}

.breadcrumb a {
    color: #000;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

blockquote {
    border-left: 4px solid #4ecdc4;
    padding-left: 15px;
    margin-left: 0;
    color: #000;
    font-style: italic;
}

ul {
    padding-left: 20px;
}

li {
    margin-bottom: 8px;
    color: #000;
}

.image-caption {
    text-align: center;
    font-style: italic;
    color: #000;
    margin: 20px 0;
    font-size: 1.5rem;
}

.note {
    font-style: italic;
    color: #000;
    padding: 0 15px 10px;
}

/* Additional mobile-specific fixes */
@media (max-width: 480px) {
    .container {
        padding: 0.125rem;
    }
    
    #converter-tool {
        padding: 10px;
    }
    
    .results {
        padding: 10px;
    }
    
    .card .value {
        font-size: 1.125rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.875rem;
    }
}

.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;
    color: #000;
}

.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}