/* Modern Referral System Page Styles */
.modern-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: none;
    overflow: hidden;
    margin: 1rem;
}

.card-header-modern {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 24px 32px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn-modern {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn-modern:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.content-section {
    padding: 24px;
}

/* Form Section Styles */
.form-section {
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.form-header {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-body {
    padding: 24px;
}

.form-group-modern {
    margin-bottom: 20px;
}

.form-label-modern {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
}

.form-control-modern {
    width: 100%;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Referral Link Container */
.referral-link-container {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 16px;
}

.referral-input {
    flex: 1;
    font-family: 'Courier New', monospace;
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-modern {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

.btn-copy {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    min-width: 120px;
}

.btn-save {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
}

/* Referral Stats */
.referral-stats {
    display: flex;
    gap: 20px;
    margin-top: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    border: 1px solid #bae6fd;
    color: #0369a1;
    font-size: 14px;
}

.stat-item i {
    font-size: 16px;
}

/* Modern Table Card */
.modern-table-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table-header-modern {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.table-container {
    padding: 0;
}

/* Modern Table Styles */
.table-modern {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background: #f8fafc;
    border: none;
    padding: 16px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.table-modern tbody td {
    border: none;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table-modern tbody tr:hover {
    background: #f8fafc;
}

/* User Info Styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.username {
    font-weight: 500;
    color: #1f2937;
}

.referral-id {
    font-family: 'Courier New', monospace;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #374151;
}

.date-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-info small {
    color: #6b7280;
    font-size: 11px;
}

/* Modern Form Card */
.modern-form-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: fit-content;
}

.form-help {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

.empty-state h5 {
    margin-bottom: 8px;
    color: #374151;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Pagination Styles */
.pagination-container {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-info {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.pagination-nav {
    display: flex;
    align-items: center;
}

.pagination-modern {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination-modern .page-item {
    display: inline-block;
}

.pagination-modern .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    margin: 0 2px;
    color: #64748b;
    text-decoration: none;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    gap: 6px;
}

.pagination-modern .page-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pagination-modern .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pagination-modern .page-item.disabled .page-link {
    color: #d1d5db;
    background: #f9fafb;
    border-color: #e5e7eb;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-modern .page-item.disabled .page-link:hover {
    background: #f9fafb;
    color: #d1d5db;
    border-color: #e5e7eb;
    transform: none;
    box-shadow: none;
}

.pagination-modern .page-link i {
    font-size: 12px;
}

.pagination-modern .page-link span {
    font-size: 14px;
}

/* Animation Enhancements */
.modern-card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-modern:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.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 var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success States */
.success-state {
    border-color: #10b981 !important;
    background-color: #ecfdf5 !important;
}

/* Error States */
.error-state {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-card {
        margin: 0.5rem;
        border-radius: 12px;
    }
    
    .card-header-modern {
        padding: 20px 24px;
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .content-section {
        padding: 20px;
    }
    
    .form-body {
        padding: 20px;
    }
    
    .referral-link-container {
        flex-direction: column;
    }
    
    .btn-modern {
        width: 100%;
        justify-content: center;
    }
    
    .referral-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .table-header-modern {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .table-modern {
        font-size: 14px;
    }
    
    .table-modern thead th,
    .table-modern tbody td {
        padding: 12px 16px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .pagination-info {
        order: 2;
    }
    
    .pagination-nav {
        order: 1;
    }
    
    .pagination-modern .page-link {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .modern-card {
        margin: 0.25rem;
        border-radius: 8px;
    }
    
    .card-header-modern {
        padding: 16px 20px;
    }
    
    .content-section {
        padding: 16px;
    }
    
    .form-body {
        padding: 16px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .table-modern thead th,
    .table-modern tbody td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}