/**
 * Listeo Price Test Widget - Styles
 */

/* Widget container - fixed position */
.listeo-price-test-widget {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
}

/* Widget header */
.lptest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #4fba3a 0%, #3e9a2d 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.lptest-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    pointer-events: none; /* Ensure click goes to header */
}

.lptest-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px; /* Increased from 24px */
    height: 32px; /* Increased from 24px */
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    transition: background 0.2s;
}

.lptest-toggle:hover,
.lptest-toggle:active {
    background: rgba(255,255,255,0.4);
}

/* Widget body */
.lptest-body {
    padding: 16px;
    display: block; /* Default visible */
    max-height: 70vh;
    overflow-y: auto;
}

.listeo-price-test-widget.is-minimized .lptest-body {
    display: none;
}

.listeo-price-test-widget.is-minimized .lptest-header {
    border-radius: 12px;
}

.lptest-field {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.lptest-field label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 0;
    font-weight: 500;
    flex: 1;
    text-align: left;
}

.lptest-field input {
    width: 140px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    flex: 0 0 140px;
}

.lptest-field input:focus {
    outline: none;
    border-color: #4fba3a;
    box-shadow: 0 0 0 2px rgba(79, 186, 58, 0.2);
}

/* Calculate button */
.lptest-btn {
    width: 100%;
    padding: 14px 16px; /* Increased padding for better touch target */
    background: linear-gradient(135deg, #4fba3a 0%, #3e9a2d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s, background 0.2s;
    touch-action: manipulation;
    -webkit-appearance: none;
}

.lptest-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 186, 58, 0.4);
}

.lptest-btn:active {
    transform: translateY(1px);
    background: linear-gradient(135deg, #3e9a2d 0%, #2f7c22 100%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Status message */
.lptest-status {
    margin-top: 12px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    min-height: 20px;
}

/* Price bar on cards */
.lptest-price-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #00c853 0%, #00e676 100%);
    color: white;
    font-weight: 600;
    margin-top: 8px;
    border-radius: 0 0 8px 8px;
}

.lptest-price {
    font-size: 16px;
}

.lptest-method {
    font-size: 10px;
    opacity: 0.8;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 768px) {
    .listeo-price-test-widget {
        width: 220px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        bottom: 80px; /* Moved up to avoid overlap with chat widgets */
        border-radius: 15px;
        z-index: 999999; /* Ensure it's above chat widgets */
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
    }

    /* Full width when expanded */
    .listeo-price-test-widget:not(.is-minimized) {
        width: calc(100% - 50px);
        max-width: 400px;
        bottom: 110px; /* Move up when expanded to avoid chat widgets */
    }
    
    .lptest-header {
        padding: 12px 15px;
        border-radius: 15px 15px 0 0;
    }
    
    .lptest-header h4 {
        font-size: 16px;
    }
    
    .lptest-toggle {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .lptest-body {
        padding: 20px;
    }
    
    .lptest-field input {
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .lptest-btn {
        padding: 16px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .listeo-price-test-widget {
        width: 200px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        bottom: 10px;
    }

    /* Full width when expanded on small phones */
    .listeo-price-test-widget:not(.is-minimized) {
        width: calc(100% - 50px);
        bottom: 90px; /* Move up when expanded on small phones */
    }
}

/* N/A Price Display */
.price-na {
    color: #1f5b29 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    font-style: normal !important;
    line-height: 1.1 !important;
    cursor: help;
    font-family: inherit !important;
    text-transform: none !important;
}

/* Price bar N/A state */
.listeo-price-bar__price .price-na {
    color: #1f5b29 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
}

/* Ensure any Listeo price bars share the widget's green theme */
.listeo-price-bar {
    background: linear-gradient(135deg, #4fba3a 0%, #3e9a2d 100%) !important;
    box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.18) !important;
    border-radius: 0 0 10px 10px !important;
    color: #fff !important;
}

.listeo-price-bar:hover {
    background: linear-gradient(135deg, #3e9a2d 0%, #2f7c22 100%) !important;
}

.listeo-price-bar__label,
.listeo-price-bar__period {
    color: rgba(255, 255, 255, 0.95) !important;
}

.listeo-price-bar__price-wrapper {
    background: #fff !important;
    box-shadow: inset 0 0 0 1px rgba(79, 186, 58, 0.35) !important;
}

.listeo-price-bar__price {
    color: #1f5b29 !important;
}

.price-pill {
    background: linear-gradient(135deg, #4fba3a 0%, #3e9a2d 100%) !important;
    color: #fff !important;
    border-radius: 999px !important;
    padding: 4px 10px !important;
}
