/**
 * Zedden CRM Calculator Styles
 *
 * @package Zedden_CRM
 * @since 1.0.0
 */

/* Calculator Container */
.zcrm-calculator {
    --zcrm-primary: #2563EB;
    --zcrm-accent: #1e293b;
    --zcrm-success: #16a34a;
    --zcrm-border: #e2e8f0;
    --zcrm-bg: #f8fafc;
    --zcrm-text: #1e293b;
    --zcrm-text-light: #64748b;
    --zcrm-radius: 12px;
    
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--zcrm-radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Header */
.zcrm-calc-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--zcrm-border);
}

.zcrm-calc-header h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--zcrm-accent);
}

.zcrm-calc-header p {
    margin: 0;
    color: var(--zcrm-text-light);
    font-size: 14px;
}

/* Form */
.zcrm-calc-form {
    padding: 24px;
}

.zcrm-calc-section {
    margin-bottom: 24px;
}

.zcrm-calc-section:last-child {
    margin-bottom: 0;
}

.zcrm-calc-section h4 {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--zcrm-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.zcrm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.zcrm-form-group {
    margin-bottom: 16px;
}

.zcrm-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--zcrm-text);
    margin-bottom: 6px;
}

.zcrm-form-group input,
.zcrm-form-group select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--zcrm-border);
    border-radius: 8px;
    background: #fff;
    color: var(--zcrm-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.zcrm-form-group input:focus,
.zcrm-form-group select:focus {
    outline: none;
    border-color: var(--zcrm-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.zcrm-input-prefix span {
    position: absolute;
    left: 16px;
    color: var(--zcrm-text-light);
    font-size: 16px;
    pointer-events: none;
}

.zcrm-input-prefix input {
    padding-left: 32px;
}

.zcrm-hint {
    display: block;
    font-size: 12px;
    color: var(--zcrm-text-light);
    margin-top: 4px;
}

/* Calculate Button */
.zcrm-calc-button {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--zcrm-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.zcrm-calc-button:hover {
    background: #1d4ed8;
}

.zcrm-calc-button:active {
    transform: scale(0.98);
}

.zcrm-calc-button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Results */
.zcrm-calc-results {
    padding: 24px;
    background: var(--zcrm-bg);
}

.zcrm-result-main {
    text-align: center;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.zcrm-result-label {
    display: block;
    font-size: 14px;
    color: var(--zcrm-text-light);
    margin-bottom: 8px;
}

.zcrm-result-value {
    display: block;
    font-size: 42px;
    font-weight: 700;
    color: var(--zcrm-primary);
    line-height: 1.2;
}

.zcrm-result-breakdown {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.zcrm-result-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--zcrm-border);
    font-size: 14px;
}

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

.zcrm-result-row span:first-child {
    color: var(--zcrm-text-light);
}

.zcrm-result-row span:last-child {
    font-weight: 600;
    color: var(--zcrm-text);
}

.zcrm-result-note {
    background: #fef3c7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.zcrm-result-note p {
    margin: 0;
    font-size: 13px;
    color: #92400e;
}

/* Lead Capture Form */
.zcrm-lead-capture {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.zcrm-lead-capture h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--zcrm-accent);
}

.zcrm-lead-capture > p {
    margin: 0 0 20px 0;
    color: var(--zcrm-text-light);
    font-size: 14px;
}

.zcrm-lead-form .zcrm-form-group {
    margin-bottom: 12px;
}

.zcrm-lead-form input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid var(--zcrm-border);
    border-radius: 8px;
}

.zcrm-lead-form input:focus {
    outline: none;
    border-color: var(--zcrm-primary);
}

.zcrm-lead-button {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--zcrm-success);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.zcrm-lead-button:hover {
    background: #15803d;
}

.zcrm-lead-success {
    text-align: center;
    padding: 20px;
}

.zcrm-lead-success .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--zcrm-success);
    margin-bottom: 12px;
}

.zcrm-lead-success p {
    margin: 0;
    font-size: 16px;
    color: var(--zcrm-text);
}

.zcrm-lead-success p.zcrm-contact-notice {
    margin-top: 8px;
    font-size: 14px;
    color: var(--zcrm-muted);
}

.zcrm-booking-link {
    display: inline-block;
    margin-top: 16px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    color: #fff !important;
    background: var(--zcrm-success);
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.2s;
    animation: pulse 2s infinite;
}

.zcrm-booking-link:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
}

