/**
 * Dr. Fossum's Reward System Enhancements - Frontend Styles
 */

/* ==========================================================================
   Nominee Selection Enhancements
   ========================================================================== */

.drfossum-no-referrer-options {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-family: inherit;
}

.drfossum-no-referrer-options h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.drfossum-no-referrer-options .form-row {
    margin-bottom: 15px;
}

.drfossum-no-referrer-options .woocommerce-form__label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.drfossum-no-referrer-options .woocommerce-form__input-checkbox {
    margin: 0;
    flex-shrink: 0;
    margin-top: 2px;
}

.drfossum-potential-referrer-fields {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.drfossum-potential-referrer-fields .form-row {
    margin-bottom: 15px;
}

.drfossum-potential-referrer-fields .form-row:last-child {
    margin-bottom: 0;
}

.refMsg {
    font-style: italic;
    color: #6c757d;
    margin: 15px 0 0 0;
    padding: 10px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    line-height: 1.5;
}

/* Enhanced Select2 Styling for Nominee Selection */
.rs_select_nominee_in_checkout + .select2-container {
    width: 100% !important;
}

.rs_select_nominee_in_checkout + .select2-container .select2-selection {
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 40px;
    padding: 5px;
}

.rs_select_nominee_in_checkout + .select2-container .select2-selection__rendered {
    padding-left: 5px;
    line-height: 28px;
}

.rs_select_nominee_in_checkout + .select2-container .select2-selection__placeholder {
    color: #999;
}

/* ==========================================================================
   Social Sharing Enhancements
   ========================================================================== */

.rs_social_buttons {
    margin: 20px 0;
}

.rs_social_buttons .rs_share_btns {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.rs_social_buttons .rs_share_btns li {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

/* Facebook Share Button Enhancement */
.rs_social_buttons .share_wrapper_default_url {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #4267B2;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    min-width: 73px;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.rs_social_buttons .share_wrapper_default_url:hover {
    background: #365899;
    color: white;
    text-decoration: none;
}

/* WhatsApp Share Button Enhancement */
.rs_social_buttons .rs-whatsapp-share-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #25D366;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    min-width: 73px;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.rs_social_buttons .rs-whatsapp-share-button:hover {
    background: #128C7E;
    color: white;
    text-decoration: none;
}

/* Email Share Button Enhancement */
.rs_social_buttons .toggle-email-share-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #6c757d;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    min-width: 73px;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.rs_social_buttons .toggle-email-share-button:hover {
    background: #545b62;
    color: white;
    text-decoration: none;
}

/* Social Media Icons */
.rs_social_buttons img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1); /* Make icons white */
}

/* Twitter Button Enhancement */
.rs_social_buttons .twitter-share-button {
    min-width: 73px !important;
    height: 29px !important;
}

/* Email Share Field */
.email-share-field {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    padding: 15px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    min-width: 300px;
}

.email-share-field.active {
    display: block;
}

.email-share-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
}

.email-share-field input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 10px;
}

.email-share-field input[type="button"] {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 5px;
}

.email-share-field .email-share-button {
    background: #007cba;
    color: white;
}

.email-share-field .email-share-button:hover {
    background: #005a87;
}

.email-share-field .email-share-close-button {
    background: #dc3545;
    color: white;
    padding: 6px 10px;
}

.email-share-field .email-share-close-button:hover {
    background: #c82333;
}

/* Position relative for email share container */
.rs_social_buttons li:has(.toggle-email-share-button) {
    position: relative;
}

/* ==========================================================================
   Reward Points Display Enhancement
   ========================================================================== */

.my_rpnt {
    display: inline-block;
}

.my_rpnt h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.my_rpnt h3 a {
    color: inherit;
    text-decoration: none;
}

.my_rpnt h3 a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Form Enhancements
   ========================================================================== */

/* Hide reward points registration checkbox */
.enable_reward_points {
    display: none !important;
}

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

@media (max-width: 768px) {
    .rs_social_buttons .rs_share_btns {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .rs_social_buttons .rs_share_btns li {
        width: 100%;
    }
    
    .rs_social_buttons .share_wrapper_default_url,
    .rs_social_buttons .rs-whatsapp-share-button,
    .rs_social_buttons .toggle-email-share-button {
        width: 100%;
        min-width: auto;
        justify-content: center;
    }
    
    .drfossum-no-referrer-options {
        padding: 15px;
        margin: 15px 0;
    }
    
    .email-share-field {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        right: auto;
        width: 90%;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .drfossum-no-referrer-options {
        padding: 12px;
        margin: 12px 0;
    }
    
    .drfossum-no-referrer-options h4 {
        font-size: 15px;
    }
    
    .drfossum-potential-referrer-fields {
        padding: 12px;
    }
    
    .email-share-field {
        width: 95%;
        padding: 12px;
    }
}