/* ROI Calculator Styles */

.roi-calculator {
    background: var(--bg-light);
    padding: 3rem 0;
    min-height: 70vh;
}

.roi-calculator-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.roi-calculator-header {
    text-align: center;
    margin-bottom: 3rem;
}

.roi-calculator-header h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.roi-calculator-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Progress Bar */
.roi-progress {
    margin-bottom: 2rem;
}

.roi-progress-bar {
    background: #e1e5e9;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.roi-progress-fill {
    background: var(--highlight-color);
    height: 100%;
    width: 25%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.roi-progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Calculator Content */
.roi-calculator-content {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-height: 500px;
}

/* Form Styles */
.roi-form-group {
    margin-bottom: 2rem;
}

.roi-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.roi-form-group label {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.roi-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.roi-input:focus {
    outline: none;
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.roi-input:required:invalid {
    border-color: #dc3545;
}

/* Company Size Options */
.company-size-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.size-option {
    position: relative;
}

.size-option input[type="radio"] {
    display: none;
}

.size-label {
    display: block;
    padding: 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
}

.size-label:hover {
    border-color: var(--highlight-color);
    background: rgba(233, 69, 96, 0.05);
}

.size-option input[type="radio"]:checked + .size-label {
    border-color: var(--highlight-color);
    background: rgba(233, 69, 96, 0.1);
}

.size-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.size-range {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Range Inputs */
.range-input-container {
    position: relative;
}

.roi-range-input {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e1e5e9;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.roi-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--highlight-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.3);
}

.roi-range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--highlight-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.3);
}

.range-value {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--highlight-color);
}

/* Input with Prefix */
.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    z-index: 1;
}

.input-with-prefix .roi-input {
    padding-left: 2.5rem;
}

/* Dynamic Content */
.industry-description,
.process-description {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-section);
    border-radius: 8px;
    border-left: 4px solid var(--highlight-color);
}

