/* ROI Calculator Styles */
.roi-calculator-container {
    margin: 0 auto;
    max-width: 900px;
    padding: 15px;
    position: relative;
    background-color: #f8f9fa;
    color: #232b32;
}

main {
    position: relative;
    overflow: hidden;
}

/* Main heading */
.input-main-heading {
    margin-bottom: 1rem;
    font-weight: 600;
    color: #162e51;
    text-align: center;
}

/* Form layout container */
.form-layout {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
}

/* Input Cards */
.input-card {
    background-color: #fff;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    color: #232b32;
    display: flex;
    flex-direction: column;
}

.metrics-card {
    width: 60%;
    margin-right: 20px;
}

.supplements-card {
    width: 38%;
    border: 1px solid #e0e0e0;
}

/* Vertical alignment fixes for desktop */
.metrics-card fieldset,
.supplements-card fieldset {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Card headings */
.input-card-heading {
    margin: 0 0 15px 0;
    padding: 0 0 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    color: #162e51;
    font-weight: 600;
}

/* Fieldsets */
.input-card fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

/* URL Input Row */
.url-input-row {
    margin-bottom: 20px;
}

.url-input {
    width: 100%;
    background-color: #fff;
    color: #232b32;
    border: 1px solid #a9aeb1;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 8px;
}

.url-input-row small {
    color: #505A64;
}

/* Slider Components */
.slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.slider-value {
    color: #005ea2;
}

/* Range inputs */
input[type="range"] {
    width: 100%;
    margin-bottom: 20px;
}

/* Select dropdowns */
.roi-select {
    width: 100%;
    background-color: #fff;
    color: #232b32;
    border: 1px solid #a9aeb1;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 15px;
    appearance: none;
    -webkit-appearance: none;
    min-height: 38px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23232b32' d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 30px;
}

/* Checkbox containers */
.checkbox-row {
    margin-top: 10px;
    margin-bottom: 10px;
}

.checkbox-row input[type="checkbox"] {
    margin-right: 5px;
    vertical-align: middle;
}

.checkbox-row label {
    display: inline;
    margin: 0;
    vertical-align: middle;
}

/* Submit button */
.calculate-button {
    background-color: #005ea2;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin: 20px auto 0;
    display: block;
    max-width: 300px;
    width: 100%;
}

/* Results panel */
#results-panel {
    background-color: #fff;
    color: #333;
    border-radius: 8px;
    padding: 0;
    margin: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.5s cubic-bezier(.77,0,.18,1), opacity 0.5s;
    will-change: transform, opacity;
    display: none;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

#results-content {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Privacy modal */
#privacy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.privacy-modal-content {
    background-color: #fff;
    color: #232b32;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.privacy-button {
    background: #e0e0e0;
    color: #232b32;
    border: none;
    border-radius: 6px;
    padding: 0.7em 1.5em;
    font-size: 0.95em;
    cursor: pointer;
    font-weight: 600;
}

/* Slide animations - improved for proper transitions */
.slide-left {
    transform: translateX(-120%) scale(0.98);
    opacity: 0;
    pointer-events: none;
    position: absolute;
    left: -9999px;
    height: 0;
    overflow: hidden;
    display: none;
    visibility: hidden;
}

.slide-in-right {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    display: block;
}

.slide-out-right {
    transform: translateX(120%) scale(0.98);
    opacity: 0;
    pointer-events: none;
}

/* Error message */
.domain-error-message {
    color: #ff5252;
    font-size: 0.85rem;
    margin-top: 4px;
    display: none;
}

/* Responsive layouts */
@media (max-width: 768px) {
    .form-layout {
        flex-direction: column;
    }
    
    .metrics-card {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .supplements-card {
        width: 100%;
    }
}

/* Two-column layout for desktop */
.input-cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; /* Ensure spacing is even */
    margin-bottom: 15px;
}

/* Clear the float after our two columns */
.input-cards-container::after {
    content: "";
    display: table;
    clear: both;
}

