: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);
    max-width: 1400px;
    margin: 0 auto;
    
}

.container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0 10px;
    align-items: flex-start;
}

main {
    flex: 1;
    min-width: 300px;
}

.sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
    overflow-y: auto;
}

.calculator {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    font-size: 1.5rem;
    color: #000;
    margin-bottom: 20px;
    text-align: center;
}

h2 {
    font-size: 1.375rem;
    color: #ff6b6b;
    margin: 15px 0 10px;
}

h3 {
    font-size: 1.25rem;
    color: #000;
    margin: 12px 0 8px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    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;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(61, 90, 128, 0.2);
}

.input-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input-row .form-group {
    flex: 1;
    min-width: 120px;
}

/* Fixed button styling */
#calculate-btn, #reset-btn, .export-btn {
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
    min-width: 140px;
    text-align: center;
}

#calculate-btn:active, #reset-btn:active, .export-btn:active {
    transform: scale(0.98);
}

#calculate-btn {
    background-color: var(--teal);
}

#calculate-btn:hover {
    background-color: var(--accent);
}

#reset-btn {
    background-color: var(--secondary);
}

#reset-btn:hover {
    background-color: #e55c5c;
}

.button-group {
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.ad-container {
    background-color: var(--light-bg);
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-light);
    text-align: center;
}

#ad-left, #ad-right, #related-tools {
    position: sticky;
    height: fit-content;
}

#ad-left {
    min-height: 250px;
}

#ad-right {
    min-height: 600px;
}

#ad-tablet, #ad-mobile {
    margin-top: 20px;
}

#ad-tablet {
    min-height: 250px;
    width: 300px;
    margin: 20px auto;
}

#ad-mobile {
    min-height: 100px;
    width: 320px;
    margin: 10px auto;
}

#related-tools {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    order: 2;
}

#related-tools ul {
    list-style-type: none;
}

#related-tools li {
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

#related-tools li:last-child {
    border-bottom: none;
}

#related-tools a {
    color: var(--accent);
    text-decoration: none;
    display: block;
    border-radius: 4px;
    transition: background-color 0.2s;
}

#related-tools a:hover {
    color: var(--secondary);
}

.results {
    margin-top: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    border-left: 4px solid var(--teal);
}

.result-item {
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #000;
}

.result-item:last-child {
    border-bottom: none;
}

.result-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #000;
}

.explanation {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: 5px;
    font-size: 1rem;
    color: #000;
}

.export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.export-btn {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.export-btn:hover {
    background-color: var(--primary);
}

@media (max-width: 767px) {
    h1 {
        font-size: 1.25rem;
    }
    
    h2 {
        font-size: 1.125rem;
        color: #ff6b6b;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    .sidebar {
        width: 100%;
        order: 3;
        position: static;
        max-height: none;
    }
    
    #ad-left, #ad-right, #ad-tablet {
        display: none;
    }
    
    #ad-mobile, #related-tools {
        display: block;
        width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    #calculate-btn, #reset-btn {
        width: 100%;
    }

    #ad-left, #ad-right, #related-tools {
        position: static;
    }
    
    .input-row {
        flex-direction: column;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    h2 {
        font-size: 1.25rem;
        color: #ff6b6b;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    .container {
        width: auto;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        order: 2;
        position: static;
        max-height: none;
    }
    
    #ad-left, #ad-right, #ad-mobile {
        display: none;
    }
    
    #ad-tablet, #related-tools {
        display: block;
    }
    
    #related-tools {
        width: 100%;
        margin-top: 10px;
    }

    .button-group {
        justify-content: center;
    }

    #calculate-btn, #reset-btn {
        min-width: 160px;
    }

    #ad-left, #ad-right, #related-tools {
        position: static;
    }
}

@media (min-width: 1025px) {
    #ad-mobile, #ad-tablet {
        display: none;
    }
    
    #ad-left, #ad-right, #related-tools {
        display: block;
    }
    
    .sidebar:first-child {
        order: 1;
    }
    
    main {
        order: 2;
    }
    
    .sidebar:last-child {
        order: 3;
    }

    #calculate-btn, #reset-btn {
        min-width: 160px;
    }
}

@media print {
    .ad-container, #related-tools, .export-buttons, .button-group {
        display: none !important;
    }
    
    .results, .explanation {
        break-inside: avoid;
    }
}

.input-hint {
    font-size: 1rem;
    color: #000;
    margin-top: 4px;
}

.required::after {
    content: " *";
    color: var(--secondary);
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    display: none;
}

.loading {
    opacity: 0.7;
    pointer-events: none;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.calculating {
    animation: pulse 1.5s infinite;
}

.warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    display: none;
}

.info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: var(--accent);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 1.125rem;
    margin-left: 5px;
    cursor: help;
    position: relative;
}

.info-tooltip {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    width: 250px;
    font-size: 1rem;
    line-height: 1.4;
    color: #000;
}

.info-icon:hover .info-tooltip {
    display: block;
    bottom: 25px;
    left: 0;
}

/* New styles for enhanced UI */
.input-error {
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

.error-message {
    color: var(--secondary);
    font-size: 1rem;
    margin-top: 4px;
    display: none;
}

.real-time-preview {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
    font-size: 1rem;
    color: #000;
    display: none;
}

.calculation-steps {
    background-color: #f0f4f8;
    border-left: 4px solid var(--accent);
    padding: 15px;
    margin: 15px 0;
    display: none;
}

.calculation-steps {
    margin-top: 0;
    color: #000;
}

.calculation-steps ol {
    padding-left: 20px;
}

.calculation-steps li {
    margin-bottom: 8px;
}
/* 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;
    }