/**
 * ROI Calculator Premium Professional Styles
 * Adapted from static UI - Complete Professional Theme
 * 
 * @package ROI_Calculator
 * @since   1.0.0
 */

/* ==========================================================================
   Reset and Base Styles
   ========================================================================== */

* {
    box-sizing: border-box;
}

/* ==========================================================================
   Main Container
   ========================================================================== */

.roi-calculator-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.calculator-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    border-top: 4px solid #fbd846;
}

/* ==========================================================================
   Header Section
   ========================================================================== */

.roi-calculator-header {
    background: #1e3c72;
    color: white;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.roi-calculator-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.roi-calculator-header p {
    font-size: 1.2rem;
    opacity: 0.95;
    position: relative;
    z-index: 2;
    margin: 0;
}

/* ==========================================================================
   Tabs Navigation
   ========================================================================== */

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.tab {
    flex: 1;
    padding: 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #6c757d;
    position: relative;
    background: #f8f9fa;
    border: none;
    outline: none;
}

.tab.active {
    color: #1e3c72;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(30, 60, 114, 0.1);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #1e3c72;
}

.tab:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.tab.active:hover {
    background: #ffffff;
}

/* ==========================================================================
   Tab Content Panels
   ========================================================================== */

.tab-content {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

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

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff !important;
}

/* Prevent browser autofill dark backgrounds */
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #2c3e50 !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #1e3c72 !important;
    box-shadow: 0 0 0 2px rgba(30, 60, 114, 0.15) !important;
    background: #ffffff !important;
}

.input-prefix,
.input-suffix {
    position: absolute;
    color: #6c757d;
    pointer-events: none;
    font-weight: 600;
}

.input-prefix {
    left: 0.85rem;
    color: #1e3c72;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
}

.input-suffix {
    right: 1rem;
}

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

.input-with-suffix {
    padding-right: 3rem;
}

.help-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Enhanced styling for form sections */
.tab-content h2 {
    color: #1e3c72;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #1e3c72;
}

/* Special styling for equipment type selector */
#equipmentType {
    background: #ffffff;
    border: 2px solid #1e3c72;
    color: #1e3c72;
    font-weight: 600;
}

#equipmentType:focus {
    border-color: #1e3c72;
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
}

/* ==========================================================================
   Results Section
   ========================================================================== */

.results-section {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    border: 1px solid #e9ecef;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1e3c72 0%, #fbd846 100%);
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(251, 216, 70, 0.15);
    border-color: #fbd846;
}

.result-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e3c72;
}

.result-value.positive {
    background: linear-gradient(135deg, #28a745 0%, #fbd846 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-value.negative {
    color: #dc3545;
}

/* ==========================================================================
   Savings Breakdown
   ========================================================================== */

.savings-breakdown {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    border: 1px solid #e9ecef;
}

.savings-breakdown h3 {
    color: #1e3c72;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #fbd846;
}

.savings-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s ease;
}