/* Make sliders more compact in the wider left column */
.metrics-card input[type="range"] {
    width: 100%;
    margin-bottom: 15px;
}

.metrics-card .slider-label-row {
    margin-bottom: 5px;
}

/* Mobile results panel - completely redesigned layout */
@media (max-width: 768px) {
    /* Main results panel container */
    .roi-calculator-container #results-panel {
        padding: 0;
        background-color: #ffffff;
    }
    
    /* Title styling */
    .roi-calculator-container #results-content h2 {
        padding: 20px 15px 15px;
        margin: 0;
        text-align: center;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        color: #03254c;
    }
    
    /* Main ROI percentage section */
    .roi-calculator-container #results-content [style*="background-color:rgba(31, 59, 50, 0.6)"] {
        padding: 25px 15px;
        margin: 0 0 15px 0;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
        background-color: #003366;
        color: #ffffff;
    }
    
    /* ROI percentage number styling */
    .roi-calculator-container #results-content [style*="font-size:3.5rem"] {
        font-size: 4.5rem;
        color: #ffffff;
        margin: 0;
        line-height: 1;
        font-weight: 700;
    }
    
    /* Annual ROI text label */
    .roi-calculator-container #results-content [style*="background-color:rgba(31, 59, 50, 0.6)"] div:first-child {
        color: #ffffff;
        font-weight: 600;
    }
    
    /* Specific percentage cells */
    .roi-calculator-container #results-content table td[style*="+62.5%"],
    .roi-calculator-container #results-content table td[style*="+0.5%"] {
        color: #006400;
        font-weight: 700;
    }
    
    /* Annual profit value */
    .roi-calculator-container #results-content div:not([id]):not([class]) > div:last-child {
        color: #006400;
        font-weight: 700;
    }
    
    .roi-calculator-container #results-content > div:not(:last-child) {
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .roi-calculator-container #results-content > div[style*="display:flex; justify-content:space-between"] {
        background-color: rgba(0, 0, 0, 0.05);
        color: #0d1b2a;
    }
    
    .roi-calculator-container #results-content > div[style*="display:flex; justify-content:space-between"]::before {
        color: #03254c;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .roi-calculator-container #results-content table {
        color: #0d1b2a;
    }
    
    .roi-calculator-container #results-content table th {
        border-bottom: 1px solid rgba(0, 0, 0, 0.2);
        color: #03254c;
    }
    
    .roi-calculator-container #results-content table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        color: #0d1b2a;
    }
    
    .roi-calculator-container #results-content table td[style*="color:#4CAF50"],
    .roi-calculator-container #results-content table td[style*="color: #4CAF50"] {
        color: #006400;
        font-weight: 700;
    }
    
    .roi-calculator-container #results-content button#send-results-btn {
        background-color: #003366;
        color: #ffffff;
    }
    
    .roi-calculator-container #results-content button#book-call-btn {
        background-color: #d0d0d0;
        color: #0d1b2a;
    }
    
    .roi-calculator-container #results-content button#back-to-form {
        color: #333333;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .roi-calculator-container #results-content div[style*="color:#a9aeb1"],
    .roi-calculator-container #results-content div[style*="color: #a9aeb1"] {
        color: #333333;
    }
    
    .roi-calculator-container #results-content [style*="background-color:rgba(76, 175, 80, 0.1)"] {
        background-color: rgba(0, 100, 0, 0.2);
        color: #0d1b2a;
    }
    
    .roi-calculator-container #results-content div:not([id]):not([class]) > div:first-child,
    .roi-calculator-container #results-content > div:not([id]):not([class]):not(:empty) + div > div:first-child {
        color: #03254c;
    }
    
    /* Hide the theme toggle button */
    .roi-calculator-container .theme-toggle-btn {
        display: none;
    }
    
    /* Improved table display for mobile */
    .metrics-table {
        font-size: 0.9rem;
        table-layout: fixed;
        width: 100%;
    }
    
    .metrics-table th,
    .metrics-table td {
        padding: 10px 4px;
        word-break: normal;
        overflow-wrap: break-word;
    }
    
    .metrics-table th:first-child {
        width: 32%;
    }
    
    .metrics-table th:not(:first-child) {
        width: 22%;
    }
    
    .metrics-table th:last-child {
        width: 24%;
    }
    
    /* Make the profit row stand out even on mobile */
    .metrics-table tr.highlight-row {
        background-color: rgba(0, 94, 162, 0.1);
    }
    
    .metrics-table tr.highlight-row td {
        font-weight: 700;
        color: #000;
    }
    
    /* Make profit row stand out with a slight highlight */
    .metrics-table tr.profit-row {
        background-color: rgba(0, 100, 0, 0.07);
    }
    
    /* Remove original highlight on nth-child(2) since we're highlighting with class */
    .metrics-table tr:nth-child(2) {
        background-color: transparent;
    }
    
    /* Ensure the results cards stack properly on mobile */
    .results-flex-container {
        flex-direction: column-reverse;
        gap: 15px;
    }
    
    .roi-card {
        flex: none;
        width: 100%;
        text-align: center;
        padding: 20px 15px;
    }
    
    .turnover-card {
        flex: none;
        width: 100%;
    }
    
    /* Improve mobile view of metrics summary */
    .metrics-summary {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .metric-item {
        flex: 1 0 45%;
        margin-bottom: 10px;
    }
    
    /* Make buttons more touchable on mobile */
    .button-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .primary-button,
    .secondary-button {
        width: 100%;
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    /* Make sure fonts are readable */
    .roi-value {
        font-size: 3.5rem;
    }
    
    /* Enhance email form for mobile */
    .email-form-container {
        padding: 15px;
    }
}

#roi-form {
    transition: transform 0.5s cubic-bezier(.77,0,.18,1), opacity 0.5s;
    will-change: transform, opacity;
    background-color: #fff;
    color: #232b32;
    border-radius: 8px;
    padding: 25px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: visible;
}

