* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background-color: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    width: 95%;
    max-width: 700px;
    margin: 1rem auto;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 2rem;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.helper-text {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.2rem;
}

input::placeholder {
    color: #999;
    font-size: 0.9rem;
}

/* Ensure the helper text doesn't interfere with error states */
.input-group.error .helper-text {
    color: #ff2400;
}

label {
    color: #555;
    font-weight: 500;
}

input {
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #ff2400;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    flex: 1;
}

button:active {
    transform: scale(0.98);
}

.action-btn {
    background-color: #259E2A;
    color: white;
}

.action-btn:hover {
    opacity: 0.9;
}

.reset-btn {
    background-color: #333;
    color: white;
}

.reset-btn:hover {
    opacity: 0.9;
}

.results {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #eee;
}

.results h2 {
    color: #333;
    margin-bottom: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem;
    background-color: #f8f8f8;
    border-radius: 10px;
    margin-bottom: 0.8rem;
}

.result-item span:first-child {
    color: #555;
    font-weight: 500;
}

.result-item span:last-child {
    color: #259E2A;
    font-weight: 600;
}

.info-section {
    background-color: #f8f8f8;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.info-section h3 {
    color: #333;
    margin-bottom: 1rem;
}

.info-section p {
    color: #555;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.info-subsection {
    margin-top: 1.2rem;
}

.info-subsection h4 {
    color: #444;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.info-section ul {
    list-style-type: none;
    margin-left: 0;
    color: #555;
}

.info-section ul li {
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.info-section ul li strong {
    color: #333;
    margin-right: 0.3rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 0.8rem;
    color: #555;
}

.input-wrapper input {
    padding-left: 1.8rem;
}

.profit-indicator {
    text-align: center;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    font-weight: 600;
}

.profit-indicator.positive {
    background-color: rgba(37, 158, 42, 0.1);
    color: #259E2A;
}

.profit-indicator.negative {
    background-color: rgba(255, 36, 0, 0.1);
    color: #ff2400;
}

.hidden {
    display: none;
}

.input-method-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.toggle-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    background: none;
    border-radius: 20px;
    cursor: pointer;
}

.toggle-btn.active {
    background-color: #ff2400;
    color: white;
    border-color: #ff2400;
}