.industry-info,
.process-info {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.common-processes ul {
    margin: 0.5rem 0 0 1rem;
    list-style: disc;
}

.common-processes li {
    margin-bottom: 0.25rem;
}

.automation-score {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.score-bar {
    flex: 1;
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: var(--highlight-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.score-value {
    font-weight: 600;
    color: var(--highlight-color);
}

/* Automation Goals */
.automation-goals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.goal-card {
    background: var(--bg-section);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.goal-card:hover {
    border-color: var(--highlight-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.1);
}

.goal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.goal-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.goal-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.goal-slider {
    margin-top: 1rem;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.slider-labels span:nth-child(2) {
    color: var(--highlight-color);
    font-weight: 600;
}

/* Budget Options */
.budget-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.budget-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.budget-option:hover {
    border-color: var(--highlight-color);
    background: rgba(233, 69, 96, 0.05);
}

.budget-option input[type="radio"] {
    margin-right: 0.75rem;
    accent-color: var(--highlight-color);
}

.budget-option input[type="radio"]:checked {
    border-color: var(--highlight-color);
}

/* Results */
.roi-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.roi-metric {
    background: var(--bg-section);
    padding: 1.5rem 1rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.roi-metric.highlight {
    background: var(--gradient-accent);
    color: white;
    border-color: var(--highlight-color);
}

.roi-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.roi-metric.highlight .metric-value {
    color: white;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.2;
}

.roi-metric.highlight .metric-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Charts */
.roi-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: var(--bg-section);
    padding: 1rem;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    position: relative;
}

.chart-container h4 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.chart-container canvas {
    max-width: 100% !important;
    width: 100% !important;
    height: 250px !important;
    display: block;
}

/* CSS Fallback Charts */
.css-chart {
    width: 100%;
    height: 250px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 1rem;
    position: relative;
}

/* Cost Comparison Chart */
.cost-chart {
    gap: 2rem;
}

.chart-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 120px;
    height: 100%;
    position: relative;
}

.bar {
    width: 60px;
    min-height: 20px;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.current-bar {
    background: linear-gradient(135deg, #e94560, #c73650);
    box-shadow: 0 4px 8px rgba(233, 69, 96, 0.3);
}

.automated-bar {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    box-shadow: 0 4px 8px rgba(26, 26, 46, 0.3);
}

.bar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 0.25rem;
}

.bar-value {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

/* Waterfall Chart */
.waterfall-chart {
    gap: 0.5rem;
    align-items: center;
    position: relative;
}

.waterfall-chart::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--text-muted);
    opacity: 0.3;
    z-index: 1;
}

.waterfall-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    position: relative;
}

.waterfall-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    position: relative;
    width: 100%;
}

.waterfall-value {
    width: 40px;
    min-height: 10px;
    border-radius: 3px;
    position: absolute;
    transition: all 0.3s ease;
    z-index: 2;
}

.waterfall-value.positive {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
}

.waterfall-value.negative {
    background: linear-gradient(135deg, #f44336, #da190b);
    box-shadow: 0 2px 6px rgba(244, 67, 54, 0.3);
}

.waterfall-label {
    position: absolute;
    bottom: 40px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    width: 100%;
}

.waterfall-amount {
    position: absolute;
    bottom: 20px;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    width: 100%;
    font-weight: 500;
}

/* Navigation */
.roi-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e1e5e9;
}

.roi-navigation button {
    padding: 1rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.roi-navigation button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Actions */
.roi-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.roi-actions button,
.roi-actions a {
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 140px;
    font-size: 0.9rem;
}

/* Email Modal */
.roi-email-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.email-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.email-modal-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.email-modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f5f5f5;
    color: var(--text-dark);
}

.email-modal-body {
    padding: 1.5rem 2rem 2rem 2rem;
}

.email-capture-form .form-group {
    margin-bottom: 1.5rem;
}

.email-capture-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.email-capture-form input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.email-capture-form input:focus {
    outline: none;
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Error Messages */
.roi-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin-bottom: 1rem;
    text-align: center;
}

/* Step Descriptions */
.step-description {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .roi-calculator-content {
        padding: 2rem 1.5rem;
    }
    
    .roi-calculator-header h2 {
        font-size: 2rem;
    }
    
    .roi-form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .company-size-options {
        grid-template-columns: 1fr;
    }
    
    .automation-goals {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .roi-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .roi-charts {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-container {
        padding: 0.75rem;
    }
    
    .chart-container canvas {
        height: 200px !important;
    }
    
    .css-chart {
        height: 200px;
        padding: 0.75rem;
    }
    
    .cost-chart {
        gap: 1rem;
    }
    
    .bar {
        width: 50px;
    }
    
    .bar-label {
        font-size: 0.7rem;
    }
    
    .bar-value {
        font-size: 0.65rem;
    }
    
    .waterfall-value {
        width: 30px;
    }
    
    .waterfall-label {
        font-size: 0.6rem;
        bottom: 30px;
    }
    
    .waterfall-amount {
        font-size: 0.55rem;
        bottom: 15px;
    }
    
    .roi-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .roi-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .roi-actions button,
    .roi-actions a {
        width: 100%;
        max-width: 280px;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .roi-metric {
        padding: 1rem 0.75rem;
        min-height: 100px;
    }
    
    .metric-label {
        font-size: 0.75rem;
    }
    
    .goal-card {
        padding: 1.5rem;
    }
    
    .email-modal-content {
        width: 95%;
    }
    
    .email-modal-header,
    .email-modal-body {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .roi-calculator-container {
        padding: 0 1rem;
    }
    
    .roi-summary {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .roi-metric {
        padding: 0.75rem;
        min-height: 90px;
    }
    
    .metric-value {
        font-size: 1.4rem;
    }
    
    .metric-label {
        font-size: 0.7rem;
    }
    
    .chart-container {
        padding: 0.5rem;
    }
    
    .chart-container h4 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .chart-container canvas {
        height: 150px !important;
    }
    
    .css-chart {
        height: 150px;
        padding: 0.5rem;
    }
    
    .cost-chart {
        gap: 0.5rem;
    }
    
    .bar {
        width: 40px;
    }
    
    .bar-label {
        font-size: 0.65rem;
    }
    
    .bar-value {
        font-size: 0.6rem;
    }
    
    .waterfall-value {
        width: 25px;
    }
    
    .waterfall-label {
        font-size: 0.55rem;
        bottom: 25px;
    }
    
    .waterfall-amount {
        font-size: 0.5rem;
        bottom: 10px;
    }
}