.roi-calculator-container .input-card {
    background-color: #fff;
    color: #232b32;
}

.roi-calculator-container .input-card-heading {
    color: #162e51;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.roi-calculator-container select,
.roi-calculator-container .url-input {
    background-color: #fff;
    color: #232b32;
    border: 1px solid #a9aeb1;
}

.roi-calculator-container.light-theme,
.roi-calculator-container {
    background-color: #f8f9fa;
}

/* Light theme button styles */
.roi-calculator-container #results-panel button#back-to-form,
.roi-calculator-container #results-panel button#book-call-btn {
    background-color: #e0e0e0;
    color: #232b32;
}

/* Light theme button hover styles */
.roi-calculator-container #results-panel button#back-to-form:hover,
.roi-calculator-container #results-panel button#book-call-btn:hover {
    background-color: #c8c8c8;
}

/* Light theme overrides */
.roi-calculator-container #results-content button#send-results-btn {
    background-color: #005ea2;
    color: #ffffff;
}

.roi-calculator-container #results-content button#book-call-btn {
    background-color: #e0e0e0;
    color: #232b32;
    border: 1px solid #d0d0d0;
}

.roi-calculator-container #results-content button#back-to-form {
    background-color: transparent;
    color: #232b32;
    border: 1px solid #d0d0d0;
}

.roi-calculator-container #results-content input[type="email"] {
    background-color: #ffffff;
    color: #232b32;
    border: 1px solid #a9aeb1;
}

.roi-calculator-container #results-content input[type="email"]:focus {
    border-color: #005ea2;
    box-shadow: 0 0 0 2px rgba(0, 94, 162, 0.1);
}

.roi-calculator-container #results-content button#submit-email {
    background-color: #005ea2;
    color: #ffffff;
}

.roi-calculator-container #results-content button#submit-email:hover {
    background-color: #004c8a;
}

.input-card-heading {
    margin-bottom: 15px;
    padding-bottom: 5px;
    height: auto;
    min-height: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #232b32;
}

input[type="range"] {
    width: 100%;
    margin-bottom: 20px;
}

.slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2em;
}

input[type="email"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #a9aeb1;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
    background: #fff;
    color: #232b32;
}

select {
    width: 100%;
    height: auto;
    min-height: 40px; /* Taller height for multiple lines */
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
    padding: 8px 25px 8px 8px; /* Right padding for arrow */
    box-sizing: border-box;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 13px; /* Smaller font to fit more text */
    background-color: #fff;
    color: #232b32;
    border: 1px solid #a9aeb1;
}

/* Make dropdown options display properly */
select option {
    white-space: normal;
    padding: 5px;
    line-height: 1.4;
    background-color: #fff;
    color: #232b32;
}

button[type="submit"] {
    background-color: #005ea2;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
    margin: 15px auto 0;
    display: block;
    transition: background-color 0.3s;
    clear: both;
}

button[type="submit"]:hover {
    background-color: #004c8a;
}

#back-to-form {
    background-color: #e0e0e0;
    color: #232b32;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#back-to-form:hover {
    background-color: #c8c8c8;
}

.results-accent {
    color: #005ea2;
}

.results-secondary {
    color: #505A64;
}

/* Privacy policy link */
#privacy-link {
    color: #003366; /* Darker blue for better contrast */
    text-decoration: underline;
    font-weight: 600;
}

/* Sliding Animation */
#roi-form, #results-panel {
    transition: transform 0.5s cubic-bezier(.77,0,.18,1), opacity 0.5s;
    will-change: transform, opacity;
}

/* URL input styling */
.url-input-row {
    margin-bottom: 20px;
}

.url-input-row label {
    display: block;
    margin-bottom: 8px;
}

.url-input-row .url-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #a9aeb1;
    border-radius: 4px;
    background-color: #fff;
    color: #232b32;
    margin-bottom: 8px;
}

.url-input-row small {
    display: block;
    color: #505A64;
}

/* Compact checkbox margins */
.supplements-card div {
    margin-top: 0.7em;
}

/* Adjust input fields in supplements column */
.supplements-card select {
    margin-bottom: 12px;
}

/* Center the submit button */
button[type="submit"] {
    margin: 10px auto 0;
}

/* Adjust spacing for checkbox inputs */
input[type="checkbox"] {
    margin-right: 5px;
}

input[type="checkbox"] + label {
    display: inline;
    vertical-align: middle;
}

/* Force side-by-side layout for debugging */
.results-inner-card > div {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
}

