/* === ملف التنسيقات الموحد لإضافة الإحالة === */

/* Admin Dashboard Styles */
.referral-admin-wrapper {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    font-family: 'Cairo', sans-serif;
}

.rr-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.rr-header h1 {
    color: #0865fe;
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

/* Main Tab Navigation */
.rr-main-tabs {
    display: flex;
    background: #ffffff;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(8, 101, 254, 0.1);
    border: 1px solid #e2e8f0;
}

.rr-main-tab {
    flex: 1;
    padding: 15px 20px;
    text-align: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.rr-main-tab:hover {
    background: #f1f5f9;
    color: #0865fe;
}

.rr-main-tab.active {
    background: #0865fe;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(8, 101, 254, 0.3);
}

/* Sub Tab Navigation */
.rr-sub-tabs {
    display: flex;
    background: #ffffff;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.rr-sub-tab {
    flex: 1;
    padding: 10px 15px;
    text-align: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.rr-sub-tab:hover {
    background: #f8fafc;
    color: #0865fe;
}

.rr-sub-tab.active {
    background: #0865fe;
    color: #ffffff;
}

/* Tab Content */
.rr-tab-content {
    display: none;
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.rr-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.rr-sub-content {
    display: none;
}

.rr-sub-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Styling */
.form-table th {
    color: #1e293b;
    font-weight: 600;
    padding: 15px 10px 15px 0;
}

.form-table td {
    padding: 15px 10px;
}

.form-table input[type="text"],
.form-table input[type="number"],
.form-table input[type="email"],
.form-table select {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-table input[type="text"]:focus,
.form-table input[type="number"]:focus,
.form-table input[type="email"]:focus,
.form-table select:focus {
    border-color: #0865fe;
    box-shadow: 0 0 0 3px rgba(8, 101, 254, 0.1);
    outline: none;
}

/* Radio button styling */
.form-table input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2);
    accent-color: #0865fe;
}

.form-table label {
    display: block;
    margin: 8px 0;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
}

.form-table label:hover {
    background-color: #f0f7ff;
    border-color: #0865fe;
}

.form-table label input[type="radio"]:checked + strong {
    color: #0865fe;
}

.form-table label:has(input[type="radio"]:checked) {
    background-color: #f0f7ff;
    border-left: 4px solid #0865fe;
    border-color: #0865fe;
}

.form-table label strong {
    color: #1e293b;
    font-weight: 600;
}

/* Button Styling */
.button-primary {
    background: #0865fe !important;
    border-color: #0865fe !important;
    color: #ffffff !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.button-primary:hover {
    background: #074bb5 !important;
    border-color: #074bb5 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 101, 254, 0.3);
}

.button-secondary {
    background: #64748b !important;
    border-color: #64748b !important;
    color: #ffffff !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.button-secondary:hover {
    background: #475569 !important;
    border-color: #475569 !important;
}

/* Table Styling */
.wp-list-table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wp-list-table th {
    background: #f8fafc;
    color: #1e293b;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.wp-list-table td {
    border-bottom: 1px solid #f1f5f9;
}

/* Success/Error Messages */
.rr-alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
    border-right: 4px solid;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

.rr-alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #22c55e;
}

.rr-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #ef4444;
}

.rr-alert.fade-out {
    animation: slideOut 0.5s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Frontend Styles */
.lp-profile-referral-code {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #ddd;
    margin: 20px 0;
}

.lp-profile-referral-code h6.text-muted {
    color: #666;
    font-size: 16px;
    margin-bottom: 5px;
}

.lp-profile-referral-code p {
    font-size: 15px;
    color: #333;
    margin-bottom: 15px;
}

.lp-profile-referral-code .alert-custom {
    background-color: #f8f9fa;
    border-right: 4px solid #0865fe;
    color: #2f4368;
    padding: 15px;
    border-radius: 5px;
    font-size: 15px;
    margin-top: 20px;
    text-align: right;
}

.lp-profile-referral-code .alert-custom a {
    color: #0865fe;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.lp-profile-referral-code .alert-custom a:hover {
    text-decoration: underline;
    color: #074bb5;
}

/* === صندوق الإحالة === */
.referral-container {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    padding: 20px;
    border-radius: 12px;
}

.referral-tabs-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
}

.referral-tabs-nav button {
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.referral-tab-content {
    display: none;
    padding: 20px;
    border-radius: 12px;
    animation: fadeIn 0.6s ease;
}

.referral-tab-content.active {
    display: block;
}

.referral-code-box {
    position: relative;
    display: flex;
    align-items: center;
}

#referral-code-input {
    padding-left: 45px !important;
}

.copy-button {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    font-size: 22px;
    color: #a0aec0;
    padding: 0px !important;
    padding-right: 10px !important;
    padding-left: 10px !important;
    transition: color 0.3s ease;
    height: 100%;
}

.copy-button:hover {
    background: transparent !important;
    color: var(--rr-primary-color, #2563eb) !important;
}

.referral-input-wrapper button {
    padding: 10px 12px;
    background-color: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.referral-input-wrapper button:hover {
    background-color: #1e40af;
}

.referral-box {
    font-size: 15px;
    color: #333;
    margin-bottom: 15px;
    margin-top: 15px;
}

.alert-custom {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 10px;
    font-size: 15px;
    margin-top: 20px;
    border-right: 5px solid #2563eb;
}

.alert-custom a {
    font-weight: bold;
    color: #2563eb;
    text-decoration: none;
}

.alert-custom a:hover {
    text-decoration: underline;
}

/* === WooCommerce Profile Referral Code === */
.wc-profile-referral-code {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #ddd;
    margin: 20px 0;
}

.wc-profile-referral-code h6.text-muted {
    color: #666;
    font-size: 16px;
    margin-bottom: 5px;
    margin-top: 20px;
}

.wc-profile-referral-code h6.text-muted:first-child {
    margin-top: 0;
}

.wc-profile-referral-code p {
    font-size: 15px;
    color: #333;
    margin-bottom: 15px;
}

.wc-profile-referral-code .alert-custom {
    background-color: #f8f9fa;
    border-right: 4px solid #2774e8;
    color: #2f4368;
    padding: 15px;
    border-radius: 5px;
    font-size: 15px;
    margin-top: 20px;
    text-align: right;
}

.wc-profile-referral-code .alert-custom a {
    color: #2774e8;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.wc-profile-referral-code .alert-custom a:hover {
    text-decoration: underline;
    color: #1a5cb0;
}

/* === إعدادات التصميم المخصصة === */
.referral-admin-wrapper .form-table input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.referral-admin-wrapper .form-table input[type="number"] {
    width: 80px;
}

.referral-admin-wrapper .form-table input[type="text"] {
    width: 300px;
}

/* === التنبيهات === */
.rr-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.rr-alert-success {
    background-color: #4CAF50;
}

.rr-alert-error {
    background-color: #f44336;
}

.rr-alert-warning {
    background-color: #ff9800;
}

.rr-alert-info {
    background-color: #2196F3;
}

.rr-alert.fade-out {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* === الأزرار المخصصة === */
.referral-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.custom-button,
.second-button {
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    display: inline-block;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}


/* === تحسينات إضافية === */
.referral-container h3 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: bold;
}

.referral-tabs-nav {
    margin-bottom: 25px;
}

.referral-tab-content {
    min-height: 200px;
}

.referral-box strong {
    color: var(--rr-primary-color, #2563eb);
    font-weight: bold;
}

/* === تحسينات للأجهزة المحمولة === */
@media (max-width: 768px) {
    .referral-buttons {
        flex-direction: column;
    }
    
    .referral-tabs-nav {
        flex-wrap: wrap;
    }
    
    .referral-tabs-nav button {
        flex: 1;
        min-width: 120px;
    }
    
    .referral-code-box {
        flex-direction: column;
        align-items: stretch;
    }
    
    #referral-code-input {
        width: 100% !important;
        margin-bottom: 10px;
    }
} 

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .rr-main-tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .rr-main-tab {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .rr-sub-tabs {
        flex-direction: column;
        gap: 2px;
    }
    
    .rr-sub-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .rr-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .rr-header h1 {
        font-size: 24px;
    }
    
    .form-table th,
    .form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .form-table th {
        border-bottom: none;
        padding-bottom: 5px;
    }
    
    .wp-list-table {
        font-size: 12px;
    }
    
    .wp-list-table th,
    .wp-list-table td {
        padding: 8px 4px;
    }
}

/* Additional Utility Classes */
.rr-text-center {
    text-align: center;
}

.rr-mb-20 {
    margin-bottom: 20px;
}

.rr-mt-20 {
    margin-top: 20px;
}

.rr-p-20 {
    padding: 20px;
}

.rr-rounded {
    border-radius: 8px;
}

.rr-shadow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Loading States */
.rr-loading {
    opacity: 0.6;
    pointer-events: none;
}

.rr-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0865fe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Button Styles */
.rr-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.rr-btn-primary {
    background: #0865fe;
    color: #ffffff;
}

.rr-btn-primary:hover {
    background: #074bb5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 101, 254, 0.3);
}

.rr-btn-secondary {
    background: #64748b;
    color: #ffffff;
}

.rr-btn-secondary:hover {
    background: #475569;
}

.rr-btn-success {
    background: #22c55e;
    color: #ffffff;
}

.rr-btn-success:hover {
    background: #15803d;
}

.rr-btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.rr-btn-danger:hover {
    background: #991b1b;
}

/* Card Styles */
.rr-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.rr-card-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.rr-card-title {
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.rr-card-body {
    color: #64748b;
    line-height: 1.6;
}

/* Status Indicators */
.rr-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.rr-status-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #22c55e;
}

.rr-status-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.rr-status-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Progress Bar */
.rr-progress {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.rr-progress-bar {
    height: 100%;
    background: #0865fe;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Tooltip */
.rr-tooltip {
    position: relative;
    display: inline-block;
}

.rr-tooltip .rr-tooltip-text {
    visibility: hidden;
    width: 200px;
    background: #1e293b;
    color: #ffffff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.rr-tooltip:hover .rr-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Badge */
.rr-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 10px;
}

.rr-badge-primary {
    background: #0865fe;
    color: #ffffff;
}

.rr-badge-secondary {
    background: #64748b;
    color: #ffffff;
}

.rr-badge-success {
    background: #22c55e;
    color: #ffffff;
}

.rr-badge-warning {
    background: #f59e0b;
    color: #ffffff;
}

.rr-badge-danger {
    background: #ef4444;
    color: #ffffff;
} 