/**
 * MPG Revenue Calculator Styles
 * Meliora Properties Group Branding
 * Fixed to match shortcode class names
 */

/* === Custom Properties === */
:root {
    --mpg-primary-blue: #1a5f7a;
    --mpg-primary-dark: #0d3d4d;
    --mpg-accent-teal: #17a2b8;
    --mpg-accent-orange: #ff8c42;
    --mpg-text-dark: #2c3e50;
    --mpg-text-light: #6c757d;
    --mpg-background: #F5F5F5;
    --mpg-white: #ffffff;
    --mpg-border: #e0e0e0;
    --mpg-success: #28a745;
    --mpg-shadow: 0 10px 40px rgba(26, 95, 122, 0.15);
    --mpg-shadow-hover: 0 15px 50px rgba(26, 95, 122, 0.25);
}

/* === Main Container === */
.mpg-calculator-container {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
    background: var(--mpg-background);
}

/* === Header Section === */
.mpg-header-section {
    text-align: center;
    margin-bottom: 40px;
}

.mpg-header-section h1 {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--mpg-primary-blue);
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.mpg-header-section p {
    font-size: 1.05rem;
    color: var(--mpg-text-light);
    margin: 0 auto;
    max-width: 700px;
    line-height: 1.6;
}

/* === Main Layout === */
.mpg-calculator-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

/* === Input Panel === */
.mpg-calculator-inputs {
    background: var(--mpg-white);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--mpg-shadow);
}

/* === Input Sections === */
.mpg-input-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--mpg-border);
}

.mpg-input-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.mpg-input-section h2 {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--mpg-text-dark);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mpg-description {
    font-size: 0.9rem;
    color: var(--mpg-text-light);
    margin: 0 0 15px 0;
    line-height: 1.5;
}

/* === Property Type Buttons === */
.mpg-property-type-buttons {
    display: flex;
    gap: 15px;
}

.mpg-property-btn {
    flex: 1;
    padding: 20px;
    border: 2px solid var(--mpg-border);
    border-radius: 12px;
    background: var(--mpg-white);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    font-family: inherit;
    color: var(--mpg-text-dark);
}

.mpg-property-btn:hover {
    border-color: var(--mpg-accent-teal);
    background: var(--mpg-primary-dark);
    color: var(--mpg-white);
    transform: translateY(-2px);
}

.mpg-property-btn.active {
    border-color: var(--mpg-primary-blue);
    background: linear-gradient(135deg, var(--mpg-primary-blue) 0%, var(--mpg-accent-teal) 100%);
    color: var(--mpg-white);
}

.mpg-property-btn .mpg-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.mpg-property-btn div:last-child {
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* === Slider Group === */
.mpg-slider-group {
    margin-top: 10px;
}

.mpg-slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--mpg-text-dark);
    font-size: 0.95rem;
}

.mpg-slider-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--mpg-primary-blue) 0%, var(--mpg-accent-teal) 100%);
    color: var(--mpg-white);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
}

/* === Icon Selector (Beds/Baths) === */
.mpg-icon-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mpg-icon-button {
    width: 50px;
    height: 50px;
    border: 2px solid var(--mpg-border);
    border-radius: 10px;
    background: var(--mpg-white);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 5px;
}

.mpg-icon-button svg {
    width: 20px;
    height: 20px;
    stroke: var(--mpg-text-light);
    transition: stroke 0.2s ease;
}

.mpg-icon-button .mpg-icon-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--mpg-text-light);
    margin-top: 2px;
}

.mpg-icon-button:hover {
    border-color: var(--mpg-accent-teal);
    transform: translateY(-2px);
}

.mpg-icon-button.active,
.mpg-icon-button.filled {
    border-color: var(--mpg-primary-blue);
    background: linear-gradient(135deg, var(--mpg-primary-blue) 0%, var(--mpg-accent-teal) 100%);
}

.mpg-icon-button.active svg,
.mpg-icon-button.filled svg {
    stroke: var(--mpg-white);
}

.mpg-icon-button.active .mpg-icon-label,
.mpg-icon-button.filled .mpg-icon-label {
    color: var(--mpg-white);
}

/* === Range Sliders === */
.mpg-slider-container {
    position: relative;
    padding: 10px 0;
}

