/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* Public styles for Woo Referral System */
.wrs-referral-link {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    margin: 15px 0;
}

.wrs-referral-link input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Referral Form Styles */
.wrs-referral-form-wrapper {
    max-width: 800px;
    margin: 20px auto;
}

.wrs-referral-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Sender Info Section */
.wrs-sender-info {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.wrs-sender-info .wrs-form-field {
    margin-bottom: 0;
}

.wrs-sender-info .description {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Form Notice Messages */
.wrs-form-notice {
    max-width: 800px;
    margin: 20px auto;
    padding: 15px 20px;
    border-radius: 4px;
    text-align: center;
}

.wrs-form-notice p {
    margin: 0;
    font-size: 16px;
}

.wrs-form-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.wrs-form-inactive {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.wrs-form-login-required {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.wrs-form-login-required .button {
    margin-top: 10px;
}

.wrs-form-message {
    margin-bottom: 20px;
    padding: 12px 15px;
    border-radius: 4px;
    display: none;
}

.wrs-form-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    display: block;
}

.wrs-form-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    display: block;
}

.wrs-referees-container {
    margin-bottom: 20px;
}

.wrs-referee-item {
    margin-bottom: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    position: relative;
}

.wrs-referee-item:first-child {
    background: transparent;
    border: none;
    padding: 0;
}

.wrs-referee-fields {
    width: 100%;
}

.wrs-form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.wrs-form-field {
    flex: 1;
    min-width: 200px;
}

.wrs-field-name,
.wrs-field-email {
    flex: 1 1 calc(50% - 10px);
}

.wrs-field-actions {
    flex: 0 0 auto;
}

.wrs-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.wrs-form-field label .required {
    color: #d63638;
}

.wrs-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.wrs-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.wrs-form-actions {
    margin-bottom: 20px;
}

.wrs-add-referee,
.wrs-remove-referee {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.wrs-add-referee:hover {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.wrs-remove-referee {
    background: #fff;
    color: #d63638;
    border-color: #d63638;
    padding: 6px 12px;
}

.wrs-remove-referee:hover {
    background: #d63638;
    color: #fff;
}

.wrs-add-referee .dashicons,
.wrs-remove-referee .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.wrs-form-submit {
    text-align: center;
    padding-top: 10px;
}

.wrs-submit-button {
    padding: 12px 40px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.wrs-submit-button:hover {
    background: #135e96;
}

.wrs-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading state */
.wrs-referral-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .wrs-field-name,
    .wrs-field-email {
        flex: 1 1 100%;
    }
    
    .wrs-field-actions {
        width: 100%;
    }
    
    .wrs-remove-referee {
        width: 100%;
        justify-content: center;
    }
    
    .wrs-referral-form {
        padding: 20px;
    }
}

/* WooCommerce My Account - Referrals Page */
.wrs-account-referrals {
    padding: 20px 0;
}

.wrs-campaign-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.wrs-campaign-section:last-of-type {
    border-bottom: none;
}

.wrs-campaign-section h3 {
    margin-bottom: 15px;
    font-size: 1.2em;
}

.wrs-referral-info {
    background: #f8f8f8;
    padding: 15px 20px;
    border-radius: 6px;
}

.wrs-referral-info p {
    margin: 0 0 10px 0;
}

.wrs-referral-info p:last-child {
    margin-bottom: 0;
}

.wrs-referral-info code {
    display: inline-block;
    background: #fff;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    word-break: break-all;
    margin-top: 5px;
}

.wrs-referral-coupons {
    margin-top: 30px;
}

.wrs-referral-coupons h3 {
    margin-bottom: 15px;
    font-size: 1.2em;
}

.wrs-referral-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.wrs-referral-tabs .wrs-tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.wrs-referral-tabs .wrs-tab:hover {
    color: #333;
}

.wrs-referral-tabs .wrs-tab.active {
    color: #333;
    border-bottom-color: #333;
    font-weight: 600;
}

.wrs-referrals-table {
    width: 100%;
    margin-top: 10px;
}

.wrs-referrals-table th {
    text-align: left;
    padding: 12px;
    background: #f5f5f5;
    font-weight: 600;
}

.wrs-referrals-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.wrs-referrals-table code {
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 13px;
}

.wrs-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.wrs-status-completed {
    background: #c6e1c6;
    color: #5b841b;
}

.wrs-status-processing {
    background: #c6e1c6;
    color: #5b841b;
}

.wrs-status-on-hold {
    background: #f8dda7;
    color: #94660c;
}

.wrs-status-pending {
    background: #e5e5e5;
    color: #777;
}

.wrs-status-cancelled,
.wrs-status-refunded,
.wrs-status-failed {
    background: #eba3a3;
    color: #761919;
}

.wrs-no-referrals {
    padding: 20px;
    background: #f8f8f8;
    border-radius: 6px;
    text-align: center;
    color: #666;
}

@media (max-width: 768px) {
    .wrs-referral-tabs {
        flex-direction: column;
        gap: 0;
    }
    
    .wrs-referral-tabs .wrs-tab {
        padding: 12px 15px;
        border-bottom: 1px solid #e0e0e0;
        margin-bottom: 0;
    }
    
    .wrs-referral-tabs .wrs-tab.active {
        background: #f5f5f5;
        border-bottom: 1px solid #e0e0e0;
    }
}


