/* Width containment wrapper - ONLY addition to prevent breaking WordPress themes */
.alltrust-calc-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Original Calculator Styles */
.alltrust-calc-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.calculator-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
}

/* Header */
.calculator-header {
    background: linear-gradient(135deg, #25293C 0%, #1589BC 100%);
    color: white;
    padding: 30px;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 4px 15px rgba(21, 137, 188, 0.2);
}

.calculator-header h1 {
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 5px;
    color: white !important;
}

.calculator-header p {
    font-size: 1.1em;
    opacity: 0.95;
    color: white !important;
}

/* Main Content */
.calculator-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 0;
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Input Panel */
.input-panel {
    padding: 40px;
    background: #fafbfc;
    border-right: 1px solid #e5e7eb;
}

.input-panel h2 {
    color: #1a365d;
    font-size: 1.4em;
    margin-bottom: 30px;
    font-weight: 600;
}

.input-group {
    margin-bottom: 30px;
}

.input-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.input-label span:first-child {
    color: #4a5568;
    font-size: 0.95em;
    font-weight: 500;
}

.input-value {
    color: #1589BC;
    font-weight: 600;
    font-size: 1.1em;
}

/* Slider Styles */
.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25293C 0%, #1589BC 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(21, 137, 188, 0.3);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(21, 137, 188, 0.4);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25293C 0%, #1589BC 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(21, 137, 188, 0.3);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(21, 137, 188, 0.4);
}

/* Results Panel */
.results-panel {
    padding: 40px;
    background: white;
}

.results-panel h2 {
    color: #1a365d;
    font-size: 1.4em;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Chart Container */
.chart-container {
    height: 300px;
    margin-bottom: 30px;
    padding: 20px;
    background: #fafbfc;
    border-radius: 8px;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.metric {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.metric:hover {
    transform: translateY(-2px);
}

.metric-icon {
    font-size: 2em;
}

.metric-details {
    flex: 1;
}

.metric-label {
    font-size: 0.85em;
    color: #6b7280;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.4em;
    font-weight: 700;
    color: #1a365d;
}

/* Additional Results */
.additional-results {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    color: #4a5568;
    font-size: 0.95em;
    font-weight: 500;
}

.result-value {
    font-weight: 700;
    color: #1a365d;
    font-size: 1.1em;
}

.result-value.surplus {
    color: #10b981;
}

.result-value.shortfall {
    color: #ef4444;
}

/* Download Button */
.download-button {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #25293C 0%, #1589BC 100%);
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(21, 137, 188, 0.2);
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(21, 137, 188, 0.35);
    background: linear-gradient(135deg, #1589BC 0%, #25293C 100%);
}

.download-button svg {
    width: 20px;
    height: 20px;
}

/* Responsive Design */
@media (max-width: 968px) {
    .calculator-content {
        grid-template-columns: 1fr;
    }
    
    .input-panel {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .alltrust-calc-container {
        padding: 0 10px;
    }
    
    .calculator-header {
        padding: 20px;
        border-radius: 8px 8px 0 0;
    }
    
    .calculator-header h1 {
        font-size: 1.5em;
    }
    
    .input-panel,
    .results-panel {
        padding: 25px;
    }
    
    .metric {
        padding: 15px;
    }
    
    .metric-value {
        font-size: 1.2em;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .download-button {
        font-size: 1em;
        padding: 14px 20px;
    }
}

/* Email Modal Styles */
.email-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 40px;
    border: none;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover,
.modal-close:focus {
    color: #1589BC;
}

.modal-content h2 {
    color: #25293C;
    margin-bottom: 10px;
    font-size: 1.8em;
    text-align: center;
}

.modal-content > p {
    color: #666;
    margin-bottom: 30px;
    text-align: center;
    font-size: 1em;
}

#leadCaptureForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #4a5568;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.form-group input {
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #1589BC;
    box-shadow: 0 0 0 3px rgba(21, 137, 188, 0.1);
}

.submit-button {
    padding: 16px 24px;
    background: linear-gradient(135deg, #25293C 0%, #1589BC 100%);
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 41, 60, 0.3);
}

.privacy-note {
    text-align: center;
    color: #9ca3af;
    font-size: 0.85em;
    margin-top: 15px;
    font-style: italic;
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 30px 20px;
        margin: 10% auto;
    }
    
    .modal-content h2 {
        font-size: 1.5em;
    }
}