.calculation-breakdown {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calculation-breakdown h3 {
    color: #333;
    margin-bottom: 1rem;
}

.breakdown-text {
    color: #555;
    line-height: 1.6;
}

.breakdown-text p {
    margin-bottom: 0.5rem;
}

.breakdown-text ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.breakdown-text li {
    margin-bottom: 0.3rem;
}

.formula-card {
    background-color: #f8f8f8;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

.calculation-title {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.2rem;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 600;
}

.formula-group {
    margin: 1rem 0;
}

.formula-header {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 500;
}

.formula-line {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: white;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.05);
}

.formula-number {
    font-weight: 600;
    color: #333;
}

.formula-operator {
    color: #666;
    font-weight: 600;
    font-size: 1.2rem;
    padding: 0 0.3rem;
}

/* Ensure formulas don't break on smaller screens */
@media (max-width: 600px) {
    .formula-line {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 1rem; /* Space for potential scrollbar */
    }
}

.explanation {
    font-family: 'Segoe UI', sans-serif;
    color: #555;
    margin: 1rem 0;
    line-height: 1.4;
}

.formula-step {
    margin: 0.8rem 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
}

.formula-label {
    color: #666;
    font-weight: 500;
    font-family: 'Segoe UI', sans-serif;
    min-width: 120px;
    flex-shrink: 0;
}

.formula-calculation {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    flex: 1;
    min-width: 200px;
}

.formula-block {
    background-color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    color: #333;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    border: 1px solid #e0e0e0;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.05);
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
}

.formula-note {
    color: #666;
    margin-left: 0.5rem;
    font-style: italic;
    font-family: 'Segoe UI', sans-serif;
}

.formula-calculation {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Keep the results section numbers green */
.result-item span:last-child {
    color: #259E2A;
    font-weight: 600;
}

/* But use normal color for breakdown calculations */
.formula-card .formula-block {
    color: #333;
}

@media (max-width: 600px) {
    .formula-step {
        flex-direction: column;
        align-items: flex-start;
    }

    .formula-label {
        min-width: auto;
        margin-bottom: 0.3rem;
    }

    .formula-calculation {
        width: 100%;
    }

    .container {
        padding: 1rem;
    }
}

.explanation-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.explanation-card h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.explanation-card p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.explanation-card ul {
    margin-left: 1.5rem;
    color: #555;
    line-height: 1.6;
}

.explanation-card li {
    margin-bottom: 0.5rem;
}

.scenario-section,
.considerations-section,
.recommendation-section {
    margin: 1.5rem 0;
}

.explanation-card h5 {
    color: #444;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.explanation-card ul ul {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.explanation-card ul li strong {
    color: #333;
}

.considerations-section ul {
    list-style-type: none;
    margin-left: 0;
}

.considerations-section ul ul {
    list-style-type: disc;
    margin-left: 2rem;
}

.recommendation-section {
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.recommendation-section p {
    margin-bottom: 0;
}

.error-list {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(255, 36, 0, 0.1);
    border-radius: 8px;
}

.error-item {
    color: #ff2400;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.error-item:last-child {
    margin-bottom: 0;
}

/* Add error state for input fields */
.input-group.error input {
    border-color: #ff2400;
}

.input-group.error .helper-text {
    color: #ff2400;
}

.faq-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #eee;
}

.faq-section h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.accordion-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.accordion-header {
    /* Remove any existing styles first */
    all: unset;
    
    /* Add core button styles */
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: #f8f8f8;
    cursor: pointer;
    box-sizing: border-box;
    
    /* Override problematic properties */
    transform: none !important;
    transition: none !important;
    border-radius: 0;
    flex: none;
}

button.accordion-header:active {
    transform: none !important;
}

/* Style the text */
.header-text {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    flex: 1;
    text-align: left;
    margin-right: 1rem;
}

/* Style the icon */
.accordion-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

/* Handle the minus state */
.accordion-header[aria-expanded="true"] .accordion-icon line:first-child {
    transform: rotate(90deg);
    opacity: 0;
}

/* Add transform for the icon */
.accordion-header .accordion-icon line:last-child {
    transition: transform 0.3s ease;
}

.accordion-content.active + .accordion-header .accordion-icon line:last-child,
.accordion-header[aria-expanded="true"] .accordion-icon line:last-child {
    transform: rotate(0deg);
}

/* Ensure both lines are visible by default */
.accordion-icon line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Remove any hover/active states that might cause shifting */
.accordion-header:hover,
.accordion-header:active,
.accordion-header:focus {
    background: #f0f0f0;
    outline: none;
}

.accordion-content {
    background: #fff;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.active {
    padding: 1.5rem;
    max-height: 500px;
    border-top: 1px solid #eee;
}

.accordion-content ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.accordion-content ul ul {
    margin-left: 1.2rem;
    margin-top: 0.5rem;
    list-style-type: disc;
}

.accordion-content li {
    margin-bottom: 1rem;
    line-height: 1.5;
    color: #555;
}

.accordion-content li:last-child {
    margin-bottom: 0;
}

.accordion-content li strong {
    color: #333;
    display: block;
    margin-bottom: 0.3rem;
}

.accordion-content p {
    margin: 0 0 1rem 0;
    line-height: 1.5;
    color: #555;
}

.accordion-content p:last-child {
    margin-bottom: 0;
}

.accordion-header:hover {
    background: #f0f0f0;
}

.accordion-header:focus {
    outline: none;
    background: #f0f0f0;
}

.accordion-item .accordion-header.active,
.accordion-item .accordion-content.active + .accordion-header {
    border-bottom-color: #eee;
    background: #f8f8f8;
}

/* Remove any inherited button styles */
button.accordion-header {
    font-family: inherit;
    border-radius: 0;
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.pros h6, .cons h6 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid;
}

.pros h6 {
    color: #259E2A;
    border-color: #259E2A;
}

.cons h6 {
    color: #dc3545;
    border-color: #dc3545;
}

.pros ul, .cons ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pros li, .cons li {
    margin-bottom: 1rem;
    line-height: 1.4;
}

.pros li strong, .cons li strong {
    display: block;
    color: #333;
    margin-bottom: 0.2rem;
}

@media (max-width: 768px) {
    .pros-cons {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.section-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
    display: inline-block;
    transition: all 0.3s ease;
}

.calculation-title, h4, h5 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-icon {
    color: #ff2400; /* matches our theme color */
    transition: transform 0.3s ease;
}

.formula-card:hover .section-icon {
    transform: scale(1.1);
}

/* Different colors for different sections */
.formula-card:nth-of-type(1) .section-icon {
    color: #259E2A;
}

.formula-card:nth-of-type(2) .section-icon {
    color: #ff2400;
}

.explanation-card .section-icon {
    color: #666;
}

.considerations-section .section-icon {
    color: #333;
}

/* Hover effects */
.formula-card:hover .section-icon,
.explanation-card:hover .section-icon,
.considerations-section:hover .section-icon {
    transform: scale(1.1);
}

/* Different colors for different types of icons */
.formula-card .section-icon {
    color: #259E2A; /* Calculator/Math icons in green */
}

.explanation-card .section-icon {
    color: #ff2400; /* Light bulb in our theme red */
}

.pros .section-icon {
    color: #259E2A; /* Checkmark in green */
}

.cons .section-icon {
    color: #dc3545; /* X in red */
}

.timing-icon {
    color: #666; /* Clock in neutral gray */
}

.risk-icon {
    color: #0056b3; /* Shield in blue */
}