.mpg-slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--mpg-border);
    border-radius: 4px;
    transform: translateY(-50%);
    pointer-events: none;
}

.mpg-slider-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--mpg-primary-blue) 0%, var(--mpg-accent-teal) 100%);
    border-radius: 4px;
    transform: translateY(-50%);
    pointer-events: none;
    width: 80%; /* Default, updated by JS */
}

.mpg-slider-container input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: transparent;
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.mpg-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mpg-primary-blue) 0%, var(--mpg-accent-teal) 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(26, 95, 122, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 3px solid var(--mpg-white);
}

.mpg-slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(26, 95, 122, 0.5);
}

.mpg-slider-container input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mpg-primary-blue) 0%, var(--mpg-accent-teal) 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(26, 95, 122, 0.4);
    border: 3px solid var(--mpg-white);
}

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

/* === Tooltip === */
.mpg-tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: help;
}

.mpg-help-icon {
    width: 18px;
    height: 18px;
    stroke: var(--mpg-text-light);
}

.mpg-tooltip-trigger:hover .mpg-tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mpg-tooltip-content {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--mpg-text-dark);
    color: var(--mpg-white);
    padding: 15px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 400;
    width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    line-height: 1.5;
    text-align: left;
}

.mpg-tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--mpg-text-dark);
}

.mpg-tooltip-content strong {
    display: block;
    margin-bottom: 5px;
}

/* === Results Panel === */
.mpg-results-panel {
    background: linear-gradient(135deg, var(--mpg-primary-blue) 0%, var(--mpg-primary-dark) 100%);
    border-radius: 16px;
    padding: 30px;
    color: var(--mpg-white);
    position: sticky;
    top: 20px;
    box-shadow: var(--mpg-shadow);
    transition: filter 0.3s ease;
}

.mpg-results-panel.blurred .mpg-revenue-display,
.mpg-results-panel.blurred .mpg-breakdown-section {
    filter: blur(8px);
    user-select: none;
    pointer-events: none;
}

.mpg-results-panel.blurred .mpg-unlock-message {
    display: block;
}

.mpg-results-header {
    text-align: center;
    margin-bottom: 20px;
}

.mpg-results-header h3 {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
}

/* === Revenue Display === */
.mpg-revenue-display {
    text-align: center;
    padding: 25px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mpg-revenue-amount {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--mpg-white) 0%, var(--mpg-accent-orange) 50%, var(--mpg-white) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: visible;
    line-height: 1.2;
}

@keyframes shimmer {
    0%, 100% { background-position: 200% center; }
    50% { background-position: 0% center; }
}

.mpg-revenue-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.8;
}

/* === Breakdown Section === */
.mpg-breakdown-section {
    padding-top: 10px;
}

.mpg-breakdown-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: rgba(255, 255, 255, 0.85);
}

.mpg-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 0.9rem;
    opacity: 0.9;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mpg-breakdown-item:last-child {
    border-bottom: none;
}

.mpg-breakdown-item.mpg-total-row {
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    margin-top: 10px;
    padding-top: 15px;
    font-weight: 700;
    font-size: 1rem;
    opacity: 1;
}

.mpg-breakdown-label {
    color: rgba(255, 255, 255, 0.9);
}

.mpg-breakdown-value {
    font-weight: 600;
    color: #7dffb3;
}

.mpg-total-row .mpg-breakdown-value {
    color: var(--mpg-white);
    font-size: 1.1rem;
}

/* === Revenue Note === */
.mpg-revenue-note {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 15px 0 0 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    line-height: 1.5;
    font-style: italic;
    text-align: center;
}

/* === Unlock Message === */
.mpg-unlock-message {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 25px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10;
    width: 85%;
    max-width: 320px;
}

.mpg-unlock-message h4 {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--mpg-primary-blue);
    margin: 0 0 10px 0;
}

.mpg-unlock-message p {
    font-size: 0.85rem;
    color: var(--mpg-text-light);
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.mpg-unlock-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--mpg-white);
    background: linear-gradient(135deg, var(--mpg-accent-orange) 0%, #ffaa66 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 140, 66, 0.4);
    font-family: inherit;
}

.mpg-unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 66, 0.5);
}

/* === Lead Capture Overlay === */
.mpg-lead-capture-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.mpg-lead-capture-overlay.active {
    display: flex;
}