/* Force exact alignment for cards */
.input-cards-container,
.results-inner-card > div {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start; /* Align to the top */
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Reset all margins and paddings at the top level of each card */
.input-card {
    margin: 0;
    padding: 15px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    color: #232b32;
    border: 1px solid #e0e0e0;
}

/* Ensure both cards have same internal spacing */
.input-card fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

/* Consistent card headings */
.input-card-heading {
    margin: 0 0 15px 0;
    padding: 0 0 8px 0;
    font-weight: 600;
    color: #162e51;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    line-height: 1.4;
    font-size: 16px;
}

/* Consistent form elements */
.input-card fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

/* Consistent label spacing */
label {
    display: block;
    margin: 0 0 6px 0;
    font-weight: 500;
    color: #232b32;
}

/* Fix dropdown styling */
select {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 15px;
    background-color: #fff;
    color: #232b32;
    border: 1px solid #a9aeb1;
    border-radius: 4px;
    appearance: menulist; /* Show native dropdown arrow */
    -webkit-appearance: menulist;
    height: auto;
    min-height: 38px;
}

/* Consistent spacing for inputs */
input[type="range"] {
    margin-bottom: 20px;
    width: 100%;
}

/* URLs input field styling */
.url-input-row .url-input {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    background-color: #fff;
    color: #232b32;
    border: 1px solid #a9aeb1;
    border-radius: 4px;
}

/* Fix checkbox container spacing */
.supplements-card div {
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Special handling for checkbox and its label */
input[type="checkbox"] {
    margin: 0 5px 0 0;
    vertical-align: middle;
}

input[type="checkbox"] + label {
    display: inline;
    margin: 0;
    vertical-align: middle;
}

/* Slider label row spacing */
.slider-label-row {
    margin-bottom: 4px;
} 

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay .spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #ffffff;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    font-size: 16px;
}

/* URL input styles */
.url-input {
    transition: border-color 0.3s ease;
}

.url-input.error {
    border-color: #ff5252 !important;
}

.url-input.success {
    border-color: #4CAF50 !important;
}

/* URL input row for better spacing */
.url-input-row {
    margin-bottom: 20px;
}

.url-input-row small {
    display: block;
    margin-top: 4px;
    opacity: 0.7;
}

#results-panel {
    background-color: #fff;
    color: #333;
    border-radius: 8px;
    padding: 0;
    margin: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.5s cubic-bezier(.77,0,.18,1), opacity 0.5s;
    will-change: transform, opacity;
    display: none;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

#results-content {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Hide theme toggle button */
.theme-toggle-btn {
    display: none !important;
}

/* Results Header - proper spacing */
.results-heading {
    font-size: inherit;
    font-weight: 700;
    margin: 0;
    padding: 15px 0 5px;
    color: #333;
    text-align: center;
    border-bottom: none;
}

.results-subtitle {
    font-size: inherit;
    margin: 0 0 15px;
    padding: 0 0 15px;
    color: #666;
    text-align: center;
    font-weight: normal;
    border-bottom: 1px solid #e0e0e0;
}

/* Panels layout - proper spacing */
.results-top-panels {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0;
}

.turnover-panel {
    flex: 65;
    background-color: #fff9e6;
    padding: 15px;
    border-radius: 0;
    margin: 0;
    border-right: 1px solid #f0f0f0;
}

.roi-panel {
    flex: 35;
    background-color: #f0f7f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-radius: 0;
    margin: 0;
}

/* Panel titles - consistent alignment */
.panel-title {
    margin: 0 0 10px;
    font-size: inherit;
    font-weight: 600;
    color: #333;
    width: 100%;
    text-align: left;
}

/* Key metrics row with proper spacing */
.key-metrics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.key-metric {
    flex: 50%;
    padding: 10px 0;
    text-align: center;
}

/* Section heading - consistent padding */
.section-heading {
    font-size: inherit;
    font-weight: 600;
    margin: 0;
    color: #333;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f9f9f9;
}

/* Table with proper spacing */
.compact-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0;
    font-size: inherit;
}