.savings-item:hover {
    background: rgba(251, 216, 70, 0.05);
    border-radius: 4px;
    margin: 0 -0.5rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.savings-item:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 2px solid #1e3c72;
    background: #f8f9fa;
    border-radius: 6px;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

/* Removed shimmer effect for cleaner look */

.btn-primary {
    background: #1e3c72;
    color: white;
    border: 2px solid transparent;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.btn-primary:hover {
    background: #2a4d8a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 60, 114, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    margin-left: 1rem;
    border: 2px solid #1e3c72;
}

.btn-secondary:hover {
    background: #1e3c72;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 60, 114, 0.3);
}

.tab-navigation {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(251, 216, 70, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tab-navigation .btn {
    min-width: 200px;
}

@media (max-width: 768px) {
    .tab-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .tab-navigation .btn {
        width: 100%;
        min-width: auto;
    }
}

/* ==========================================================================
   Chart Container
   ========================================================================== */

.chart-container {
    margin-top: 2rem;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    height: 400px;
    position: relative;
    border: 1px solid #e9ecef;
}

/* ==========================================================================
   Loading States and Messages
   ========================================================================== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #fbd846;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

.error-message {
    background: #fee;
    color: #c33;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    border-left: 4px solid #dc3545;
}

.success-message {
    background: #d4edda;
    color: #2e7d2e;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    border-left: 4px solid #28a745;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .roi-calculator-wrapper {
        padding: 1rem;
    }

    .roi-calculator-header h1 {
        font-size: 2rem;
    }

    .two-column {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-direction: column;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .btn-secondary {
        margin-left: 0;
        margin-top: 1rem;
        display: block;
        width: 100%;
    }

    .tab-content {
        padding: 1rem;
    }
}

/* ==========================================================================
   Selection and Scrollbar Styling
   ========================================================================== */

::selection {
    background: rgba(251, 216, 70, 0.3);
    color: #1e3c72;
}

::-moz-selection {
    background: rgba(251, 216, 70, 0.3);
    color: #1e3c72;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #1e3c72 0%, #fbd846 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #fbd846 0%, #1e3c72 100%);
}

/* ==========================================================================
   WordPress Integration Styles
   ========================================================================== */

.roi-calculator-wrapper h1,
.roi-calculator-wrapper h2,
.roi-calculator-wrapper h3,
.roi-calculator-wrapper h4 {
    margin-top: 0;
}

.roi-calculator-wrapper .tab-content h2 {
    margin-top: 0;
}

/* Ensure compatibility with WordPress themes */
.roi-calculator-wrapper * {
    box-sizing: border-box;
}

.roi-calculator-wrapper input,
.roi-calculator-wrapper select,
.roi-calculator-wrapper button {
    font-family: inherit;
}

/* Hide from printing */
@media print {
    .action-buttons,
    .tabs {
        display: none !important;
    }
}

/* ==========================================================================
   Lead Magnet Specific Styles - v1.2.0
   ========================================================================== */

/* Tab Numbers */
.tab-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #e9ecef;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    margin-right: 8px;
    color: #6c757d;
}

.tab.active .tab-number {
    background: #1e3c72;
    color: white;
}

/* Form Sections */
.form-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.form-section h3 {
    color: #1e3c72;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.section-description {
    color: #6c757d;
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
}

.section-title-spacing {
    margin-top: 2rem !important;
}

/* Contact Section */
.contact-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #1e3c72;
}

.full-width {
    grid-column: 1 / -1;
}

/* Three Column Layout for Labor Calculator */
.three-column {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .three-column {
        grid-template-columns: 1fr;
    }
}

/* Calculated Field Display */
.calculated-field {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #1e3c72;
}

.calculated-field label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.calculated-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e3c72;
}

.calculation-note {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.calculated-field.compact {
    padding: 0.75rem;
    margin-top: 1rem;
}

.calculated-field.compact .calculated-value {
    font-size: 1.5rem;
}

/* Labor Savings Info Box */
.labor-savings-info {
    display: flex;
    gap: 1rem;
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.info-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #e3f2fd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e3c72;
}

.info-content {
    flex: 1;
}

.info-content h4 {
    margin: 0 0 0.5rem 0;
    color: #1e3c72;
    font-size: 1rem;
}

.info-content p {
    margin: 0 0 1rem 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Labor Comparison Display */
.labor-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.labor-current,
.labor-new {
    text-align: center;
}

.labor-current .label,
.labor-new .label {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
}

.labor-current .value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #dc3545;
}

.labor-new .value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #28a745;
}

.labor-arrow {
    font-size: 1.5rem;
    color: #1e3c72;
    font-weight: bold;
}

@media (max-width: 768px) {
    .labor-savings-info {
        flex-direction: column;
    }

    .labor-comparison {
        flex-direction: column;
    }

    .labor-arrow {
        transform: rotate(90deg);
    }
}

/* ==========================================================================
   Blurred Results & CTA Overlay
   ========================================================================== */

.blurred-results {
    position: relative;
    overflow: hidden;
}

.blur-overlay {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

.cta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    z-index: 10;
}

.cta-content {
    text-align: center;
    max-width: 500px;
    padding: 2rem;
}

.cta-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #1e3c72 0%, #2a4d8a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.cta-content h3 {
    color: #1e3c72;
    font-size: 1.75rem;
    margin: 0 0 1rem 0;
}

.cta-content > p {
    color: #495057;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
}

/* CTA Benefits List */
.cta-benefits {
    margin: 1.5rem 0;
    text-align: left;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: #495057;
}

.benefit-item svg {
    color: #28a745;
    flex-shrink: 0;
}

.benefit-item span {
    font-size: 0.95rem;
}

/* Contact Display */
.cta-contact {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.contact-text {
    margin: 0;
    color: #495057;
}

.contact-text strong {
    color: #1e3c72;
}

/* CTA Actions */
.cta-actions {
    margin: 1.5rem 0 1rem;
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.cta-urgency {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
    font-style: italic;
}

/* ==========================================================================
   Error States
   ========================================================================== */

.input-group input.error,
.input-group select.error {
    border-color: #dc3545 !important;
    background-color: #fff8f8 !important;
}

.input-group input.error:focus {
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15) !important;
}

/* ==========================================================================
   Loading Overlay Enhancement
   ========================================================================== */

.roi-calculator-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.roi-calculator-loading .loading {
    width: 50px;
    height: 50px;
    border-width: 4px;
}

.roi-calculator-loading p {
    margin-top: 1rem;
    color: #1e3c72;
    font-weight: 600;
}