/* Recalculate Button */
.zcrm-recalculate {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    color: var(--zcrm-text-light);
    background: transparent;
    border: 2px solid var(--zcrm-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.zcrm-recalculate:hover {
    border-color: var(--zcrm-primary);
    color: var(--zcrm-primary);
}

/* Coming Soon Placeholder */
.zcrm-coming-soon {
    padding: 60px 24px;
    text-align: center;
    background: var(--zcrm-bg);
}

.zcrm-coming-soon p {
    margin: 0;
    color: var(--zcrm-text-light);
    font-size: 16px;
}

/* Modal Trigger */
.zcrm-calc-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: var(--zcrm-primary, #2563EB);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.zcrm-calc-trigger:hover {
    background: #1d4ed8;
    color: #fff;
}

/* Modal */
.zcrm-calc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.zcrm-calc-modal.active {
    opacity: 1;
    visibility: visible;
}

.zcrm-calc-modal-content {
    background: #fff;
    border-radius: var(--zcrm-radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.zcrm-calc-modal.active .zcrm-calc-modal-content {
    transform: translateY(0);
}

.zcrm-calc-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--zcrm-bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: var(--zcrm-text-light);
    transition: all 0.2s;
    z-index: 10;
}

.zcrm-calc-modal-close:hover {
    background: var(--zcrm-border);
    color: var(--zcrm-text);
}

/* Responsive */
@media (max-width: 600px) {
    .zcrm-calculator {
        border-radius: 0;
    }
    
    .zcrm-form-row {
        grid-template-columns: 1fr;
    }
    
    .zcrm-result-value {
        font-size: 32px;
    }
    
    .zcrm-calc-header,
    .zcrm-calc-form,
    .zcrm-calc-results {
        padding: 16px;
    }
}

/* ================================
   Modal Styles
   ================================ */

/* Body class when modal is open */
body.zcrm-modal-open {
    overflow: hidden;
}

/* Modal Overlay */
.zcrm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
}

/* Modal Container */
.zcrm-modal-container {
    background: #fff;
    border-radius: 16px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: zcrm-modal-appear 0.2s ease-out;
}

@keyframes zcrm-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal Header */
.zcrm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.zcrm-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.zcrm-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.zcrm-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Modal Body */
.zcrm-modal-body {
    overflow-y: auto;
    flex: 1;
}

/* Calculator inside modal - remove outer shadow/border */
.zcrm-modal-body .zcrm-calculator {
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
}

/* Mobile Modal Styles */
@media (max-width: 640px) {
    .zcrm-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .zcrm-modal-container {
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
        animation: zcrm-modal-slide-up 0.25s ease-out;
    }
    
    @keyframes zcrm-modal-slide-up {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
}

/* ================================
   Contact Form Styles
   ================================ */

.zcrm-contact-form-wrapper {
    padding: 24px;
    max-width: 500px;
    margin: 0 auto;
}

.zcrm-contact-header {
    margin-bottom: 24px;
}

.zcrm-contact-header p {
    margin: 0;
    color: var(--zcrm-text-light, #64748b);
    font-size: 15px;
    line-height: 1.5;
}

.zcrm-contact-form .zcrm-form-group {
    margin-bottom: 16px;
}

.zcrm-contact-form .zcrm-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--zcrm-accent, #1e293b);
    font-size: 14px;
}

.zcrm-contact-form input[type="text"],
.zcrm-contact-form input[type="email"],
.zcrm-contact-form input[type="tel"],
.zcrm-contact-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--zcrm-border, #e2e8f0);
    border-radius: var(--zcrm-radius, 8px);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.zcrm-contact-form input:focus,
.zcrm-contact-form textarea:focus {
    outline: none;
    border-color: var(--zcrm-primary, #2563EB);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.zcrm-contact-form textarea {
    resize: vertical;
    min-height: 100px;
}

.zcrm-contact-form .zcrm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.zcrm-contact-button {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.zcrm-contact-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Contact Form Success */
.zcrm-contact-success {
    text-align: center;
    padding: 40px 20px;
}

.zcrm-success-icon {
    margin-bottom: 20px;
}

.zcrm-contact-success h4 {
    margin: 0 0 12px;
    font-size: 24px;
    color: var(--zcrm-accent, #1e293b);
}

.zcrm-contact-success p {
    margin: 0;
    color: var(--zcrm-text-light, #64748b);
    font-size: 15px;
}

/* Mobile Contact Form */
@media (max-width: 480px) {
    .zcrm-contact-form .zcrm-form-row {
        grid-template-columns: 1fr;
    }
    
    .zcrm-contact-form-wrapper {
        padding: 16px;
    }
}

/* ============================================
   RESULT ACTION BUTTONS (Phase 2)
   ============================================ */

.zcrm-result-actions {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.zcrm-email-results-btn,
.zcrm-book-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    border-radius: var(--zcrm-radius, 12px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.zcrm-email-results-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.zcrm-email-results-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.zcrm-book-btn {
    background: var(--zcrm-button-bg, #2563EB);
    color: var(--zcrm-button-text, #ffffff);
    border: none;
}

.zcrm-book-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .zcrm-result-actions {
        flex-direction: column;
    }
    
    .zcrm-email-results-btn,
    .zcrm-book-btn {
        width: 100%;
    }
}

/* ============================================
   LEAD SCORE BADGES
   ============================================ */

.zcrm-lead-score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.zcrm-lead-score.hot {
    background: #fef2f2;
    color: #dc2626;
}

.zcrm-lead-score.warm {
    background: #fffbeb;
    color: #d97706;
}

.zcrm-lead-score.cool {
    background: #eff6ff;
    color: #3b82f6;
}

.zcrm-lead-score.cold {
    background: #f3f4f6;
    color: #6b7280;
}

.zcrm-lead-score-number {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}

/* Progress Indicator */
.zcrm-progress-indicator {
    display: none;
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    margin: 20px 0;
}

.zcrm-progress-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--zcrm-primary, #2563eb);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: zcrm-spin 0.8s linear infinite;
}

@keyframes zcrm-spin {
    to { transform: rotate(360deg); }
}

.zcrm-progress-message {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: var(--zcrm-text, #1e293b);
    font-weight: 600;
}

.zcrm-progress-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.zcrm-progress-steps .zcrm-step {
    padding: 8px 16px;
    background: #f3f4f6;
    color: #9ca3af;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.zcrm-progress-steps .zcrm-step.active {
    background: var(--zcrm-primary, #2563eb);
    color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.zcrm-progress-steps .zcrm-step.completed {
    background: #10b981;
    color: #ffffff;
}

.zcrm-progress-steps .zcrm-step.completed::after {
    content: '✓';
    margin-left: 6px;
}