.compact-table th {
    text-align: center;
    padding: 10px 5px;
    font-weight: 600;
    color: #333;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

.compact-table th:first-child {
    text-align: left;
    padding-left: 15px;
}

.compact-table td {
    padding: 10px 5px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
}

.compact-table td:first-child {
    text-align: left;
    font-weight: 500;
    padding-left: 15px;
}

.compact-table tr:last-child td {
    border-bottom: none;
}

/* Highlight row with gray background */
.compact-table .highlight-row {
    font-weight: bold;
    background-color: #f8f8f8;
}

/* ROI calculation text with proper spacing */
.roi-calculation {
    font-size: inherit;
    color: #555;
    margin: 0;
    padding: 15px;
    line-height: 1.5;
    border-bottom: 1px solid #e0e0e0;
}

/* Button containers with proper spacing */
.cta-buttons {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 15px;
    box-sizing: border-box; /* Add this to ensure padding is included in width */
}

/* Ensure primary CTA button matches calculate button styling */
.cta-button.primary-button {
    background-color: #005ea2;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin: 0 0 15px 0;
    transition: background-color 0.3s;
    text-align: center;
}

.cta-button.primary-button:hover {
    background-color: #004c8a;
}

/* Secondary CTA button styling */
.cta-button.secondary-button {
    background-color: #e0e0e0;
    color: #232b32;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-bottom: 15px;
    transition: background-color 0.3s;
    text-align: center;
}

.cta-button.secondary-button:hover {
    background-color: #c8c8c8;
}

/* Desktop improvements for CTA buttons */
@media (min-width: 768px) {
    .cta-buttons {
        padding: 20px;
    }
    
    .cta-button.primary-button,
    .cta-button.secondary-button {
        max-width: 100%;
    }
}

/* Mobile improvements for CTA buttons */
@media (max-width: 767px) {
    .cta-buttons {
        padding: 15px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0 auto; /* Center the container */
    }
    
    /* Ensure buttons don't overflow */
    .cta-button.primary-button,
    .cta-button.secondary-button {
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }
}

/* Disclaimer text with proper spacing */
.results-disclaimer {
    font-size: 0.9em;
    color: #777;
    margin: 0;
    padding: 15px;
    text-align: center;
    font-style: italic;
    border-bottom: 1px solid #e0e0e0;
    line-height: 1.5;
}

/* Back button with proper spacing */
.back-button {
    display: block;
    width: auto;
    padding: 12px;
    background-color: #455a64;
    color: white;
    border: none;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    cursor: pointer;
    margin: 15px;
}

/* Desktop improvements - ensure consistent appearance */
@media (min-width: 768px) {
    #results-panel {
        border-radius: 8px;
        overflow: hidden;
    }
    
    .results-heading {
        padding-top: 20px;
    }
    
    .results-subtitle {
        margin-bottom: 20px;
    }
    
    .key-metrics-row {
        padding: 20px;
    }
    
    .key-metric {
        flex: 25%;
    }
    
    .section-heading {
        padding: 15px 20px;
    }
    
    .compact-table th:first-child,
    .compact-table td:first-child {
        padding-left: 20px;
    }
    
    .roi-calculation,
    .cta-buttons,
    .results-disclaimer {
        padding: 20px;
    }
    
    .cta-buttons {
        flex-direction: row;
        gap: 15px;
    }
    
    .cta-button {
        margin-bottom: 0;
    }
    
    .back-button {
        margin: 0 20px 20px;
    }
    
    /* Maintain exact spacing for turnover columns */
    .turnover-columns {
        gap: 0;
    }
    
    .turnover-column:first-child {
        padding-right: 10px;
    }
    
    .turnover-column:last-child {
        padding-left: 10px;
    }
    
    /* For larger screens, ensure content doesn't stretch too much */
    .turnover-panel, 
    .roi-panel {
        padding: 20px;
    }
    
    /* Keep ROI number prominent but not overpowering */
    .roi-big-value {
        font-size: 2.5rem;
    }
}

.compact-table .positive-change {
    color: #4CAF50;
    font-weight: 600;
}

.compact-table .highlight-row {
    background-color: #f9f9f9;
}

/* Fix missing metric value styles */
.metric-value-change {
    margin-bottom: 8px;
}

.metric-value-change:last-child {
    margin-bottom: 0;
}

.metric-value-change .metric-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 2px;
}

.metric-value-change .metric-value {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
}

.roi-big-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #b8860b;
    text-align: center;
    line-height: 1.1;
    margin: 5px 0 0;
}

/* Remove duplicate SVG icon definitions (keep only one set) */
.tools-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23455a64" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>');
}

.cost-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23455a64" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg>');
}

.time-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23455a64" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>');
}

.profit-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23455a64" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline><polyline points="17 6 23 6 23 12"></polyline></svg>');
}

/* Add helper classes back */
.visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

/* Ensure very small screens stack panels for better display */
@media (max-width: 360px) {
    .turnover-panel, 
    .roi-panel {
        flex: 1 0 100%;
        margin-bottom: 8px;
    }
}

/* Critical icon styles */
.metric-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    margin-bottom: 6px;
    color: #455a64;
}

/* Required classes for proper display */
.required-field {
    color: #ff0000;
}

.upsell-container.hidden {
    display: none;
}

.inline-label {
    display: inline;
    margin-left: 0.5em;
}

.roi-main-container {
    margin: 0;
    padding: 0;
    overflow: visible;
    position: relative;
}

