/**
 * WooCommerce Referral Coupons - Frontend Calculator Widget Stylesheet
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;700;800&display=swap');

.wc-referral-calc-widget {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #2d3748;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(247, 250, 252, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 15px 35px rgba(108, 92, 231, 0.06), 0 5px 15px rgba(0, 0, 0, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 800px;
    margin: 30px auto;
    box-sizing: border-box;
}

/* Header */
.wc-referral-calc-header {
    text-align: center;
    margin-bottom: 30px;
}

.wc-referral-calc-header h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 28px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #e84393 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.wc-referral-calc-header p {
    font-size: 15px;
    color: #718096;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Calculator Workspace Layout */
.wc-referral-calc-body {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.wc-referral-calc-inputs {
    flex: 1 1 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 25px;
}

.wc-referral-calc-projection {
    flex: 1 1 300px;
    background: linear-gradient(135deg, #6c5ce7 0%, #5b4bd6 100%);
    color: #ffffff;
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 10px 25px rgba(108, 92, 231, 0.25);
    position: relative;
    overflow: hidden;
}

.wc-referral-calc-projection::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

/* Controls */
.calc-control-group {
    display: flex;
    flex-direction: column;
}

.control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-counter {
    background: #6c5ce7;
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Custom HTML5 Range Input Slider styling */
.wc-ref-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    margin: 10px 0;
}

.wc-ref-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c5ce7 0%, #e84393 100%);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 3px 8px rgba(108, 92, 231, 0.4);
    transition: transform 0.15s ease;
}

.wc-ref-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.wc-ref-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c5ce7 0%, #e84393 100%);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 3px 8px rgba(108, 92, 231, 0.4);
    transition: transform 0.15s ease;
}

.wc-ref-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
}

.slider-marks {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #a0aec0;
    padding: 0 2px;
    margin-top: 5px;
}

/* AOV Button Selector Group */
.aov-button-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.aov-btn {
    flex: 1;
    background: #fff;
    border: 1px solid #cbd5e0;
    color: #4a5568;
    padding: 10px 5px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.aov-btn:hover {
    border-color: #6c5ce7;
    color: #6c5ce7;
    transform: translateY(-1px);
}

.aov-btn.active {
    background: #6c5ce7;
    border-color: #6c5ce7;
    color: #fff;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.2);
}

/* Projection UI cards */
.projection-box {
    margin-bottom: 15px;
    width: 100%;
}

.projection-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

.projection-value {
    font-family: 'Outfit', sans-serif;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
    animation: wcRefPulse 2s infinite ease-in-out;
}

.projection-sub-box {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 15px;
    width: 100%;
    margin-bottom: 10px;
}

.projection-sub-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.65);
    display: block;
}

.projection-sub-value {
    font-size: 16px;
    font-weight: 500;
}

.projection-commission-rate {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 10px;
}

/* Call to Actions button */
.wc-referral-calc-cta {
    text-align: center;
}

.wc-referral-toggle-form-btn {
    background: linear-gradient(135deg, #6c5ce7 0%, #e84393 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 15px 35px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(232, 67, 147, 0.25);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Outfit', sans-serif;
}

.wc-referral-toggle-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(232, 67, 147, 0.35);
}

.wc-referral-toggle-form-btn:active {
    transform: translateY(0);
}

/* Applications Sliding Panel Form */
.wc-referral-application-form-panel {
    margin-top: 35px;
    padding-top: 35px;
    border-top: 1px dashed #e2e8f0;
    animation: wcRefSlideDown 0.4s ease-out;
}

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

.wc-referral-application-form-panel .form-header {
    text-align: center;
    margin-bottom: 25px;
}

.wc-referral-application-form-panel .form-header h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #2d3748;
    margin: 0 0 5px 0;
}

.wc-referral-application-form-panel .form-header p {
    font-size: 13px;
    color: #718096;
    margin: 0;
}

.wc-referral-application-form-panel label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #4a5568;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wc-referral-application-form-panel .required {
    color: #e53e3e;
}

.form-row-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.form-row-half {
    flex: 1 1 250px;
}

.form-row-full {
    margin-bottom: 15px;
}

.wc-referral-application-form-panel input[type="text"],
.wc-referral-application-form-panel input[type="email"],
.wc-referral-application-form-panel input[type="url"],
.wc-referral-application-form-panel textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #cbd5e0;
    background-color: #fff;
    box-sizing: border-box;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.wc-referral-application-form-panel input:focus,
.wc-referral-application-form-panel textarea:focus {
    border-color: #6c5ce7;
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.form-submit-row {
    text-align: center;
    margin-top: 25px;
}

.submit-btn {
    background: #6c5ce7;
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 12px 40px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.submit-btn:hover {
    background: #5b4bd6;
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.3);
}

/* Spinner */
.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: wcRefSpin 0.8s linear infinite;
}

@keyframes wcRefSpin {
    to { transform: rotate(360deg); }
}

/* Response Notifications */
.form-response-msg {
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
}

.form-response-msg.success {
    background-color: #f0fff4;
    color: #276749;
    border: 1px solid #c6f6d5;
}

.form-response-msg.error {
    background-color: #fff5f5;
    color: #9b2c2c;
    border: 1px solid #fed7d7;
}

/* Dynamic Animation helper */
@keyframes wcRefPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@media(max-width: 600px) {
    .wc-referral-calc-widget {
        padding: 20px;
    }
    .wc-referral-calc-body {
        flex-direction: column;
    }
    .projection-value {
        font-size: 30px;
    }
    .aov-button-group {
        flex-wrap: wrap !important;
    }
    .aov-btn {
        flex: 1 1 30% !important;
        min-width: 70px !important;
        padding: 8px 4px !important;
    }
}