.mpg-lead-form-container {
    background: var(--mpg-white);
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.mpg-lead-form-container h3 {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mpg-primary-blue);
    margin: 0 0 10px 0;
    text-align: center;
}

.mpg-lead-form-container > p {
    font-size: 0.95rem;
    color: var(--mpg-text-light);
    margin: 0 0 25px 0;
    text-align: center;
    line-height: 1.5;
}

/* === Lead Form === */
#mpg-lead-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

.mpg-form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mpg-text-dark);
    margin-bottom: 6px;
}

.mpg-form-group input {
    padding: 12px 15px;
    font-size: 0.95rem;
    border: 2px solid var(--mpg-border);
    border-radius: 10px;
    background: var(--mpg-white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.mpg-form-group input:focus {
    outline: none;
    border-color: var(--mpg-primary-blue);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

.mpg-form-group input::placeholder {
    color: #adb5bd;
}

.mpg-error-message {
    font-size: 0.8rem;
    color: #dc3545;
    margin-top: 5px;
    display: none;
}

.mpg-form-group.error input {
    border-color: #dc3545;
}

.mpg-form-group.error .mpg-error-message {
    display: block;
}

/* === Consent Group === */
.mpg-consent-group {
    margin-top: 5px;
}

.mpg-consent-group label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--mpg-text-light);
    line-height: 1.5;
    cursor: pointer;
}

.mpg-consent-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--mpg-primary-blue);
}

/* === Success Message === */
.mpg-success-message {
    text-align: center;
    padding: 40px 20px;
}

.mpg-success-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--mpg-success) 0%, #34c759 100%);
    color: var(--mpg-white);
    font-size: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.mpg-success-message h3 {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mpg-primary-blue);
    margin: 0 0 15px 0;
}

.mpg-success-message p {
    font-size: 1rem;
    color: var(--mpg-text-light);
    margin: 0;
    line-height: 1.6;
}

/* === Submit Button === */
.mpg-submit-btn {
    width: 100%;
    padding: 16px 30px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--mpg-white);
    background: linear-gradient(135deg, var(--mpg-primary-blue) 0%, var(--mpg-accent-teal) 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(26, 95, 122, 0.4);
    margin-top: 10px;
    font-family: inherit;
}

.mpg-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 95, 122, 0.5);
}

.mpg-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* === Responsive Design === */
@media (max-width: 900px) {
    .mpg-calculator-layout {
        grid-template-columns: 1fr;
    }

    .mpg-results-panel {
        position: relative;
        top: 0;
    }

    .mpg-header-section h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 600px) {
    .mpg-calculator-container {
        padding: 20px 15px;
    }

    .mpg-header-section h1 {
        font-size: 1.5rem;
    }

    .mpg-header-section p {
        font-size: 0.95rem;
    }

    .mpg-calculator-inputs {
        padding: 20px;
    }

    .mpg-results-panel {
        padding: 20px;
    }

    .mpg-icon-button {
        width: 42px;
        height: 42px;
    }

    .mpg-icon-button svg {
        width: 16px;
        height: 16px;
    }

    .mpg-revenue-amount {
        font-size: 1.5rem;
        white-space: nowrap;
    }

    .mpg-property-type-buttons {
        flex-direction: column;
    }

    .mpg-lead-form-container {
        padding: 25px;
        margin: 15px;
    }

    .mpg-lead-form-container h3 {
        font-size: 1.3rem;
    }

    .mpg-tooltip-content {
        width: 250px;
        left: auto;
        right: -10px;
        transform: translateY(10px);
    }

    .mpg-tooltip-content::after {
        left: auto;
        right: 15px;
        transform: none;
    }

    .mpg-unlock-message {
        width: 90%;
        padding: 20px;
    }
}

/* === Print Styles === */
@media print {
    .mpg-lead-capture-overlay {
        display: none !important;
    }

    .mpg-unlock-btn,
    .mpg-submit-btn {
        display: none;
    }

    .mpg-calculator-container {
        padding: 0;
    }

    .mpg-calculator-inputs,
    .mpg-results-panel {
        box-shadow: none;
        border: 1px solid var(--mpg-border);
    }

    .mpg-results-panel.blurred .mpg-revenue-display,
    .mpg-results-panel.blurred .mpg-breakdown-section {
        filter: none;
    }
}