/* Mobile view adjustments */
@media (max-width: 767px) {
    .section-heading {
        padding-bottom: 8px;
    }
    
    .key-metric {
        margin-bottom: 12px;
    }
    
    .key-metrics-row {
        margin-bottom: 20px;
    }
}

/* Split turnover panel into 50/50 columns, stacked on mobile */
.turnover-columns {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
}

.turnover-column {
    flex: 0 0 100%;
    box-sizing: border-box;
    padding: 0 0 10px 0;
}

.turnover-column:first-child {
    padding-right: 0;
}

.turnover-column:last-child {
    padding-left: 0;
    padding-bottom: 0;
}

.turnover-column .panel-title {
    margin: 0 0 10px;
    font-size: inherit;
    font-weight: 600;
    color: #333;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 5px;
}

.turnover-column .metric-value-change {
    margin-bottom: 8px;
}

.turnover-column .metric-value-change:last-child {
    margin-bottom: 0;
}

.turnover-column .metric-value {
    font-size: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Desktop layout - columns side by side */
@media (min-width: 768px) {
    .turnover-columns {
        flex-direction: row;
        gap: 0;
    }
    
    .turnover-column {
        flex: 0 0 50%;
        padding: 0;
    }
    
    .turnover-column:first-child {
        padding-right: 10px;
    }
    
    .turnover-column:last-child {
        padding-left: 10px;
    }
}

/* Small screen adjustments for turnover columns */
@media (max-width: 360px) {
    .turnover-column .metric-value {
        font-size: inherit;
    }
}

/* Development Effort Breakdown */
.dev-effort-breakdown {
    padding: 10px 15px;
    margin: 0;
    border-bottom: 1px solid #e0e0e0;
}

.dev-effort-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.dev-effort-item:last-child {
    border-bottom: none;
}

.effort-label {
    flex: 1;
    font-weight: normal;
    padding-right: 10px;
}

.effort-hours {
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.total-effort {
    margin-top: 8px;
    border-top: 1px solid #e0e0e0;
    border-bottom: none;
    padding-top: 12px;
}

.total-effort .effort-label {
    font-weight: 600;
}

/* Desktop improvements */
@media (min-width: 768px) {
    .dev-effort-breakdown {
        padding: 15px 20px;
    }
}

/* Email form description */
.email-form-description {
    margin: 0 0 15px 0;
    font-size: 0.9em;
    color: #555;
    line-height: 1.5;
}

/* Email form container with proper spacing */
.email-form-container {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 6px;
    margin: 15px;
    border: 1px solid #e0e0e0;
}

.email-form-heading {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

/* Audit Form - Inline expandable form */
.audit-form-container {
    width: 100%;
    margin: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, margin 0.3s ease-in-out;
    opacity: 0;
}

.audit-form-container.form-visible {
    max-height: 500px;
    opacity: 1;
    margin: 15px 0;
}

.audit-form {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.audit-form .input-field {
    margin-bottom: 15px;
}

.audit-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
    color: #333;
}

.audit-form .required {
    color: #ff5252;
    margin-left: 2px;
}

.audit-form .form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.audit-form .form-input:focus {
    border-color: #005ea2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 94, 162, 0.1);
}

.audit-form-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 20px;
}

.audit-form-buttons button {
    flex: 1;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    border: none;
    text-align: center;
}

.audit-form-buttons .primary-button {
    background-color: #005ea2;
    color: white;
}

.audit-form-buttons .secondary-button {
    background-color: #e0e0e0;
    color: #333;
}

/* Loading indicator */
.audit-form-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    text-align: center;
}

.audit-form-loading .spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #005ea2;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* Success and error messages */
.audit-form-success, 
.audit-form-error {
    padding: 20px 15px;
    text-align: center;
    border-radius: 6px;
}

.audit-form-success {
    background-color: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
}

.audit-form-error {
    background-color: rgba(244, 67, 54, 0.1);
    color: #d32f2f;
}

/* Desktop improvements for audit form */
@media (min-width: 768px) {
    .audit-form {
        padding: 25px;
    }
    
    .audit-form-buttons {
        flex-direction: row;
    }
}

/* Fix for the buttons in cta-buttons container */
.cta-buttons {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Ensure proper spacing between CTA elements */
.cta-button {
    margin-bottom: 15px;
}

/* Mobile optimization for all results elements */
@media (max-width: 767px) {
    /* Apply consistent box sizing and prevent overflow for all results components */
    #results-panel, 
    #results-content,
    .results-top-panels,
    .turnover-panel,
    .roi-panel,
    .key-metrics-row,
    .key-metric,
    .section-heading,
    .compact-table,
    .roi-calculation,
    .results-disclaimer,
    .cta-buttons,
    .dev-effort-breakdown,
    .audit-form-container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Ensure consistent padding while respecting layout */
    .turnover-panel,
    .roi-panel,
    .key-metrics-row,
    .key-metric,
    .section-heading,
    .roi-calculation,
    .results-disclaimer,
    .cta-buttons,
    .dev-effort-breakdown {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Table needs special handling for mobile to prevent overflow */
    .compact-table {
        table-layout: fixed !important;
        font-size: 0.9rem !important;
    }
    
    .compact-table th,
    .compact-table td {
        padding: 10px 4px !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Add horizontal scrolling only for the table if needed */
    .compact-table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 !important;
    }
}

/* Override any existing select styles to fix double arrow issue */
.roi-calculator-container select,
.roi-calculator-container .roi-select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23232b32' d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    padding-right: 30px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: #fff !important;
}

/* Fix for Firefox which may show both arrows */
.roi-calculator-container select::-ms-expand,
.roi-calculator-container .roi-select::-ms-expand {
    display: none !important;
}

/* Ensure vertical alignment in desktop view */
@media (min-width: 769px) {
    /* Make input cards same height in desktop view */
    .roi-calculator-container .form-layout {
        align-items: stretch;
    }
    
    /* Ensure fieldsets expand to fill their container */
    .roi-calculator-container .input-card fieldset {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    /* Space elements evenly in supplements card */
    .roi-calculator-container .supplements-card fieldset {
        justify-content: space-between;
    }
    
    /* Fix alignment of elements inside supplements card */
    .roi-calculator-container .supplements-card label {
        margin-top: 10px;
    }
    
    /* Ensure consistent spacing between elements */
    .roi-calculator-container .supplements-card select {
        margin-bottom: 12px;
    }
    
    /* Fix checkbox alignment */
    .roi-calculator-container .checkbox-row {
        margin-top: auto;
        padding-top: 15px;
    }
}

/* Tooltip styles */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #666;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 5px;
    cursor: help;
}

.tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9em;
    font-weight: normal;
    line-height: 1.4;
    pointer-events: none;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.roi-panel .panel-title {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .roi-panel .panel-title {
        justify-content: flex-start;
    }
}

/* Compounding effect column styling */
.compounding-effect {
    color: #4CAF50;
    font-weight: 600;
}

/* Updated table styles to better display the compounding effect */
.compact-table th:last-child {
    background-color: rgba(76, 175, 80, 0.1);
}

.compact-table td:last-child {
    background-color: rgba(76, 175, 80, 0.05);
}

.compact-table .subtotal-row {
    font-weight: bold;
    background-color: rgba(76, 175, 80, 0.05);
    border-top: 1px solid #e0e0e0;
}

.compact-table .divider-row {
    height: 1px;
    padding: 0;
}

.compact-table .divider-row td {
    padding: 10px 0;
}

.compact-table .divider-row hr {
    border: 0;
    height: 1px;
    background-color: #ccc;
    margin: 0;
}

/* Highlighted value for total turnover change - make it more prominent */
.highlighted-value {
    font-weight: bold;
    color: #4CAF50 !important;
    text-decoration: double underline;
    text-decoration-color: #4CAF50;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* Margin disclaimer styling */
.margin-disclaimer {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    padding-top: 5px;
    border-top: 1px dotted #ddd;
} 